![]() |
Forum Index : Microcontroller and PC projects : Driving ordinary LEDs
Author | Message | ||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
I am designing a unit that will have up to 8 small LEDs illuminated at once (each LED will take about 15-20 mA). I am wondering if I need to drive them with transistors or if I can drive them direct from the Micromite. In other words, is there a current limit per pin or is there an overall current limit? How strict is that? Would it be any different with the Explore-64 (which I have on order)? If I have to use transistors, what is recommended and what then would the current draw be per pin, using the transistor just as switch. I suspect this is an elementary question but I was brought up with KT66s (in fact HL2s to start with). This is all new to me. Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
15-20mA is a bit high for the outputs. I would normally use a ULN2803 which is 8 transistors in a DIL package. The base resistors are in there as well so it easy to interface directly to the micromites. Jim VK7JH MMedit |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
You can get away with it when you use white or blue LED's. They are bright when using about 5ma. When all 8 are on, then it still is only about 40ma. That is within the specs of the chip. Alternatively you an use a PWM pin to drive two transistors. A PNP and a NPN. This will then allow you to alternately enable two groups of 4 LEDs. Least amount of external parts will be to drive one LED at a time but from BASIC i am not sure if it will be fast enough to give the illusion they are all on at once. Microblocks. Build with logic. |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
Thanks Microblocks and TJ. I've ordered the ULN2803, which seems a very elegant way of doing it. I posted about that but for some reason the post has not appeared... Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
Further to that, I am a bit out of my depth with interfacing the ULN2803 with the LEDs. Looking for data but without luck at the moment. And I also want to determine if I can run the ULN2803 from 3.3 volts via a regulator, or if 5 volts are preferable. Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
donmck![]() Guru ![]() Joined: 09/06/2011 Location: AustraliaPosts: 1314 |
Here are some old SimmStick boards I was using with ULN2803 drivers (Circa 1999?) https://www.shop-dontronics.com/simmstick-and-related/dt203-2.html Old page on my original web site: http://www.dontronics.com/dt203.html and the schematic: http://www.dontronics.com/graphics/dt203bct.gif Hope this helps Cheers Don... https://www.dontronics.com |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
If you have 5V available, use it rather than 3.3V. A resistor of 330 ohms in series with each LED is a good starting value. Adjust to suit brightness/current. The higher voltage makes differences in forward voltage drop in the LEDs less noticeable. Jim VK7JH MMedit |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
Still struggling. What I think I have gleaned so far is that when a high is seen on the ULN2803 pin 1, pin 18 becomes closed circuit to Gnd. So provided pin 10 is connected to +bus, and a LED cathode is connected to pin 18 and the LED anode to +bus, the LED will light. In other words 18 and GND are connected when 1 is high. etc... Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
Hi Harry --- what Jim said. Use the ULN2803 with about a 330 ohm resistor fed by 5v. Vary the resistance a little to get the brightness you want. HL2s!!! You might be older than I, but not by much. Those are vintage 1925, and it was a triode! The beam tetrodes were the 6V6 - KT63, 6L6 - KT66, EL34 - 6CA7 - KT77, and 6550 - KT88. The KT66 (25 W dissipation) was not quite the equivalent of the 6L6 (30 W). The KT stood for "kinkless tetrode" which was what the beam forming suppressor grid did to eliminate the tetrod kink in the lower range of the power curves. Paul in New York. |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
Hi Paul. HL2. I have an original with its box. 1926. 2 volt triode with leaky grid. In a replica of a set I built when 11 (it was not 1926 then!). My previous post showed that my level of understanding is very basic. I am wondering if my 'Still struggling' post is correct. Also, as the 'Mite pins are mostly not 5 v tolerant I am assuming that pin 10 in the ULN should only be connected to +3.3, although I can use +5 on the LEDs if necessary? Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6269 |
Pin 10 of the UNL2803 should be connected to the same supply as the LEDs - 5V. When switching LEDs it is not really needed at all. The reverse diodes are there for switching relays. The 3.3V of the 'mite output is more than enough to turn the UNL2803 transistors on. As long as the zero volts of the UNL2803 and zero of the 'mite are connected together different supply voltages are OK. I often use UNL2803s to control 5V and 12V relays. Look at the circuit diagrams that Don linked to. Jim VK7JH MMedit |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
Hi Harry. Us geezers get confused when things don't have filaments or heaters and don't glow to let us know they're working. Pin 10 and the "freewheeling" diodes are there to dump an inductive kick from relay coils connected to pins 11 through 18, which will be generated when the output transistor suddenly stops the current through the relay coil, back into the filter capacitors or battery of the power source. If you're not driving relays or some other inductive load the diodes don't do anything. You can leave pin 10 floating or hook it to the positive supply feeding the LEDs. The power source feeding the loads, (LEDs, relays or whatever), can be up to 50v which is the maximum voltage the darlington output transistor can block. Each darlington output will sink up to 500 ma., and they and their inputs can be wired in parallel to sink greater currents. The up to 50v. load source will not be reflected back into the input pins 1 through 8 so the source PIC chip is protected. You should select current limiting resistors to protect the LEDs. 330 ohms is a good place to start if the LED source is 5v. If the LED saturates at 0.5v then the series resistor has to drop 4.5 v so I=E/R = 4.5/330 = 13.6 ma. and the LED dissipates P=E*I = 0.5v x 13.6ma = 6.8 mw. which will barely warm it up. If you have a resistor substitution box put it in series with a LED and the 5v supply and dial the resistance down from about 3k until the LED is as bright as you need it, then measure the voltage drop across the resistor, calculate the current in the resistor, then the power being dissipated in the LED, then measure the temperature of the LED with your fingers. If the dissipation is less than 100 mw, it doesn't feel warm, and it's bright enough you're done. Have fun! Does that set you built when you were 11 still work or have the electrolytic capacitors dried out? I started building things right after WWII, but I tried to use more modern tubes. None of my old stuff works anymore. All the electrolytics are dry as a bone. You should be able to sell that HL2 for at least $50 US. That would pay for a lot of PIC chips and UNL2803s. Paul |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
Hi Paul About to go to bed so won't try and get my head round what you've told me about the ULN2803. But re the replica one valve set. This is battery driven and there is no electrolytic cap. Apart from tuning cap and coil, reaction cap and coil, only a 100 pf grid cap with leaky grid resistor (1 meg). It is a part of my history and I would not sell the 1926 HL2 with box for less than A$10,000, which would help with the next historic Jag! The valve has on it 'This filament does not light brightly' or words to that effect. In 1926, dull emitters were new (valves were once as bright as lamps)and people used to try and bump up the filament voltage so that they glowed brightly, thus fusing the filaments! Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
Paul_L Guru ![]() Joined: 03/03/2016 Location: United StatesPosts: 769 |
I had a 1954 Jag XK140 fixed head coupe with the 210 bhp engine and the C type head. I bought it in 1956 and sold it in 1960. It was very cramped because of my 6' 3" height and very long legs. It had a Borg-Warner electric overdrive planetary behind the transmission which gave it 8 forward gears and 2 reverse which, I believe, was only available in the states. It would fit me just fine now, I'm slowly shrinking, I'm only 6' 1 1/2" tall now. In another decade I will disappear entirely. Paul |
||||
Herry![]() Senior Member ![]() Joined: 31/05/2014 Location: AustraliaPosts: 261 |
And I have a confession to make. As Microblocks suggested, white LEDs don't need much current. They are VERY bright with 5 mA. Adequate with about 2.4 mA (series resistor without Mmite in circuit = 220 Ohms) so I don't need ULNs at all! Thanks all and apologies for the ULN red herring. Paul. You should have kept that XK140. Mine's an XJ40 and I am looking at a slightly younger X300 because it has airbags, which this airbag would prefer! Senior?! Whatever it says, I'm a complete and utter beginner... |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |