Today I received my order of the adafruit two bicolor 12 Led bargraph, I ordered it from a store located in my county(Netherlands).
Everything went fine but it didn't came with the i2c backpack, I tried connecting it to my arduino but with the multiplex/matrix thing going on this doesn't work...
For as far as I see the backpack isn't sold seperately, so I guess I have to figure out another way of connecting this thing...
The store page says:
"Since the display is multiplexed we suggest using 3 PNP transistors to drive the anodes with microcontroller pins and then a 74HC595 to drive the cathodes."
I have some experience with arduino and electronics but this goes beyond my knowledge :P
Does anybody has got any advice on what I can do? I'm quite lost at this point.
Arduino 24Led bargraph
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- zener
- Posts: 4567
- Joined: Sat Feb 21, 2009 2:38 am
Re: Arduino 24Led bargraph
Can you provide link to the product you are talking about?
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Arduino 24Led bargraph
I think you're talking about the 12-LED Bicolor bargraph here: https://www.adafruit.com/products/459
The datasheet linked from the product page shows how all the LEDs are connected to the pins:
http://www.adafruit.com/datasheets/BL-AR12Z3010DUG.pdf
Basically each bar on the display has two LEDs under it: one red and one green. The LEDs are grouped into three sets of eight, with a common anode (positive pin) providing power to all eight LEDs in a set. You control the LEDs through their cathodes (negative pin), and it takes eight control pins to handle four bars in the display.
That's a lot of pins for an Arduino, so you can use a 74HC595 serial-in/parallel-out shift register to get extra pins. The '595 has been a popular add-on to the Arduino since before the Arduino was cool, so there are lots of tutorials on how to work with them. Ours is in the Learning System here:
https://learn.adafruit.com/adafruit-ard ... s/overview
You can chain three '595s in series to get 24 independent output pins, but that uses extra chips and consumes extra space. The alternative is to 'multiplex' the three sets of LEDs by connecting them to a single '595 and using transistors to control the power through their anodes.
If we number the pins in each set 1-8, you can connect all three #1 LEDs to output pin 1 on the '595, all three #2 LEDs to pin 2, etc. Normally this would mean that using pin 1 on the '595 to turn on an LED would turn all three #1 LEDs, but that's where the transistors come in.
Multiplexing is just a fancy way of saying "make them take turns". You start by shutting off all three transistors controlling the anodes, shift the control signals for the first set onto the '595, then turn on the transistor that controls the anode for set 1. Then you turn off transistor 1, shift the control signals for the second set of LEDs onto the '595, and turn on transistor 2. Then you turn off transistor 2, shift the control signals for the third set of LEDs onto the '595, and turn on transistor 3.
At any given moment, only 1/3 of the display will be lit, and the other two will be dark. That doesn't matter if you run through the cycle fast enough though. If each set is on for 5 milliseconds and off for 10ms, the whole display is updating at about 67 frames per second.. far too fast for the human eye to see. A person looking at the display will think the whole bargraph is lit continuously.
The datasheet linked from the product page shows how all the LEDs are connected to the pins:
http://www.adafruit.com/datasheets/BL-AR12Z3010DUG.pdf
Basically each bar on the display has two LEDs under it: one red and one green. The LEDs are grouped into three sets of eight, with a common anode (positive pin) providing power to all eight LEDs in a set. You control the LEDs through their cathodes (negative pin), and it takes eight control pins to handle four bars in the display.
That's a lot of pins for an Arduino, so you can use a 74HC595 serial-in/parallel-out shift register to get extra pins. The '595 has been a popular add-on to the Arduino since before the Arduino was cool, so there are lots of tutorials on how to work with them. Ours is in the Learning System here:
https://learn.adafruit.com/adafruit-ard ... s/overview
You can chain three '595s in series to get 24 independent output pins, but that uses extra chips and consumes extra space. The alternative is to 'multiplex' the three sets of LEDs by connecting them to a single '595 and using transistors to control the power through their anodes.
If we number the pins in each set 1-8, you can connect all three #1 LEDs to output pin 1 on the '595, all three #2 LEDs to pin 2, etc. Normally this would mean that using pin 1 on the '595 to turn on an LED would turn all three #1 LEDs, but that's where the transistors come in.
Multiplexing is just a fancy way of saying "make them take turns". You start by shutting off all three transistors controlling the anodes, shift the control signals for the first set onto the '595, then turn on the transistor that controls the anode for set 1. Then you turn off transistor 1, shift the control signals for the second set of LEDs onto the '595, and turn on transistor 2. Then you turn off transistor 2, shift the control signals for the third set of LEDs onto the '595, and turn on transistor 3.
At any given moment, only 1/3 of the display will be lit, and the other two will be dark. That doesn't matter if you run through the cycle fast enough though. If each set is on for 5 milliseconds and off for 10ms, the whole display is updating at about 67 frames per second.. far too fast for the human eye to see. A person looking at the display will think the whole bargraph is lit continuously.
- Zenkaipu
- Posts: 2
- Joined: Wed Oct 15, 2014 4:35 pm
Re: Arduino 24Led bargraph
Wow thanks for the reply!
I've been looking at the tutorial you send and I'm gonna give this a try. There's a local "radio shack" close where I live so i'm going to look for parts there.
I've been looking at the tutorial you send and I'm gonna give this a try. There's a local "radio shack" close where I live so i'm going to look for parts there.
Please be positive and constructive with your questions and comments.