Track My Order
Frequently Asked Questions
International Shipping Info
Mon-Fri, 9am to 12pm and
1pm to 5pm U.S. Mountain Time:
Chat With Us
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.
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.
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:
Good luck! I’m not an expert, but hoping the lessons I’ve learned the hard way will help others.
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?
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 [ https://www.sparkfun.com/products/13601 ] or multiplexer to control the LEDs.
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 ?
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.
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!
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.
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).
How about replacing the RGB LEDs with NeoPixels?
Great idea stej
If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!
Forgot your password?
No account? Register one!