As part of a larger project, I needed some 7-segmented digit displays.
I had some cheap ones lying around, and I forgot where I bought them. Thankfully, I found the data sheet here. Since running 16 lines from an Arduino would be quite wasteful, I designed them to be controlled by two shift registers. Here is the information I used to wire it all up. Shift register wiring can be found here.
Note that since I was soldering to the back, I flipped the pinout of the digit displays. One shift register controls each digit, and the first shift register passes information to the second.
For code I used the shiftOut function. That turns on the LED’s with a binary number, so it comes down to seeing which binary number creates what displayed number. I made a table to figure it out. So now all you have to do is send a number between 0 and 99 to the displayDigit function.
With all the snow we got last night I had plenty of time to write some code in peace. I just received my RGB LED strand with the WS2811 drivers built right in and I just had to play with them.
I gotta say, these LEDs with the drivers built in them are way cool. The circuitry and programming is way easier. And it’s very economic. I got this strand of 60 LEDs for $20 including shipping.
Circuity is dead simple. All the strand needs is 5V, Gnd, and Data. Since the strand isn’t too long, I just used the 5v from my arduino. If I had a longer strand or more strands I would have used a separate power source.
After I had some fun playing with the NeoPixel Library from adafruit making rainbows and such, I needed to take it to the next step: music controlled.
The circuit required for music control isn’t as simple, but it’s still not a heck of a lot when it comes to component count or cost.
- 33 pF cap
- 100 nF cap (2)
- 10 nF cap
- 200 K resistor
- MSGEQ7 Chip
From there it’s all programming. I made a few different modes, and I currently have it so it cycles through all the modes. The code is here, free to download.
I won’t go into the specifics of the program , but the basics of the code is reading in the values of the MSGEQ7 chip in the readAudio() method and then using that data to create fancy blinking lights on the strand.
Videos of it in action are at the bottom. I apologize for the horrendous quality: I used that particular speaker since it didn’t need any amplification or additional circuitry, and who would have guessed phone camera’s aren’t particularly good at capturing blinking LEDs. Guess you’ll have to build one yourself to see how it looks!