Urgent help with transistor use
NB_Nesquik
Posts: 35
Hello,
I am new to usung microcontrollers and i have a project i need help with. I am using a BASIC Stamp Homework Board that came in my Whats a Microcontroller Activity Kit. I am also using a piezo speaker and 5mm 3-3.2V 12000 to 15000 MCD LEDS. I have access to all of the electronics that come with the Whats a Microcontroller Kit as well as the Boe-Bot refresher kit. The reason why I am writting is because I do not know how exactally to wire the LEDs on my board. I want to beable to controll 17 of the 5mm LEDs with one I/O pin as well as have 5 other sets of three LEDs, each controlled with an I/O pin. I do not know how to wire up the set so that the LEDs shine at their maximum brightness, while not destroying my board. I have done some research and found that some sources say to use transistors to increase the amount of power to the LEDs with only a small amount of power coming from the I/O pin and the board's Vdd. If you could help with what types of resistors as well as the transistors or other electronics, that would help a lot. Also, i have a time crunch for this project, so the faster we can get this working, the better.
Sincearlly,
NB_Nesquik
PS: When the project is fully assembled, the LEDs will be attached to the board with jumper wires so they can reach farther.
I am new to usung microcontrollers and i have a project i need help with. I am using a BASIC Stamp Homework Board that came in my Whats a Microcontroller Activity Kit. I am also using a piezo speaker and 5mm 3-3.2V 12000 to 15000 MCD LEDS. I have access to all of the electronics that come with the Whats a Microcontroller Kit as well as the Boe-Bot refresher kit. The reason why I am writting is because I do not know how exactally to wire the LEDs on my board. I want to beable to controll 17 of the 5mm LEDs with one I/O pin as well as have 5 other sets of three LEDs, each controlled with an I/O pin. I do not know how to wire up the set so that the LEDs shine at their maximum brightness, while not destroying my board. I have done some research and found that some sources say to use transistors to increase the amount of power to the LEDs with only a small amount of power coming from the I/O pin and the board's Vdd. If you could help with what types of resistors as well as the transistors or other electronics, that would help a lot. Also, i have a time crunch for this project, so the faster we can get this working, the better.
Sincearlly,
NB_Nesquik
PS: When the project is fully assembled, the LEDs will be attached to the board with jumper wires so they can reach farther.
Comments
-Phil
Also, you mentioned that the LEDs have a forward voltage of 3.0 - 3.2V. Is that just for the 17 center ones, which I presume to be blue or white? What colors are the other LEDs? If they're not blue or white, they will have lower forward voltages.
-Phil
All of the LEDs im using are white 3.0 - 3.2V. the outside ones will be the same as the center 17.
-Phil
N&V column "Silicon Steroids for the Stamp" #6 (.pdf)
StampWorks Manual starting at page 130
Data sheet for ULN2803A (you may need some of these depending on the current required for your LEDs)
These will give you some ideas about how to expand the the outputs for the 17 LEDs and a way to drive them.
As mentioned earlier you will have to:
1. Determine the current required for each LED.
2. Decide what voltage will power the LEDs in order to size the current limiting resistors.
-Scott
NB_Nesquik, driving three or more 3V LEDs is going to be a little awkward with just a 9V supply. You should go to RadioShack and get either a 12V wall transformer or a battery holder that holds eight AA cells. You will use this to power your LEDs, leaving the 9V battery to power the BASIC Stamp. The transistors can be any general-purpose NPN, such as 2N3904, PN2222, 2N4401, etc. If you don't have access to a 33-ohm resistor, put three 100-ohm resistors in parallel, or three 10-ohm resistors in series.
Here's how the circuit works:
2. The current that flows though the LED will be nearly equal to the current in the 33-ohm emitter resistor.
3. As the voltage across this resistor approaches 0.6V, Q2 begins to turn on, which starts to pull down the base of Q1, in an attempt to turn it off.
4. This process continues until the voltage across the 33-ohm resistor is just slightly above 0.6V, at which point equilibrium is reached.
5. 0.6V / 33 ohms = 18 mA.
IOW, the two transistors not only drive the LEDs, but form a current regulator that limits the current through them.
Now, that handles the case of three LEDs. I'll let you try to figure out how to handle the 17. I'm here to help if you get stuck.
-Phil
-Phil
-Phil
Not really. I tried driving it with 10V, single-ended and with 5V push-pull, without any discernible difference in volume, compared to the normal BASIC Stamp setup. It's easier with a magnetic speaker.
-Phil
Thank you for all of your help. The project worked great. I was wondering, could you explain how you made your calculations, or if there are any really good websites explaining how to use transistor in simple language for beginners. Im thinking of using similar circuits to this one but with different types of LEDs and transistors. If you could help me to understand how to calculate which transistors to use and other calculations, that would be great.
Thanks so much,
NB_Nesquik
-Phil