Comments: Button Pad Hookup Guide


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Dan M / about 6 years ago / 2

    Would it make sense to use common anode LEDs instead, with + connected to the "LED-GND" pins, so that the RGB pins can be connected to a constant-current sink PWM controller like your LED Driver Breakout?

    Though I'd put in a vote for a NeoPixel version as well.

  • EBeamBob / about a year ago / 1

    Exercise 1 has a bug that only appears if your button matrix isn't square, which is to say the number of columns and rows are different. The calculations for the LED_buffer array indexes at the end of the loop() function should be divided by the number of ROWS, not columns.

  • loconut / about 4 years ago / 1

    Is there any way to do velocity detection with this or any similar device? I need to make a fairly sizeable grid of these (approximately 101 keys....) but with velocity sensitivity.. is there any way to get velocity out of the minute timescale changes in electrical value as the switch contacts using a chip?

  • Member #660225 / about 6 years ago / 1

    I'm having an issue with this tutorial. It started out with a couple of the LEDs being a constant green or blue, but upon possibly fixing that issue, it's turned into some LEDs just not turning on at all (I'm still on the first step to test the red pins). After looking at the datasheet for the LEDs it appears that the blue & green pins are rated up to 3.2v, while the red is only rated up to 2.2v. I'm using a Teensy 3.6 which outputs 3.3v at each pin. Since the tutorial doesn't have us putting resistors between the color pins, I'm guessing that means I'm burning up the red output on my LEDs. Does that sound right? If that's the case, how does this work with what I'm assuming is 5v per pin output on the Arduino Mega without burning up the entire LED?

    I'm going to do another test tonight with 470k resistor between the MCU and each Red 1-4 pin to see if that solves my problem. Want to sanity check here and make sure I'm not misunderstanding something.

    • Member #660225 / about 5 years ago / 1

      Just as an update, once I replaced all the bulbs with burnt out reds, putting the 470 ohm resistor between each Red 1-4 worked like a charm. The LEDs are a little dim, after running through the resistance formula (with voltage drop counted in) I only actually need 47 ohms, but that’s for my Teensy which outputs 3.3v. Your mileage will vary with an Arduino. My recommendation to any beginner who reads this:

      1. Make sure you order more than you think you’ll need. As much as I prefer to support SparkFun, you may be able to find the same LEDs on the internet in bulk.
      2. Make sure you have plenty of solder wick & a solder sucker on hand. Find tutorials on YouTube for using both.
      3. If you have problems with the LEDs not lighting or lighting in the wrong color, try putting a resistor in between. You can search for a calculator to give you resistance for an LED bulb (it’s slightly different than the normal formula due to the voltage drop from the LED).

      Good luck! I’m not an expert, but hoping the lessons I’ve learned the hard way will help others.

  • AmyGoodchild / about 6 years ago / 1

    Thanks so much for this! The matrix scanning explanation is so clear and understandable.

    There is just one thing, it says "Here you see the LEDs near the top, the buttons below that, and the microcontroller along the left. The LEDs and buttons are in a scan matrix arrangement."... shouldn't that say "microcontroller along the right" or am I misunderstanding something?

    Thanks again!

  • Aiotea / about 6 years ago / 1

    I just finished soldering mine. I am wondering is there any way to control this with a Raspberry Pi instead? I am much more comfortable in that environment but don't know how would the wiring be? Any advice here is appreciated...

    • You should be able to just connect each LEDs row & column to any GPIO pin of the Raspberry Pi. The same goes for the button if you are using the internal pull up resistors on the Pi. You could also use an I/O expander [ ] or multiplexer to control the LEDs.

      • Member #1518829 / about 5 years ago / 1

        Hi, I am fairly new to raspberry pi and I have a question. does this mean that I don't have to use the ground pins on the pi at all?

        • Usually GND is used for reference. However, the I/O pins are the "GND" pins used in this design whenever the pin is pulled LOW. Just make sure to check out the note on The Limits of I/O Pins in exercise #3.

  • Member #1075491 / about 7 years ago / 1

    Hi, I have problem with exercise 1 and 2. I hooked button pad up as You showed. Now everytime I copy and compile your code to mega 2560 or uno everything works as it should but, some of RGB LEDs shine in blue or green despite the fact green and blue pins are not connected. I've tried with different pcb and still got same problem. How can I fix it ?

    • Member #660225 / about 6 years ago / 1

      I know this was awhile ago, but for anyone with the same problem: I had this issue myself. I'm still working through additional problem but I think I have it nailed down to a couple things.

      I think I had some "fat solders" that were touching across pins on one of the LEDs; I pulled out and put back the column pins one by one until the problem went away (ie. the LEDs that were blue or green turned off) and it appeared that (in my case) column 4 was causing problems with columns 1 and 2. Looking at column 4 it appeared that there was a bad solder on one of the pins causing it to short with the pin next to it. Once I resoldered them that problem seemed to go away.

  • Member #879257 / about 8 years ago / 1

    Hi, thanks so much for this tutorial. I would like to use four of the Button Pads instead of just one. My guess is that the Arduino Mega can't handle this.. because there are not enough pins. How would I get started on this? Thanks!

    • Byron J. / about 8 years ago / 2

      There are a number of ways you can add more I/O pins using some external logic chips.

      The SX1509 is a 16-channel I/O expander, that interfaces using I2C. It has a mode that can scan an 8x8 matrix all by itself. They also have configurable addresses, so you can chain up to four of them on the same I2C bus.

      A little more primitive than that, you can use various discrete logic solutions to tack on more I/O. A 4-to-16 multiplexer can turn 4 outputs bits into 16 one-hot bits. Shift registers, like the 47hc165 and 74hc595 can add 8 digital inputs or outputs. With a little glue logic, you can tie them to the processor using SPI. For driving the LEDs, a high-power shift register, like the TPIC6B595 would work better than plain CMOS.

      • Webby / about 6 years ago / 1

        I can confirm the use of the SX1509 is a great solution to driving the LED array via I2C, I have a Pro micro driving one SX1509 for all the LEDs doing the multiplexing and colour fading and a second SX1509 to run the button array. Next is to add either the Musical Instrument shield or MP3 player shield to have myself a mini Launchpad (still working out which will be the best option to go with).

  • stej / about 9 years ago / 1

    How about replacing the RGB LEDs with NeoPixels?

If you've found an issue with this tutorial content, please send us your feedback!