Hello AAC,
I am playing with circuits and the Raspberry Pi, trying to understand voltage and current, and how to safely interface with a device that has limits to such things (i.e. the Raspberry Pi).
For those who haven't played with a Raspberry Pi, there is a 40-pin header called the GPIO (General Purpose Input Output) that allows outside circuitry to be connected and manipulated via programs running on the Raspberry Pi (typically some variant of Linux). Each data pin is capable of being set to either input or output, and operates at 3.3 volts.
The Raspberry Pi, from what I can gather from available information, has a current limit of 16mA per GPIO pin, and 50mA for the header as a whole.
I have built a circuit that I *think* is safe for the Raspberry Pi, but I'd like to post my calculations and get your opinions. I have done a lot of research, but I still have many questions.
I salvaged a really neat 3-digit 7-segment display from an old MIDI controller, and decided to try to use it with the Raspberry Pi - it is pictured in image_a. The component is labeled E1-3056AUG1, and although I could only find a datasheet for an E1-3056CUY1, it was close enough to allow me to get things going. I learned that the "A" in AUG is for common anode (versus common cathode in the datasheet I found), and the "UG" is ultra green. If the values are similar to the "CUY" datasheet, I should be looking at a forward voltage of about 1.8v (2.3v max).
So, to light this thing up from the Raspberry Pi, I need to use one of the 3V3 pins with a resistor per digit's common anode. Using the 1.8v spec from the datasheet, I used the following calculation to determine the proper resistance. I was hoping to use around 10mA per each of the three pins.
(Vsup - Vled) / current = (3.3 - 1.8) / 0.010 = 150 ohm resistor
I ended up using 120 ohm resistors, so the current per pin should actually be about 12.5mA, still comfortably below the 16mA per pin limit. Since I have three common anodes to power, that's 37.5mA total draw from the header.
OK, so now I need to put transistors on the other pins and control them with 8 more GPIO pins (segments a - g plus the decimal), but I need to keep the combined current draw below 12.5mA.
This is where I'm having trouble.
I'm using NPN transistors for this, since it's a common anode display, and I went with 8 BC574B transistors. I *think* I want to look at the "Base Emitter Saturation Voltage" number on the datasheet? Since it reads 0.7v for Ic @ 10mA / Ib @ 0.5mA, this was closest to my case and I used that in the same calculation.
Is it correct to use the same formula to determine the resistors I need to keep the current down? For example, if I wanted 1mA draw:
(Vsup - Vbe) / current = (3.3 - 0.7) / 0.001 = 2,600 ohms
I ended up using 2,200 ohm resistors, so by the same calculation the current draw should be 1.18mA each pin, or 9.44mA for all eight segment transistors. Added to the 37.5 mA for the 3 common anodes, that's 47.34mA, and safely under my 50mA header max current draw.
The attached image_b is the breadboard with the salvaged E1-3056AUG1, connected to the Raspberry Pi GPIO pins. Everything seems to work, but I'm super paranoid about this stuff, so I wanted to run it by you all.
Am I looking at transistors correctly when trying to calculate current? Am I on the right track with this stuff, or am I off base to some degree?
Thanks for reading!

I am playing with circuits and the Raspberry Pi, trying to understand voltage and current, and how to safely interface with a device that has limits to such things (i.e. the Raspberry Pi).
For those who haven't played with a Raspberry Pi, there is a 40-pin header called the GPIO (General Purpose Input Output) that allows outside circuitry to be connected and manipulated via programs running on the Raspberry Pi (typically some variant of Linux). Each data pin is capable of being set to either input or output, and operates at 3.3 volts.
The Raspberry Pi, from what I can gather from available information, has a current limit of 16mA per GPIO pin, and 50mA for the header as a whole.
I have built a circuit that I *think* is safe for the Raspberry Pi, but I'd like to post my calculations and get your opinions. I have done a lot of research, but I still have many questions.
I salvaged a really neat 3-digit 7-segment display from an old MIDI controller, and decided to try to use it with the Raspberry Pi - it is pictured in image_a. The component is labeled E1-3056AUG1, and although I could only find a datasheet for an E1-3056CUY1, it was close enough to allow me to get things going. I learned that the "A" in AUG is for common anode (versus common cathode in the datasheet I found), and the "UG" is ultra green. If the values are similar to the "CUY" datasheet, I should be looking at a forward voltage of about 1.8v (2.3v max).
So, to light this thing up from the Raspberry Pi, I need to use one of the 3V3 pins with a resistor per digit's common anode. Using the 1.8v spec from the datasheet, I used the following calculation to determine the proper resistance. I was hoping to use around 10mA per each of the three pins.
(Vsup - Vled) / current = (3.3 - 1.8) / 0.010 = 150 ohm resistor
I ended up using 120 ohm resistors, so the current per pin should actually be about 12.5mA, still comfortably below the 16mA per pin limit. Since I have three common anodes to power, that's 37.5mA total draw from the header.
OK, so now I need to put transistors on the other pins and control them with 8 more GPIO pins (segments a - g plus the decimal), but I need to keep the combined current draw below 12.5mA.
This is where I'm having trouble.
I'm using NPN transistors for this, since it's a common anode display, and I went with 8 BC574B transistors. I *think* I want to look at the "Base Emitter Saturation Voltage" number on the datasheet? Since it reads 0.7v for Ic @ 10mA / Ib @ 0.5mA, this was closest to my case and I used that in the same calculation.
Is it correct to use the same formula to determine the resistors I need to keep the current down? For example, if I wanted 1mA draw:
(Vsup - Vbe) / current = (3.3 - 0.7) / 0.001 = 2,600 ohms
I ended up using 2,200 ohm resistors, so by the same calculation the current draw should be 1.18mA each pin, or 9.44mA for all eight segment transistors. Added to the 37.5 mA for the 3 common anodes, that's 47.34mA, and safely under my 50mA header max current draw.
The attached image_b is the breadboard with the salvaged E1-3056AUG1, connected to the Raspberry Pi GPIO pins. Everything seems to work, but I'm super paranoid about this stuff, so I wanted to run it by you all.
Am I looking at transistors correctly when trying to calculate current? Am I on the right track with this stuff, or am I off base to some degree?
Thanks for reading!

