Recently I was trying to drive two motors with atmega328 and L293D motor driver IC. The power supply section is shown below

enter image description here

I used a 12V battery with high current driving capability.The motor was not connected but even the led blink doesn't work. I verified the circuit for hours. Then I connected a 9V battery with LOW current driving capability as input. This time everything was working properly. Finally I used a 100uF capacitor at the input with my 12V battery and it works! enter image description here

[note:The motor was disconnected all the time. I checked the output with an LED]

Can anyone explain what happened. How does it work with that 9V battery?


1 Answer 1


Look at the data sheet for the 7805 and you'll find it needs a 0.1uF capacitor and a 0.33uF capacitor (or larger). Both caps should be non-electrolytic (for best performance) but, adding an electrolytic in parallel with the caps I've said won't be a big deal.

If this now works on both batteries then it's a fair assumption that the wiring to the 12V battery may be too long or the ability of the 12V battery to act as a decent capacitor was impaired.


  • \$\begingroup\$ He is asking for an explanation of why it worked with one battery and not the other one. A suggestion to add (the needed) capacitors doesn't reply to what he asks. \$\endgroup\$
    – alexan_e
    Mar 3, 2014 at 21:35
  • \$\begingroup\$ @alexan_e you are so right \$\endgroup\$
    – Andy aka
    Mar 3, 2014 at 21:37
  • 1
    \$\begingroup\$ Nevertheless Andy's answer is probably correct, just needing explanation why. Voltage regulators are high power high gain amplifiers, and with the right impedances on input or output they oscillate, occasionally making good radio transmitters! Something about the high current battery (low R, some wiring inductance and inadequate decoupling cap) may have allowed oscillation; the resistance of the 9V battery prevented it. And the AVR works better on a steady DC supply than an RF waveform. Use an oscilloscope to test if this is true... \$\endgroup\$
    – user16324
    Mar 3, 2014 at 22:21

Your Answer

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

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