3
\$\begingroup\$

I have got the following circuit diagram.

circuit1

For a little explanation. When the button is pressed the µC is powered for about 10 sec. The µC contains code that moves the servo. When the servo is connected it takes so much power that the µC resets all the time. How can I change the circuit that this does not happen?

It is powered by a 9 volt block.

Now I changed the power supply for the servo with an other 7805 like this circuit diagram:

circuit2

Now the µC resets a bit later.

\$\endgroup\$
  • \$\begingroup\$ Does your controller still reset if you bypass all of the 555 timer nuisance, and connect the input of 7805 directly to +9V ? \$\endgroup\$ – Nick Alexeev Dec 25 '13 at 23:31
  • \$\begingroup\$ Have not tried this. I will do but it will take some time to change the circuit. \$\endgroup\$ – kimliv Dec 25 '13 at 23:36
  • \$\begingroup\$ Find out what the stall current (max current) of your motor is. This information may be in the datasheet for the servo. \$\endgroup\$ – Nick Alexeev Dec 26 '13 at 0:54
  • \$\begingroup\$ How much current does the servo draw? And is it well below the 555's maximum of 200mA? \$\endgroup\$ – jippie Dec 26 '13 at 10:28
  • \$\begingroup\$ @jippie the data sheet of the servo does not contain the maximum current, it is a cheap one. but the 555 and the ATMEGA328P-PU still work. \$\endgroup\$ – kimliv Dec 26 '13 at 15:19
4
\$\begingroup\$

The AVR is powered from a 7805 regulator which takes input from the 555 timer (that has a limited output current capability). Because of that the regulator is not able to supply much current and when the servo tries to rotate and pull current the voltage drops and the mcu resets.

To solve the problem you should feed the servo from a separate regulator that takes input from the 9v supply (assuming the servo can't be powered directly with 9v).


Adding to what Nick Alexeev says, why do you need the 555?
You can use the AVR only, put it in sleep mode and set it to wake up with an external interrupt (INT0) from a button press, work for 10 sec and then sleep again.

\$\endgroup\$
  • \$\begingroup\$ Thanks, but if I connect an other 7805 regulator to the battery and the servo it will consume power all the time. I am right? \$\endgroup\$ – kimliv Dec 25 '13 at 23:40
  • \$\begingroup\$ @kimliv I guess it depends on your motor (do you have a datasheet?) but if this is the case then you can use a switching device like a Mosfet or transistor to power the servo only when the 555 output is active. \$\endgroup\$ – alexan_e Dec 25 '13 at 23:44
  • \$\begingroup\$ I will try out to supply the servo by an other 7805 to see if it will work, but I need to buy a second one first. \$\endgroup\$ – kimliv Dec 25 '13 at 23:46
  • 2
    \$\begingroup\$ @kimliv By the way, I don't know if the problem you had was waking up the mcu but if so another alternative is to use a reset button, have the AVR run for 10sec and then put it to permanent sleep (with no wakeup option) until the next reset that will execute the code again for 10 seconds. \$\endgroup\$ – alexan_e Dec 26 '13 at 0:52
  • 1
    \$\begingroup\$ @kimliv you need to find the servo's idle or quiescent current, how much power it pulls when it is not moving. It should be in the low mA to microamps, fairly negligible. Also \$\endgroup\$ – Passerby Dec 26 '13 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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