• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

strange circuit behaviour when using wall wart instead of battery

Thread starter #1
I can't seem to figure out why my microcontroller circuit works perfectly over a set of batteries but not through a wall wart.

When the circuit starts, the LEDs are supposed to be off and data is supposed to be sent to the PC. When I power the circuit with batteries, then it works. However, when using the wall wart, the LED steadily glows and no data is sent to the PC. It's as if the microcontrollers were stuck in a reset state?

I recently measured the battery voltage and the meter showed about 5.6V. I measured the voltage out of the wall wart, and the meter showed 10.4V, yet the label on the wall wart is "OUTPUT: 6.0VDC 900mA".

I do use a 7805 voltage regulator between the power supply and the rest of the circuit and I have a 16V/100uF capacitor connected across the power supply while it is used. I also have another 16V/100uF capacitor connected between VCC and GND along with a couple of 47nF capacitors between VCC and GND in other places on the board. The PCB itself measures about 2x4 inches.

The circuit also uses a MAX232 for uart communucations and the capacitors I use for it are 4 1uF's, but I don't know if thats to blame because I tested that before by measuring pins 2 to ground and 6 to ground and it gave me double voltage which is expected.

I'm not sure if my voltage regulator is so awkward that it wants to work at voltages not too close to 5V, but the one I'm using due to availability is LM7805CV. I do have only one of LM2940 and I ordered more online a week ago since they drop less voltage.

So is my voltage regulator the issue, or could it be incorrect capacitors or what? because right now, the rest of the circuit is like frozen when a wall wart is used, but when batteries (not the freshest) are used, the circuit seems to work.
 

ronsimpson

Well-Known Member
Most Helpful Member
#2
If I was there I would use a oscilloscope to look at the voltage on the input of the 7805 regulator.
using wall wart
10.4V, yet the label on the wall wart is "OUTPUT: 6.0VDC 900mA"
There are many different types of wall warts. Clearly you WW is not a "switching power supply".
It might be a transformer and 4 diodes with little to no capacitors. In that case the capacitor on the input side of the 7805 should be more like 1000uF not 100uF. It might be that the voltage gets to 10V on the peaks of the power line but drops to 5V at the "zero".

Is the 7805 running hot? What do you think the current is?
 

MikeMl

Well-Known Member
Most Helpful Member
#4
Could it have something to do with "power-on-reset" on the MCU? The voltage from the wall-wart is likely to start-up much more slowly than hooking it to a battery.
 

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
#5
Tend to agree with Mike. I had the same issue when a SBC (Single Board Computer) was powered from a linear vs switching power supply. I was able to solve it by changing an IC to the schmidt trigger version on the reset line.
 

audioguru

Well-Known Member
Most Helpful Member
#6
Does the LM7805 work? You never said its measured output voltage.
The datasheet for the MAX232 shows +8.5V on pin 2 and -8.5V on pin 6 when it is powered from +5V.
 
Thread starter #7
This is my circuit as laid on a PCB. Mot of the time the VCC (5V) is next to the ground plane which I believe increases capacitance between the two sets of copper. I have the capacitors arranged so that the input and ground is connected via capacitor and the output and ground is connected via capacitor. both are marked with orange 100 meaning 100uF/16V.

circuit.png
I also provided measurements so you see how close the parts actually are together (example: actual distance between jack and capacitor... 4.5mm) The bottom-left component with a thick white line is the regulator with the back side facing left.

Now the voltages for vcc:

With panasonic carbon-zinc batteries with a total measured voltage of 5.36V: 3.78V
With wall wart adapter (same as one I used when I made the post) with a measured voltage of 10.21V: 4.97V

And in all tests, nothing has heated up at all
 

ronsimpson

Well-Known Member
Most Helpful Member
#8
With panasonic carbon-zinc batteries with a total measured voltage of 5.36V: 3.78V
We can see that the 7805 is not low drop out.
MAX232 wants 4.5 to 5.5 volts to work.
With wall wart adapter (same as one I used when I made the post) with a measured voltage of 10.21V: 4.97V
Looks like the 7805 is working right.

The MAX232 should have a capacitor from VCC to GND, at the IC. That is not your problem here.
What micro?
 
Thread starter #9
But the strange thing is the circuit WORKS when I use batteries but does NOT WORK when I use the wall wart.

The micro is AT89C4051-24PU and I'm using two of them driven by one 22.1184Mhz xtal.

Other than the capacitor suggestion, is there anything else anyone can suggest?

and I used an online calculator to calculate heatsinks for 7805 and it turns out that If I draw less than 1.2A of current when running the circuit in 40 degree weather then I don't need a heatsink. and I can't see me drawing even 1A since the circuitry is all digital.
 

ronsimpson

Well-Known Member
Most Helpful Member
#10
and I used an online calculator to calculate heatsinks for 7805 and it turns out that If I draw less than 1.2A of current when running the circuit in 40 degree weather then I don't need a heatsink. and I can't see me drawing even 1A since the circuitry is all digital.
With wall wart adapter (same as one I used when I made the post) with a measured voltage of 10.21V: 4.97V
About 5 volts from in to out on the 7805 and maybe 1A. 5 X 1= 5 watts. With no heatsink the 7805 will go into over temperature shutdown. That will burn your finger! So if you can touch the 7805 then the current must be more like 200mA.

What is on the reset pin on the micros?
 
Thread starter #11
But isn't it (input - output) * amps? so 6 - 5 = 1 times 1a = 1W?

and for reset, I use 47K resistor with 47nF capacitor so reset wont take forever. I've seen designs with 8K resistor and 10uF capacitor but I don't know why they want such a long delay unless its because of their crystal
 

Pommie

Well-Known Member
Most Helpful Member
#12
The input to the 7805 needs to be at least 7V. Try adding a large capacitor directly to the power in and then measure the input voltage from the wallwart.

Mike.
 
Thread starter #13
I changed the regulator to an LM2940 because its max dropout voltage is 0.5 but I'm still having the same results. and I already have a 100uF to power in
 
Thread starter #15
Ok, new test results:

Measured input from wall wart when connected is 9.17V. Measured input from battery when its connected is 5.3V. voltage to the circuit is about 4.9V in all cases.
 
Thread starter #16
So I guess my only option for this circuit is to throw out the wart and buy a new one? I got it working with another circuit but it didn't have two microcontrollers sharing the same crystal. I'm gonna look at my reset circuit some more to see if I can improve on it
 
Thread starter #18
ok but wouldnt the regulator correct that? I mean I get normal voltage at output when testing. Or is it that something different happens at the start in voltage when using a wart vs battery with a regulator?
 

Pommie

Well-Known Member
Most Helpful Member
#19
The regulator cannot increase the voltage. Think of a rectified sign wave - it goes to zero volts 100 times every second. Can your circuit handle that?

Mike.
 

Latest threads

EE World Online Articles

Loading

 
Top