this post was submitted on 22 Jun 2023
6 points (100.0% liked)

Do It Yourself

7735 readers
1 users here now

Make it, Fix it, Renovate it, Rehabilitate it - as long as you’ve done some part of it yourself, share!

Especially for gardening related or specific do-it-yourself projects, see also the Nature and Gardening community. For more creative-minded projects, see also the Creative community.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

I am drawing out diagrams for a project I want to do to involve loads of buttons in a 8x8 grid but... I don't know how to go about driving them, if someone could show a simple way to not use a lot of pins to accomplish this I'd be happy as then I'd be able to continue drawing out my plans.

This is my first electrical project, so loads of learning to do

top 10 comments
sorted by: hot top controversial new old
[–] infinitevalence@discuss.online 3 points 1 year ago (1 children)

Can we get some context of voltages, and the project?

[–] CinnamonTheCat 1 points 1 year ago

I'm making a digital chess board, it's supposed to be some LEDS with buttons on top, acrylic so the LED light shines through

The voltages I'm unsure about thought the LEDs use ~3v the microcontroller varies

[–] paul@longley.ws 3 points 1 year ago (1 children)

@CinnamonTheCat
Take a look at some keyboard matrix designs.
This is a reasonable guide:
https://www.baldengineer.com/arduino-keyboard-matrix-tutorial.html

Hope that helps :)

[–] CinnamonTheCat 1 points 1 year ago

Thank you so much this helps a ton!

[–] nyan@lemmy.cafe 1 points 1 year ago

A couple of mux-demux chips should be able to cut your requirements down to 6 pins. This kind of chip, I mean.

[–] IrritableOcelot 1 points 1 year ago (1 children)

If you want something simple to set up, I've used the Adafruit Trellis Neo in the past, you can solder many many boards together in a grid and communicate over I2C or USB to a microcontroller. The only hitch is that control requires CircuitPython, which can be a pain to install.

[–] CinnamonTheCat 1 points 1 year ago (1 children)

No python allowed in this project. The point is for me to code a microcontroller to do something on my own

[–] IrritableOcelot 1 points 1 year ago

I2C is a simple standard, you can manually control it if you want.

[–] flame 1 points 1 year ago (1 children)

How big do you want the buttons to be? If they’re small, you can look into making lighted buttons using mechanical keyboard keys that have a hole for a SMD LED. If you want bigger buttons, arcade LEDs buttons will work.

As for driving them, I suggest getting neopixels which can be daisy chained and controlled via I2C which is only 2 pins from an MCU. There’s no way an MCU can power 64 LEDs though, so the neopixels would need to be directly powered.

As for determining which of the 64 buttons was pressed, if only one should be pressed at a time, the other comment mentioning keyboard multiplexing works which requires 16 digital pins. If you really want to use the absolute minimum amount of pins though, you can feed 4 rows into a resistor ladder DAC and send the output into single analog pin which would then only require 4 analog pins for 64 buttons. You might be even be able to go with sending all 8 rows and all 8 columns into 2 analog pins since Arduino ADCs are 12 bits if your resistor values are accurate enough.

[–] CinnamonTheCat 1 points 1 year ago

The arcade ones look kinda meh however I was thinking of making large panels to press

load more comments
view more: next ›