element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Capacitor to smooth out Raspberry Pi power dips?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 48 replies
  • Answers 30 answers
  • Subscribers 671 subscribers
  • Views 16127 views
  • Users 0 members are here
  • usb power
  • power supply
  • raspberry_pi
  • pi3
  • raspberry pi
  • usb cable
Related

Capacitor to smooth out Raspberry Pi power dips?

ntewinkel
ntewinkel over 8 years ago

I recently was trying to do a few things with a Pi3, and it consistently hung when I tried to update the system (sudo apt-get update/upgrade). It did everything else well enough, so I wonder if that's power related, with the upgrade making the WiFi work extra hard - maybe not, but I thought I'd look into it.

 

I've also noticed that my older Pi1 will hang once in a while (every few months), and that's a bit of an issue now that I'm using it as my sprinkler controller - reliability has become much more important.

 

While searching for help online, I noticed Robert Peter Oakes did some research and made a nice blog entry explaining the role the USB cables have in the power issues. (Thanks Peter!)

 

In a nutshell, some cables cause a voltage drop that puts the supply too far below the ideal 5v voltage level for the Pi.

The problem is that once in a while the Pi draws enough power to make the voltage dip into the danger zone.

(Some places sell adapters with a higher voltage to compensate. AdaFruit, for example sells a 5.25v adapter for the RPi, and notes that 5.25v is still within the specifications for USB, so even with a perfect no-loss USB cable that should be safe.)

 

One notable item, to me, was that the Pi has some serious power dips on a regular basis, regardless of the cables - just that the better supplies+cables start with higher levels at the Pi and the dips don't take it down too far.

 

So here's my thought - capacitors are supposed to help against dips and spikes, right?

 

Is there a way to add some really big capacitor at the Pi side to help avoid such dips (and maybe spikes too) ?

 

I'm thinking VIN-GND with a 1,000+ uF cap? I have one rated 1,000 at 10v, also I see 1,800 at 16v, both should handle 5v-ish well.

 

Otherwise, maybe splice a USB cable to add the large cap near the micro-USB plug end?

 

Will that cause trouble? Will it help at all?

 

Thanks!

-Nico

  • Sign in to reply
  • Cancel
Parents
  • niteowl12
    0 niteowl12 over 8 years ago

    Wouldn't it be easier to use an O'Scope to measure the input voltage during the "hang" to make sure that voltage drop is the actual problem? This would be my first step because I would think it highly unlikely that an update would use enough extra current to drop the voltage enough to cause a micro to stop functioning.

     

    Is the Pi controlling the sprinkler system through logic control or is it actually providing the power to a valve?

     

     

     

    10uf Cap

    image

    image

     

    1000uf Cap

    image

     

     

    image

     

    Notice the drop in voltage is about the same with a 2A jump in current. R1 in the schematic represents the incoming wire resistance to the Pi. If all the power to the Pi and sprinkler run through that one wire then I would focus on fixing that. Use two separate wires or one large one. That resistance will be the primary driver for voltage drop.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to niteowl12

    >Wouldn't it be easier to use an O'Scope

    Sadly I don't have one, but I do have a TI tester that can graph voltage, that may do the trick (not sure if it's fast enough).

     

    >Is the Pi controlling the sprinkler system through logic control or is it actually providing the power to a valve?

    The sprinkler Pi is my old Pi1, and it's mostly stable - it hangs every few months randomly, before sprinkling season had started (ie, just sitting there idling, with the sprinkler software on but not powering the valves). I just ran a full sprinkling round (3 hours) last night and the veggie gardens this morning, and it's still running properly.

    It uses the same methods as OpenSprinkler.com - the Pi provides logic to shift registers, which turn on Triacs that pass the 24VAC power to the valves.

     

    The issue of hanging was during update of a Pi3 that I was just trying to set up for a different project.

     

    Thanks for running those tests and the resulting graphs! From what I see, it looks like a capacitor wouldn't really make any difference - is that correct?

     

    And the conclusion being pretty much what everyone else was saying - upgrade the power supply.

     

    When I have a chance, I'll try that Pi3 update again while gathering some numbers, maybe through a wired Internet connection too as one of the tests.

     

    Thanks,

    -Nico

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 8 years ago in reply to ntewinkel

    Hi Nico!

     

    I'm still not sure it is a supply issue since the power consumption shouldn't increase during an update/upgrade significantly, but if all you have is a 1000uF capacitor and no oscilloscope I don't think there is anything wrong with just trying it, if you suspect that a combination of your PSU and the USB cable are making things just marginal. It all depends on how marginal, and for how long you're getting high current spikes (if that is what is occurring, because it is speculation, but sometimes we have to speculate).

    If the spikes were short and infrequent (e.g. 1msec spikes) and the current demand was around 1A (I don't think the Pi ever consumes 2A unless you've got extra hardware attached; and 1.4A, i.e. around 7W, takes all cores to be performing a workload), and if the supply voltage can drop from 5V by a volt and still continue operation on the Pi 3, then a 1000uF capacitor may well help.

    Maybe an interesting project would be a low-voltage detector LED  that lights up for a second even on short drops in voltage : ) There are ICs that will approximately do this (ICs for handling brownouts).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to shabaz

    >I'm still not sure it is a supply issue...

     

    I'm starting to suspect that maybe I have a bad image or a difficult SD card for the Pi3.

     

    I might try a different image and/or SD card, coupled with the happiest power supply + USB cable I can find image

     

    I do want to try and see if I can get some voltage graphs too.

     

    Thanks,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • niteowl12
    0 niteowl12 over 8 years ago in reply to ntewinkel

    Yes, the capacitance on the input to the Pi would probably not fix the issue you are having. Upgrading the power supply and the USB cable would help greatly but the post you mentioned also included wire gauge and current ratings. A typical USB port can only supply 1.5A anyway. 

     

    From some of the things you've said I wonder if there is a memory leak in some of the software its running. Maybe try monitoring memory usage during runtime and record the numbers over time? I have done some scripting in my early days that crashed an i7.   

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to niteowl12

    >I wonder if there is a memory leak

    The Pi1 sprinkler hang could indeed be a software issue. During the sprinkling season I'll probably remote-desktop into it once in a while to give it a good old fashioned reboot.

     

    The Pi3 is a different story, as it's a blank install of Raspbian (Pixel), latest version direct from RaspberryPi.org

    For that I think I just need to take some more time to test and measure, maybe also trying an older image.

     

    Thanks,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 8 years ago in reply to ntewinkel

    The Pi3 is a different story, as it's a blank install of Raspbian (Pixel), latest version direct from RaspberryPi.org

    I'd try a new card.

     

    We had a similar situation with a dashcamera the other week.

    Card had been recording during the trip down, but stopped recording although the camera thought it was quite happy.

    Card could be written to in a computer, but wouldn't record using the camera, even after deleting the files that were on it.

     

    There is a fair amount of reading and writing going on during an update, so to be hanging during this suggests the card.

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to mcb1

    Well here's something interesting...

     

    I tried your suggestion of using a different SD card, but this time I decided to do the update/upgrade via the GUI while connected to the TV.

     

    Turns out the Pi3 isn't hanging as I had previously thought! - it's dropping the WiFi connection during the upgrade. With the TV and GUI I can reconnect the WiFi, but previously I was doing it via remote-desktop and so of course that would look like a hang from that perspective (and it was as good as a hang as I couldn't get to it at that point).

     

    So I think the card I was using might be alright after all (I'll try it again at another time).

     

    And the whole time the Pi3 is running, the GUI is showing that lightning bolt complaining about power issues. grrrr... So I suspect the dropped WiFi may be related to power issues after all... dunno.

     

    I'm using an iPad 2 charger at 5.1 volts and 2.2 Amps, so you'd think that would be plenty. I used what I thought was my "best" USB cable too. I might try a few other combinations to get an idea of what works best.

     

    Oh, and I remembered my less-than-accurate way of testing the USB cables - I just plugged them into my phone charger on one end and into my phone on the other end, and picked the "better" cables being the ones where the phone showed lower "minutes until fully charged". There was a difference of about 30 minutes between them.

    So I ordered a couple of micro-usb port breakout modules off eBay to allow more accurate testing in the future - plus those will be handy for powering breadboards too.

     

    Thanks again for all the advice (that goes to everyone else too!), I very much appreciate it.

     

    For now, I'll just wait for the new power supplies to arrive image

    In the meantime, I'll try to keep the Pi3 WiFi usage to a dull roar instead.

     

    Thanks,

    -Nico

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to ntewinkel

    Oh and one other thing that may be suspect, that I keep forgetting about...

     

    I'm using a little wireless keyboard - a small dongle plugs into the usb port. I think it's bluetooth.

     

    However, when I was using remote desktop that was not connected (and the USB dongle was not in it).

     

    edit: it still gives that lightning bolt without the wireless keyboard USB dongle connected.

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 8 years ago in reply to ntewinkel

    ntewinkel

    The Ipad chargers are rated at that, but they need to sense the device at the end in order to deliver it.

     

    There was an article in Silicon Chip regarding the voltage required on the data pins, in order to force them into giving the required amount.

     

    Tablet chargers are also a hidden mystery as my daughter found out in Japan when she took a normal charger.

    It seems that many detect the hardware and will bump the voltage to 15v out the USB socket to facilitate charging the tablet.

    The rest of the time they are a plain looking 5v USB socket supply.

     

     

    Nice to see there is some progress and yes the devices hanging off the USB can sometimes be the problem.

     

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • rew
    0 rew over 8 years ago in reply to mcb1

    I built an USB-cable testing setup once. And I ran a bunch of my cables through the tester. The resistance of the cables came out between less than 200mOhm to more than 4.5 ohm!

     

    The best was 22CM Magnet Flat Short 5Pin Micro USB Data Charger Cable Cord For Samsung HTC XC | eBay  in the ugly pink...

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • rew
    0 rew over 8 years ago in reply to mcb1

    I built an USB-cable testing setup once. And I ran a bunch of my cables through the tester. The resistance of the cables came out between less than 200mOhm to more than 4.5 ohm!

     

    The best was 22CM Magnet Flat Short 5Pin Micro USB Data Charger Cable Cord For Samsung HTC XC | eBay  in the ugly pink...

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • mcb1
    0 mcb1 over 8 years ago in reply to rew

    I have no doubt some cables are worse than other.

    I've seen the insides and the solder joints......

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • gdstew
    0 gdstew over 8 years ago in reply to mcb1

    It's more a matter of the wire gauge used for the power pins than anything else. Cheap USB cables will use 28 AWG (gauge) wire for all connections, better ones will use two different

    gauges, one for power and another for the data signals. Most (but not all) of the USB cables I have bought have the wire gauges printed on them and when they do the lower number

    (lower gauge equals larger wire) will be the one used for power.  When trying to run 1.5 amp or more through the USB cable you need to have at least 22 AWG for power. The

    biggest problem I have with that is that when looking to buy USB cables over the net they very rarely list the wire gauge(s) used so either a lot of searching or buying local are about

    the only ways to find good cables. Note that cable length can also be a problem so I try to use 1.8m (6 ft.) or shorter cables for power.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 8 years ago in reply to gdstew

    >when looking to buy USB cables over the net they very rarely list the wire gauge(s)...

     

    Totally! After reading Peter's Robert Peter Oakes blog post, I started looking for cables with thicker wires, but exactly like you noticed - they rarely show wire gauges, and the times I did see gauges listed, they were not stand-out sizes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • gdstew
    0 gdstew over 8 years ago in reply to ntewinkel

    I have upon occasion found USB cables on Ebay with the wire gauges listed, however I am always wary about the accuracy of listings on Ebay. I also came

    across a set of 3 - 6" and 3 - 3' micro-USB connector to type A USB connector cables some from a company called Sabrent on sale at Newegg that specifically

    mentioned that they used 22 AWG wires. That particular set is apparently no longer available at Newegg however on a quick Google search for Sabrent USB

    cables it also shows up at Amazon, Fry's, and Walmart with single cable and cable sets using 22 AWG wire. One disadvantage of the thicker wire is the cables

    are less flexible and I think the Sabrent cables use 22 AWG on all four wires because they are very stiff.

     

    Another thing I've found useful are the inexpensive USB volt/amp display meters at Ali Express. Some have both micro-USB and regular USB type A inputs

    and they are accurate enough for most uses. Some even come with switchable 1 and 2 amp resistor loads that plug into the meters USB outputs (they do

    GET HOT). They're not particularly useful for catching fast transient type problems but are fast enough to get a reasonably good look during normal use.

    I bought the Sabrent cable set from Newegg specifically to use the 6" ones with one of these meters to test all of the USB output power "wall warts" I bought

    as well as to watch the voltage supply and current usage of several Raspberry Pis and other "Pi like" SBCs with different attached hardware and program

    running loads.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube