0
\$\begingroup\$

I have assembled an LED display controller using an Arduino Mega 2560. The controller runs a display sequence on an array of (25) large LED bulbs that draw about 125 mA each. It also has a smaller indicator display of simple yellow LEDs to show the operator what is flashing. The 100K pot is connected to A0 of the Arduino and outputs to PWM on pin 9. Pin 9 then drives and npn transistor that is tied to (2) PNP transistors to regulate the positive 12V and provide dimming.

The trouble I am having is that on some of the flash patterns the bulbs are sequentially turned on together and as they do so they drop in brightness with each step. This happens each time the number of lights is increased. I tried to use capacitors (C3-C5) to smooth out the voltage but it didn't have much effect. There is plenty of power to run all the lights full blast.

I am not sure, but is it possible that driving the base of all of the (16) 2N2222 transistors is too much for the Arduino to handle and causing it to send a decreasing amount of voltage to the bases? I tested the voltage to the base and it does seem to decrease as the number of lights increase by between .01V and .03V. Is that enough to cause a drastic shift in the display? Would a darlington array of transistors to drive the base of the 2N2222 transistors be needed to allow the Arduino to handle them all? I have also seen several LED circuits using inductors that seem to be smoothing out the voltage. Would that be better and how might I implement that on my circuit?

I am mulling over whether to regulate the PWM on the negative side and drive the bases with PWM. Would that require less power? It seems like it would use the same amount to drive the bases. I really appreciate the input.

LEDDisplayController

\$\endgroup\$
2
  • \$\begingroup\$ Sorry, but this schematic is extremely hard to read. \$\endgroup\$ May 7, 2015 at 0:14
  • \$\begingroup\$ I agree, there's a lot of parts going on. I suppose I could spread it all out more. Sorry about that. \$\endgroup\$
    – HiWay
    May 7, 2015 at 0:22

3 Answers 3

2
\$\begingroup\$

R52 and R55 are too large. With 24 big LEDs in parallel, you need 3 amps from your 12 volt supply. Call it 1.5 amps per PNP transistor. Because you want the PNPs to be hard on ("saturated" is the term), you should provide about 150 mA of base drive per transistor. That is, a good rule of thumb for transistors in saturation is that they are operating with a current gain of 10. Assuming 10 volts across the base resistors, they should be about 10 / .15, or 67 ohms. The value is not critical, so 50 to 100 ohms will probably work. And smaller is better. And make sure they can handle the power - use 2 watt resistors at a minimum.

The 1k value which I recommended in your previous version was adequate for the much lower current requirements of your smaller LEDs, but not for these piggies. To put it another way, with 1k base resistors you get about 10 mA of base drive. If you assume a gain in the PNPs of 100, that only provides 1 amp per transistor, rather than the 1.5 you need. Which is why the circuit works OK with only a few LEDs on - they aren't drawing much total current.

Note that this means your 12 volt supply should be rated for at least 4 amps. And you can get rid of the new caps, too. If anything, they add to the current requirements when the transistors first turn on.

EDIT - And, of course, I didn't think things through. A second problem is R51. As with R52 and R55, this is sized for a lower current draw. As given, a 1k R51 provides about 4 mA of base drive to the TIP31. Since the NPN also should be in saturation, this only provides for ~40 mA of solid base drive to the PNPs, when they need 300 mA. Fortunately, the Arduino IO lines are rated for 40 mA of source drive, although the voltage output at this current level is not specified. The NPN needs 30 mA of base drive, and let's figure on 4 volts output at this level. Then 3 volts will be dropped by R51, and 3 /.03 equals 100 ohms. So replace the 1k R51 with 100 ohms and see what happens.

My apologies for not thinking this through.

END EDIT

\$\endgroup\$
11
  • \$\begingroup\$ Thank you again for the input. I am switching out the 1K resistors on the base of the PNP transistors with 68 ohm and see what happens. I do need ones with a higher rating so until I get some in I will see if I can get them to glow. Thank you for that transistor rule of thumb too, I am still getting a handle on a lot of the fine details that make them work properly. I hope to switch the PNPs for MOSFETs soon, I just don't have any on hand. I think they will require less current. \$\endgroup\$
    – HiWay
    May 7, 2015 at 15:55
  • \$\begingroup\$ I lowered the resistors to the PNP transistors down to 68 ohm and it improved the dimming a lot. I still shows when the whole array is dimmed down but it is definitely progress. Thanks again. \$\endgroup\$
    – HiWay
    May 7, 2015 at 16:28
  • \$\begingroup\$ Well the 68ohm resistors are turning a little black but they are holding out for now. You were dead on with the recommendation of higher wattage rating. \$\endgroup\$
    – HiWay
    May 7, 2015 at 17:29
  • \$\begingroup\$ @HiWay - please see edit above. Also, if your resistors are blackening they are dying. Replace them with appropriate sized units while it's easy and you don't have to put out the fire. \$\endgroup\$ May 7, 2015 at 19:45
  • \$\begingroup\$ Thanks for updating that, I added in R51 at 100 ohm. I just realized I didn't have anything at R51 on the soldered PCB and had forgotten it. There is no change on the dimming with 100 ohm at R51. I went ahead and got some 1 watt resistors and put them in. Best to avoid the fire department getting involved. \$\endgroup\$
    – HiWay
    May 7, 2015 at 23:07
0
\$\begingroup\$

Gosh. There are a few things wrong here.

(A) You have no series limiting resistor on each of your (big) LEDs, unless they're built in?

(B) You have 2 or more LEDs in parallel. [i just read your reply to another answer - the big LEDs have resistors of their own - ok]

(C) You might have a problem in the 2N2222s, whose Hfe is typically 100, but could range from 30-300, depending on exactly which of the many variants & brands of the 2N2222 you happen to be using, i.e. 1mA into the Base = 100mA from C to E. With the 1k in series with the Base & assuming Vcc=5.0V, you're probably getting ~4mA into the Base, so the current that results in letting through C to E could be anything from 120mA to 1200mA. To be safe, drop the 1k into the base of the 2N2222s to, say, 820 ohm (if the Hfe of your specific 2N2222s is on the low end of the range).

(D) You may also be running into a problem with the total current sourcing capability of the ATmega2560 MCU. Although each pin is rated for up to 40mA (20 recommended), there's also a maximum for the chip in total (200mA I believe), but I don't think that's your problem, BUT and there may also be limits per 8-bit GPIO port - you'd need to check the datasheet. But I suspect this is the least of your problems.

But the biggest issue I think is (E) You've also got those two TIP42C transistors. Two problems here:

(E1) I think you'll be running into Hfe limits - 15 to 75 for this transistor, which means, worst case, for example a 2.0Amp total load, you need to put up to 130mA into the base (out of it, actually). With 1k, you're pulling out about 11mA, more than an order of magnitude short.

(E2) You have those two transisotrs in parallel, I'm guessing trying to 'share the load'. Unfortunately this often doesn't work as expected, especially if they too are operating in their linear region, which I strongly suspect they are, they won't share equally. There are techniques to achieve this though.

I would switch to using MOSFETs (for all of the transistors), you avoid the Hfe issue with BJTs, you avoid the power wastage in the Base resistors, and you can be assured that they'll be on, and there'll also be no issue with the current-sourcing capability from the ATmega2560, because MOSFET gates work based on voltage, but current (which is virtually zero).

\$\endgroup\$
6
  • \$\begingroup\$ Thank you for taking a look, I appreciate it. The big LEDs have built in resistors and power regulators. There are 40 LEDs on them on a big 5 inch PCB. When I test them they seem to be more around 114 mA than the 125 mA they are stated to run at. The 2N2222s are generic without marking so I am not sure what they are rated at. I have switched the 1K resistors on the base of the TIP41s to 68ohm which improved the performance a lot. I will have to do some math to see how much I am taxing the Mega too. \$\endgroup\$
    – HiWay
    May 7, 2015 at 16:33
  • \$\begingroup\$ The dual TIP42s were to share the load of the array. The lights are never all on at the same time and seem to only max out at 1.5 amp-ish at the most intensive display type. Do you know of a spot to get info on how to get them to get them to share equally? I am off to google. I am planning on switching out to MOSFETs and am wondering if I should abandon all of the transistors. make the t-1000 version of the terminator. \$\endgroup\$
    – HiWay
    May 7, 2015 at 16:42
  • \$\begingroup\$ First of all, check hFE of the TIPs and calculate the base current; then provide them with proper Ib (you can use Darlington circuits, or you can just lower the base resistance). This will push them out of linear region. It may help current sharing. If the current sharing still not good, add 0.5 Ohm in each of the collectors. MOSFETs are more exotic than BJT for a beginner. \$\endgroup\$
    – ilkhd
    May 7, 2015 at 23:22
  • \$\begingroup\$ This question has been asked here before: electronics.stackexchange.com/questions/77045/… And the most popular answer references an article that I was about to recommend to (look in the 'Thermal Mismatch' section, of the linked allaboutcircuits.com page). But the reality is that the TIP42C is rated for 6A continuous, >3x your expected maximum, which is a safe margin. You simply don't need the second one. Either way, make sure they're well heat-sunk, and if you stick with 2, put both on the same heatsink. Have fun! \$\endgroup\$
    – Techydude
    May 7, 2015 at 23:29
  • \$\begingroup\$ @Techydude Thanks for sending that link, I didn't see that one while I was searching. I will search through it more for answers. Would the ballast resistor be along the lines of what I might need? I added heat sinks, They should be one the same one to help make sure they are synchronized correct? I am thinking I might just remove one of the TIP42s though to simplify and remove variables. Thanks again for the hints. \$\endgroup\$
    – HiWay
    May 8, 2015 at 0:33
-1
\$\begingroup\$

You have no external current limiting resistors (or constant current source) going through your '125mA' LEDS - do they have internal current limiting?

My guess is that you're all sharing the interna; resistance of the 12v battery - why don;t you drop a 'scope over the battery and watch what happens as you bring more LEDs on line

\$\endgroup\$
2
  • \$\begingroup\$ The bulbs do have internal resistors. I don't have an oscilloscope to test the batteries, is it something I could test with a multimeter? The circuit runs off of (2) car batteries that are solar charged. How might I decrease the resistance of the battery? \$\endgroup\$
    – HiWay
    May 7, 2015 at 0:34
  • \$\begingroup\$ I did notice a drop from Arduino output to 2N2222 base. I can test the voltage from the car battery tomorrow though. Thanks. \$\endgroup\$
    – HiWay
    May 7, 2015 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.