1. 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.
    Dismiss Notice

strange circuit behaviour when using wall wart instead of battery

Discussion in 'General Electronics Chat' started by mik3ca, Dec 28, 2017.

  1. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    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.
     
  2. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    8,032
    Likes:
    1,095
    Location:
    Loveland, CO USA
    If I was there I would use a oscilloscope to look at the voltage on the input of the 7805 regulator.
    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?
     
  3. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,761
    Likes:
    429
    Location:
    Brisbane Australia
    ONLINE
    Can you post a schematic of the power supply, specifically where the capacitors are placed?

    Mike.
     
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,423
    Likes:
    600
    Location:
    AZ 86334
    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.
     
  6. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    10,176
    Likes:
    1,126
    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.
     
  7. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,950
    Likes:
    994
    Location:
    Canada, of course!
    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.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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
     
  10. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    8,032
    Likes:
    1,095
    Location:
    Loveland, CO USA
    We can see that the 7805 is not low drop out.
    MAX232 wants 4.5 to 5.5 volts to work.
    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?
     
  11. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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.
     
  12. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    8,032
    Likes:
    1,095
    Location:
    Loveland, CO USA
    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?
     
  13. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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
     
  14. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,761
    Likes:
    429
    Location:
    Brisbane Australia
    ONLINE
    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.
     
    • Agree Agree x 1
  15. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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
     
  16. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,761
    Likes:
    429
    Location:
    Brisbane Australia
    ONLINE
    If the WW doesn't have a smoothing capacitor then you need 10s of thousands of microfarads not 100.

    Mike
     
  17. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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.
     
  18. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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
     
  19. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,761
    Likes:
    429
    Location:
    Brisbane Australia
    ONLINE
    The average is 9.17V - that could be peak 14V, low 4V.

    Mike.
     
  20. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    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?
     
  21. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,761
    Likes:
    429
    Location:
    Brisbane Australia
    ONLINE
    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.
     
  22. mik3ca

    mik3ca Member

    Joined:
    Jun 24, 2017
    Messages:
    468
    Likes:
    1
    How do you calculate 100x a second? and the 100uF caps for the regulator isn't sufficient then?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice