7805 Voltage Regulator Output Voltage Increasing as Load Increases

Explanation of Project
I have been working on a project to create a scaled down version of the Bellagio Fountains in Las Vegas. I'm wishing to drive four different PWM signals; red, green, blue, and motor. I have made one fountain in the past and it worked flawlessly, however I'm wishing to increase the number of fountains from one to ten. My plan is to integrate a PCB into each fountain, thus driving each fountain locally. I will be using an Arduino Nano to drive the PWM signals and a MAX 485 Communication board to communicate between the fountains. There are two major differences between the first fountain I built and the fountains I'm currently working on, they are...

  1. The first fountain used an Arduino Mega rather than an Arduino Nano
  2. The first fountain used USB to power the Arduino and the new fountain is attempting to use a 12V power supply.
    I believe the problem is occurring from my attempts at powering the Arduino using a 12V power supply.
    Explanation of Problem
    I began testing the board by hooking up the 7805 voltage regulator. After verifying that it indeed was outputting 5V I loaded up the blink sketch to the Nano and tested it with the Nano running off the 7805 and it worked. Next I wrote a program that would slowly fade the LEDs and pump from low to high to low again. I then tested the Arduino using the circuit found in the schematic I've attached. After just starting to ramp the LEDs went full bright then two of the colors shut-off completely and pump switched to full on. Thinking that this odd behavior was just a result of faulty code I used an integrated RGB LED circuit to test that the code was working as I expected it to. The code was working properly, so I moved forward. I tried the LEDs and pump again, but this I read out the output voltage of the regulator using a multi-meter (Wished I had an oscilloscope but I don't). As the LEDs and pump were ramping the voltage output of the regulator was ramping to, it ramped from 5.0V to 6V and when it reached 6V the LEDs would flash and the program would reset. I tried driving just the LEDs and the voltage only ramped from 5V to 5.1V, but all of the LEDs were flickering. I tried driving just the pump and the voltage ramped from 5V to 6V and caused the Arduino to reset(I assume, let me know if I'm wrong). After reading a lot more about voltage regulators I tried adding a cap of 1000uF between the input and the ground(I realize this isn't close to the value recommended in the datasheet, but I read the bigger the better and it happened to be the only cap I had that could handle 12V). This helped a little bit so I added another cap of the same values, which helped a bit more. Finally I added all 9 of the caps that I had and I managed to get the LEDs and pump to complete the ramp...mostly. As they reached the top of the ramp the blue LEDs would shut-off and the voltage coming out of the regulator would reach 5.8~5.9V.
    The Big Questions
  3. Why is the voltage out of the regulator ramping?
  4. How do I go about preventing this behavior?
    Bonus Questions
  5. I plan on altering the schematic in the future and would like to know how to calculate the value for the decoupling output capacitor(Labeled CO in the datasheet).
    Datasheets and Part Numbers of Components
  6. Linear Voltage Regulator -SCD7805BTG
  7. DC Power Supply - LRS-350-12 Meanwell Switching Power Supply
  8. Capacitor - 1000uf Electrolytic Capacitor
  9. Red Led - 2V-2.2V 20mA
  10. Green Led - 3V-3.2V 20mA
  11. Blue Led - 3V-3.2V 20mA
    (Note - Leds are wired with 4 LEDs in series and 6 sets in parallel. Thus the LEDs draw ~4.5 watts )

Thanks in advance, any help is appreciated.
(I tried to include all of the information that I thought was relevant, however if there is any other information that would be helpful in solving my problem please request it.)

dancingfountain.pdf (16.6 KB)

And the values of your LED current limiting resistors are what?

Paul

but I read the bigger the better

Not a bad rule-of-thumb but the type of capacitor matters and at high frequencies electrolytic capacitors don't "act like" capacitors. And when regulators or other ICs go unstable they tend to oscillate at high frequencies.

So, use one of the capacitor types recommended in the manufacturer's datasheet.

Paul_KD7HB:
And the values of your LED current limiting resistors are what?

The attached .pdf shows 33/100ohm resistors between the emitter/ground of the (unspecified) drive transistors.

Not the normal way of doing this.
Should use six resistors in the collector line (one for each string), and calculate for <=20mA.
330 ohm base resistor is ok.

Caps should be close to the 7805.
There should already be large value buffer caps inside that supply, so large external values are likely not needed.
Leo..

As others have noted, you have connected the transistors all wrong. I suspect that this is a big part of the problem you are seeing.

The ballast resistor for the LEDs goes between the load and the transistor, not between the transistor and ground. Consider what happens as the load current increases.... the voltage on the emitter will get higher. Meaning the voltage difference between the voltage driving the base and the collector will decrease. If the emitter gets to 5v minus the drop from base to emitter, the transistor will turn off. The LED will thus flicker.

Another very serious issue is that you have no resistor between the base of the transistors and the arduino driving them. Were it not for the current limiting from the resistor on the emitter, you would be burning out both the transistors and the arduino. In practice, this guarantees that you will be at or very close to the situation described above.

I'm not sure how this could explain the voltage drifting up though. The thing that stands out here to me is that you say the voltage coming out of the regulator changes DEPENDING ON THE LOAD ON THE 12V SUPPLY not the load on the output of the regulator.

Now how could this be?

How about this: Poor routing of ground on the power supply and insufficient trace width (if it's currently one a PCB) or wire gauge (if it's hand wired) lead to a voltage drop across these connections from the ground return of the 12v loads. Further, the point at which ground is connected the regulator close to where it is connected to the loads - so it is also rising - but the ground that you are measuring from (and possibly where the ground is attached to the arduino) is closer to where the power comes onto the board. So as the ground that the regulator sees is drifting upwards, it's output remains 5v relative to "ground" there, but relative to the actual ground, it is rising.

The other possibility is that the 5v output of the regulator is not a constant voltage, but is oscillating. You don't know because you just have a multimeter, and depending on the model of multimeter and the specifics of the oscillating signal you're measuring, it can read anything between the minimum and maximum voltage.

You have not mentioned a cap on the input of the regulator (how long are the wires from the power supply? Unless the answer is "very short" or you have an additional cap there that you didn't mention, this is a problem).

What about the cap on the output of the regulator? You mention that a 1000uF cap is present, but you don't mention where and your schematic does not show one. You need a cap on the output of the 5v regulator, otherwise you don't have a regulator, you have an oscillator. And load conditions would change this behavior; because of how the transistors are miswired, the load is probably larger than one might expect, which would explain why this behavior is only a problem when the LEDs are on.

Thank you to everyone for your suggestions. I've taught myself everything that I know about electronics(its not a whole lot) and I didn't put in all of the thought that I should have when I put the current limiting resistors after the transistors. The entire reason I added the 7805 was that I thought I needed to be able to supply more current, because the on board regulator kept blowing, however after your explanations I realized that I was drawing way to much current due to my rookie mistake! After reviewing some datasheets and reading up some more on transistors I calculated the current draw from the Arduino to drive the transistors should be around 36 ma for all of the transistors combined (Feel free to let me know if I'm wrong). I had a hard time trying to figure out gate current draw for the MOSFET, but I can't imagine that it is more than the 20ma rating for the Arduino. What I think this boils down to is that I don't really need the regulator if I move the resistors to the collector side of the transistor. I haven't had a chance to test this, but hopefully I'll get around to it next week. Does this sound correct? Much thanks in advance especially if you help me from blowing up 5th Arduino Nano.

Here are the datasheets for the MOSFET and transistors. Sorry I knew I was missing something when I was listing ones in the other post.

MOSFET-IRLB8721
Transistors-2N3904

Hi,
Welcome to the forum.

OPs circuit.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
With all your components connected as it makes signal flow easier to see.

Your circuit does not show the regulator caps.
What is your power supply.

Are you using a PCB?
If so can you post an image of the pattern, top and bottom please.

It is best you post images in png or jpg, as this makes it easier for ipad and iphone type platforms.

Thanks.. Tom.. :slight_smile:

Appart from the curcuit and required components values you really need to measure the current going out of the Vreg when at full load. Then check for power dissipated and thermal stress of the Vreg. 12-5= 7 volts to be turned to heat then 7 * (ammount of amps drawn) will give you the power to be dissipated. You have to check if you need a heatsink. As a rule of thumb the Vreg should not be too hot to keep your fingers on for like 4-5 seconds.

Answers to your guys questions and concerns.

Paul_KD7HB:
And the values of your LED current limiting resistors are what?

I was using a 33omh for the red, and 100 omh for the green and blue

DrAzzy:
Another very serious issue is that you have no resistor between the base of the transistors and the arduino driving them.

Sorry the schematic isn't super clear, but I was using a 330 omh resistor between the base of the transistors and the Arduino.

DrAzzy:
How about this: Poor routing of ground on the power supply and insufficient trace width (if it's currently one a PCB) or wire gauge (if it's hand wired) lead to a voltage drop across these connections from the ground return of the 12v loads.

The project is currently on a PCB. As far as poor routing of ground goes I made the entire bottom of the PCB a ground plane, so I think the trace should be plenty thick.

DrAzzy:
Further, the point at which ground is connected the regulator close to where it is connected to the loads - so it is also rising - but the ground that you are measuring from (and possibly where the ground is attached to the arduino) is closer to where the power comes onto the board. So as the ground that the regulator sees is drifting upwards, it's output remains 5v relative to "ground" there, but relative to the actual ground, it is rising.

Currently the regulator isn't on the PCB, and is being attached via jumper cables plugging into the headers which the Nano would normally sit in (I moved the Arduino to a breadboard for testing). Taking this into account this seems to be a logical explanation.

DrAzzy:
The other possibility is that the 5v output of the regulator is not a constant voltage, but is oscillating. You don't know because you just have a multimeter, and depending on the model of multimeter and the specifics of the oscillating signal you're measuring, it can read anything between the minimum and maximum voltage.

I found someone with an oscilloscope, so I should be able to test this hypothesis I'll just need to set up a time to use it.

DrAzzy:
You have not mentioned a cap on the input of the regulator (how long are the wires from the power supply? Unless the answer is "very short" or you have an additional cap there that you didn't mention, this is a problem).

What about the cap on the output of the regulator? You mention that a 1000uF cap is present, but you don't mention where and your schematic does not show one. You need a cap on the output of the 5v regulator, otherwise you don't have a regulator, you have an oscillator.

See the new schematic I've posted for where the 1000uF cap was located.

In response to the length of the wires from the power supply the answer would be very long (~150 feet the finished product could have wires up to 300 feet or more). How do I go about properly choosing an input cap value and type? As far as the output cap I do not currently have one. How do I go about choosing an appropriate cap size for the output? (The schematic mentions caps less than .1uF will cause stability. Do I just need a cap above .1uF?)

TomGeorge:
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
With all your components connected as it makes signal flow easier to see.

It took me a bit of time, but I have attached a much easier to read schematic.

TomGeorge:
Are you using a PCB?
If so can you post an image of the pattern, top and bottom please.

Yes, I am. I have attached the top and bottom images, however the voltage regulator was not included on the PCB as I just planned to use voltage regulator on the Nano, thus the voltage regulator circuit was tested while plugged into a breadboard.

TomGeorge:
It is best you post images in png or jpg, as this makes it easier for ipad and iphone type platforms.

Thanks, will do in the future.

HellasT:
Appart from the curcuit and required components values you really need to measure the current going out of the Vreg when at full load.

I will do this in the future, but haven't got around to it yet. I'll make sure to post my results.

HellasT:
You have to check if you need a heatsink. As a rule of thumb the Vreg should not be too hot to keep your fingers on for like 4-5 seconds.

I was paying close attention to the heat of the regulator and it stayed at ambient temperature.[Could of kept my finger on it all day;)] Which makes me doubt I'm hitting the thermal limits.

Project Update
I was able to try running the LEDs with the resistor on the collector side of the emitter and it improved the way the LEDs work drastically. While doing this I was powering the Arduino using the VIN pin (Inputting 12V+ from a power supply located ~150 wire feet away). Thinking that I had solved the problem I plugged in the pump and attempted to run it along with the LEDs, however after the Arduino had ramped the PWM value to either 2 or 3 (out 255), the LEDs went dark and the pump stopped. Trying to diagnose the issue I attempted running the pump by itself. It performed the same way, but I let it run through three times and on the third time of only hitting a PWM value of 3 the pump roared all of the way to life. Now when I plug in the Arduino all of the LEDs are on at full brightness and the pump goes at full speed. Also now when I plug in the Arduino it pops up a notification in Windows that says the USB device is not recognized, and as such it doesn't appear in the COMM port list in the Arduino IDE. Mean less to say I don't think it is the LEDs that are giving me any trouble at this point. Does anyone have any ideas as to why the pump would kill the Arduino like this?

P.S. I will post a schematic of this test setup when I have time to put it together in CAD.

DancingFountains:
Project Update
I was able to try running the LEDs with the resistor on the collector side of the emitter and it improved the way the LEDs work drastically. While doing this I was powering the Arduino using the VIN pin (Inputting 12V+ from a power supply located ~150 wire feet away). Thinking that I had solved the problem I plugged in the pump and attempted to run it along with the LEDs, however after the Arduino had ramped the PWM value to either 2 or 3 (out 255), the LEDs went dark and the pump stopped. Trying to diagnose the issue I attempted running the pump by itself. It performed the same way, but I let it run through three times and on the third time of only hitting a PWM value of 3 the pump roared all of the way to life. Now when I plug in the Arduino all of the LEDs are on at full brightness and the pump goes at full speed. Also now when I plug in the Arduino it pops up a notification in Windows that says the USB device is not recognized, and as such it doesn't appear in the COMM port list in the Arduino IDE. Mean less to say I don't think it is the LEDs that are giving me any trouble at this point. Does anyone have any ideas as to why the pump would kill the Arduino like this?

P.S. I will post a schematic of this test setup when I have time to put it together in CAD.

Have you got a DMM?
150feet of wire!!!!!!!
What is the 12V supply at the input to the regulator as your project goes into fault mode?
What is the 5V out or the regulator measuring as the fault occurs?
Do you have the specified capacitors around the regulator that the data sheet shows?
Tom... :slight_smile:

Hi,
Ops pics.




Tom... :slight_smile: