Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I've been messing around with a robot kit from Parallax (the BOE Shield Kit), which has a 5xAA (7.2V?) power source. The BOE Shield includes its own 5V regulator, which is used to control servos that in turn spin the wheels of the robot. The regulator is rated for up to 1A of regulated power.

Now for the fun part: I want to also power a Raspberry Pi from this same circuit. I've been able to successfully power the RPi via the Arduino's own 5V output (not through the BOE regulator) and the GPIO pins. The RPi has a single USB peripheral - a wifi adapter. When the servos are not running, or when they're running steadily, there's no problem, and the whole system, including the Pi, chugs along happily. When the RPi isn't doing anything over wifi, turning the servos off and on also has no effect on the Pi's operation.

However, when the RPi is using wifi heavily (I ran 'apt-get update' as a PoC) and I start turning the servos, the Pi resets. I'm assuming it detected an undervolt and rebooted to protect itself.

Would a decoupling capacitor across the RPi's inputs work to overcome these periods of "startup" servo load? Something like this:

CircuitLab Schematic ufmj8z

If so, what type and size of capacitor should I use for this? Does it make a difference how far from the RPi the capacitor is placed (I don't really want to solder one directly to the Pi)?

(Yes, I know, I used a relay symbol to depict the servo in the CircuitLab diagram, but they didn't have a "servo" block. Just imagine it as "thing that draws a lot of current for a very short time".)

share|improve this question
Clarification: The 5V regulator on the BOE powers the servos. It has the 1A limitation. The RPi is pulling directly from the Arduino's 5V pin. That is not attached to the same 1A limit. (I'm not entirely certain if it has a limit, other than the 7.2V power supply's limit.) – Devin R Mar 21 at 17:53

3 Answers

up vote 2 down vote accepted

A bypass capacitor on the input to the RPi might be enough, but it depends on the duration and magnitude of the dips caused by servos.

I would use an oscilloscope to investigate the dips. If they are very short (us) then I would add arbitrary caps (100uF, 1000uF) and re-test.

Another solution would be to try and confine those peak draw pulses by adding a diode from the battery to the Arduino, then connecting the Vin to the 5V regulator to before the diode. This way, transients won't pull from the input caps of Arduino, only from the battery.

share|improve this answer
Thanks Mark, I like both ideas. I will see if I can get my hands on an oscilloscope and test it out. Meanwhile, I'll hook up an ammeter and find out exactly how much the RPi is pulling from the 5V output. If it's up to 1A as Gustavo suggested in his answer, I'll probably need a separate supply for the Pi, or maybe just a separate regulator. – Devin R Mar 21 at 18:55
Just some feedback: Arbitrary caps up to 470 uF (the largest I have) didn't work, so I'm assuming that the dips are longer (or larger) than the capacitors can handle. Based on some other issues I'm having, I'm thinking my batteries aren't capable of pumping out enough current to handle even the servos and a couple sensors on their own. – Devin R Mar 22 at 15:56
@DevinR Could be a nice improvement to switch to using a li-poly or li-ion battery pack, they will have much better peak current outputs. – Mark B Mar 22 at 19:36
I actually just posted a new question related to that: electronics.stackexchange.com/questions/61939/… – Devin R Mar 22 at 19:50

WiFi usually requires around 200mA in RX and TX, but the peaks can reach 1A or more. Adding bypass capacitor might help if these dips are momentary, but if the regulator struggles to provide the required average current, a beefed up regulator might be required.

share|improve this answer
That's good to know about the peak current draw. I was assuming that the draw would be more or less constant, since technically USB isn't supposed to pull more than 500 mA. The RPi v2 doesn't have a fuse limiting current through the USB accessories, so if it is spiking to 1A or more, that could certainly explain the issue. – Devin R Mar 21 at 18:56
The spike usually lasts for a few tens of microseconds. I doubt any fuse could limit it fast enough (you wouldn't want to). – Gustavo Litovsky Mar 21 at 19:30

A decoupling capacitor on the RPi will certainly help. Though you will want to get as close as possible to the supply pins. Use an electrolytic and try and find one with the lowest ESR possible.

Analog Devices has some good recommendations:

  • A large electrolytic capacitor (typically 10 µF – 100 µF) no more than 2 in. away from the chip.
    • The purpose of this capacitor is to be a reservoir of charge to supply the instantaneous charge requirements of the circuits locally so the charge need not come through the inductance of the power trace.
  • All decoupling capacitors should connect to a large area low impedance ground plane through a via or short trace to minimize inductance.

Adding a bulk storage cap to the servo would also be a good idea. Again look for low ESR and a value in the thousands of μF.

share|improve this answer
I understand the document to say that I'd want two bypass caps: a larger one that can be a couple inches away that will take care of larger transients and a smaller one that should ideally be physically touching the pins to filter out higher-frequency noise. Am I reading that properly? – Devin R Mar 21 at 19:18
@DevinR Yes you want that but those are already on the RPi board so you don't need to add them. See all the 220nF on the VDD_CORE line and the 100nF on the VDD_BAT line on the schematic? There's also already a single 10µF on VDD_BAT. Adding more capacitance in parallel will allow it to absorb bigger glitches. – embedded.kyle Mar 21 at 19:26
Gotcha, thanks for clearing it up! – Devin R Mar 21 at 19:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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