Thursday 18 May 2017

arduino - Using a capacitor to properly power a servo


I recently attached a servo to my Arduino for the first time. I ended up needing a 470uF capacitor wired like this tutorial shows because my servo was freaking out and causing my laptop to throw "power surge" warnings (I have my Arduino connected to my laptop via USB).


Although I'm glad I got this working, this leaves me with several concerns.



  • Why was a capacitor necessary to "stabilize" my Arduino? In other words, why was it the solution to my Arduino being able to properly power my servo?

  • In that tutorial I linked above, there is a Fritzing diagram of the circuit with the capacitor. Can I assume this is a capacitor wired in parallel with the servo? Why parallel and not series?

  • What's so special about a 470uF capacitor (vs., say, 100uF)? I just used a 470uF because thats what the tutorial said to use, but what math could this number have been based on? In other words, how might I have arrived at this number myself?

  • I've heard capacitors can be extremely dangerous to work with, after all they store power. I'm now afraid to even touch the capacitor on my breadboard! How can I tell if its safe to remove the capacitor (even after I've disconnected the Arduino from its power source)? I have a multimeter but I'm not sure what setting/range I could set it to.




Answer




  • "Why was a capacitor necessary to "stabilize" my Arduino?"


A servo motor draws a substantial current in short peaks. And USB power is not designed to provide such current peaks (and the cable makes it worse), hence the current peaks cause the voltage to vary, which the Arduino is not designed for. A capacitor acts as a buffer for current, so as long as the USB power can deliver the average current, the capacitor will help by smooth out the current peaks.



  • "Why parallel and not series?"


Think of a capacitor as a reservoir. But beware of overinterpreting anlogies, better read a decent electronics beginners book.




  • "What's so special about a 470uF capacitor (vs., say, 100uF)?"


The uF figure is the amount of buffering. Enough is enough, but better be on the safe side (for this use, more is OK). The value of 470 uF is probably based on experience. Just by accident, it is the same value I let my students use :)



  • "I'm now afraid to even touch the capacitor on my breadboard!"


Capacitors can be dangerous if they store either a high voltage or a large amount of energy that can be released in a very short time. In your case neither applies, so don't worry. But you might see a small spark when you short the leads of your capacitor, even after you have removed the USB power. A resistor (for instance 1k) in parallel to the capacitor solves this.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...