go away spammer

Author Topic: Using a capacitor to smooth out a power supply  (Read 4967 times)

0 Members and 1 Guest are viewing this topic.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Using a capacitor to smooth out a power supply
« on: January 07, 2013, 10:53:55 AM »
I am playing around with some ultrasonic sensors, and I am planning on using the analog output to read the values.

I am reading a book that mentions when using these, it is recommended to place a 100uF capacitor between teh +5v and the GND of the sensor in order to smooth out the power supply and get more accurate readings.

I am kind of shocked by this, as I would have expected a .1uF capacitor to do this job, not a 100uF capacitor.

Can anyone tell me why you would need to use a cap with such high capacitance in this application, when to smooth out an ATMega micro-controller, most only use a .1uF capacitor?

Thanks!

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Using a capacitor to smooth out a power supply
« Reply #1 on: January 07, 2013, 11:21:24 AM »
Maybe the sensor has really spiky power draw, when generating the ultrasonic pulse.
Maybe they are assuming that you use long leads to connect the sensor.
Maybe they are just being conservative.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Using a capacitor to smooth out a power supply
« Reply #2 on: January 07, 2013, 11:57:02 AM »
When was this book published? What sonar, specifically, was it referring to?

The older sonar you could buy ~5 years ago, as a hobbyist, was a bit noisy. The sonar sold today are (should?) already have proper cleaning caps installed.

You can easily determine if you need additional caps by using an oscope between power and ground while running the sonar, and looking for spikes, etc.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Using a capacitor to smooth out a power supply
« Reply #3 on: January 07, 2013, 01:24:07 PM »
jwatte and Admin,

Thanks for your replies.

The ultrasonic sensor is this one:

https://www.sparkfun.com/products/639

An ultrasonic rangefinder from Maxbotix.

It draws 2mA.

I read the data sheet and it does not mention the need for any caps at all.

The book was published in 2011, so it's pretty new.

The book recommends, and I would do anyway, using regulated 5V as the + source.


This issue raised a questions to me, which I probably should have been more specific about.

Reading the basic electronics tutorial on the main SoR site, mentions if your cap is too large, it will take a long time to charge the capacitor when starting up. I suppose at 100uF that is probably not too big of an issue, I just read that very literally, that you want to make sure the cap is not too big.

The question is, other than the time to load, are there any other downsides to using too big of a cap?

Regarding the oscope, I will definitely do that. My wife actually bought me a pocket oscilliscope for Christmas, and I have not yet used it, this will be a good reason to use it.

Another question that comes up is, do I need to put this on a board with all other sensors, motors, etc. that will be on my actual bot, so that I can test it in a real life situation, or can this be isolated for testing for the need for a cap here?

I am kind of embarrassed, but I really don't know how to use an oscope, or the one she bought me in particular, came with no instructions. I am going to have to do some learning and digging.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Using a capacitor to smooth out a power supply
« Reply #4 on: January 07, 2013, 08:28:26 PM »
Quote
are there any other downsides to using too big of a cap?

Cost and bulk are pretty big ones :-) Also, larger capacitors may be less reliable because of optimizing for cost or bulk. And a larger capacitor has more electrolyte to spill over your project when it ruptures ;-)
Also, inrush current may become bigger, which may be a problem (that's the turn-on spike you're talking about.)

You can easily solve the capacitor inrush current and time-to-voltage function by finding the ESR of the capacitor, and solving the 1/(2 pi RC) filtering differential equation.

Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: Using a capacitor to smooth out a power supply
« Reply #5 on: January 09, 2013, 05:20:46 PM »
Quote
are there any other downsides to using too big of a cap?

Cost and bulk are pretty big ones :-)

The small ceramic caps have very low resistance compared to larger (non-ceramic) caps. The small caps are good for providing current needed for switching bits in digital circuits. A large electrolitic cap will perform poorly compared to a 0.01 or 0.1 uF caps for this purpose.

BTW: they might have meant 100nF, which is same as 0.1uF.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Using a capacitor to smooth out a power supply
« Reply #6 on: January 09, 2013, 08:01:12 PM »
Billy,

Thanks for your answer.

That makes sense.

I am pretty sure it was a 100uF becuase they show a picture, and it is a decent sized electrolytic.

I think I am going to use a ceramic .1uF for this, just like I between AREF and GND on an ATmega chip.


Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: Using a capacitor to smooth out a power supply
« Reply #7 on: January 10, 2013, 02:58:39 PM »
I think I am going to use a ceramic .1uF for this

You can use both 100uf and 0.1uf if you want. That will cover what I think they meant, plus what they are actually saying. (low frequency and high frequency noise).

BTW: some regulators are sensitive to excessive capacitance on the outputs and will oscillate with a too-big cap. Something to be aware of if you ever find yourself with a DC voltage rail that is ringing. I've never actually seen it happen, but many of the datasheets warn of it.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Using a capacitor to smooth out a power supply
« Reply #8 on: January 12, 2013, 06:01:11 PM »
Quote
I am kind of embarrassed, but I really don't know how to use an oscope, or the one she bought me in particular, came with no instructions. I am going to have to do some learning and digging.
youtube has tutorial videos for all that stuff now . . .

An oscope is basically a multi-meter, but it draws pretty graphs instead of a boring single number. The graph changes over time, letting you see how a voltage changes over time - such as with a capacitor. If you connect power to power and ground to ground, and turn the oscope on, it should 'just work' if it's a digital oscope. You may have to rotate a knob or two to shift the graph just right.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Using a capacitor to smooth out a power supply
« Reply #9 on: January 13, 2013, 08:51:28 AM »
Tommy, thanks for the info.

Admin, thanks, yeah, I was able to find a ton of info on oscopes on YouTube, unfortunately, the one my wife got me is not great at all, and does a lot of really weird things, she meant well but I think I need a better one.

I hooked up mine to some basic circuits I built on a prototype board using various cps and resistors, and at the same time made the same connections to my multimeter. The oscope was really unstable, and would often just stop reading altogether.

I will say that I never really understood the value of an oscope before, but now I do.

I am going to invest in a reliable one, they really can give you so much insight to what is going on, thanks for the recommendation.

Now I just have to figure out what to buy.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Using a capacitor to smooth out a power supply
« Reply #10 on: January 13, 2013, 03:04:10 PM »
O'scopes are better for signals that vary in voltage whereas the DVM is better for DC signals (constant voltage).
Keep playing with your scope. Try looking at clock signals, audio signals and digital signals.
The easiest signals to see are the ones that repeat with a regular period.
Some times it gets a little tricky to get the scope to correctly trigger on what you want to see. This gets easier with experience.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Using a capacitor to smooth out a power supply
« Reply #11 on: January 14, 2013, 07:21:26 AM »
Waltr, thanks.

I actually setup a circuit specifically to try to see some movement.

I setup a simple circuit using a PUT, a capacitor and a mini speaker to generate some oscillation.

When I first hooked up my pocket digital oscope, I was seeing some movement, but the problem was I needed to adjust the voltage and the time on the oscope.

Once I made the adjustments, I could not see anything at all.

Every once in a while, it would start reading again for a tiny blip, but I could not get anything realistic.

At the same time, I saw my multimeter handling it properly, I would see the voltage raise until the PUT hit its threshold, and then drop once the cap discharged to the speaker, but could not get any real wave forms on my digital oscope.

I suspect its a problem with the scope itself, but there is almost no documentation out there for this thing.

I will keep playing around with it though. I have a few days to return it, so if I cannot get this thing working I will return it and invest in a better one.

Thanks again.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Using a capacitor to smooth out a power supply
« Reply #12 on: January 15, 2013, 09:50:34 PM »
What is a "PUT"?

If the DVM was seeing a rising voltage then this is typically too slow for an O'scope to easily see.

Try a 555 timer chip wired as a multi-vibrator running at about 1kHz to 10kHz. This will show up on the scope as a square wave when the scope's time base is about 2usec per division. Set the scopes vertical to about 1/10th of the voltage powering the 555.

Offline ErikYTopic starter

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Using a capacitor to smooth out a power supply
« Reply #13 on: January 16, 2013, 04:40:29 AM »
What is a "PUT"?

If the DVM was seeing a rising voltage then this is typically too slow for an O'scope to easily see.

Try a 555 timer chip wired as a multi-vibrator running at about 1kHz to 10kHz. This will show up on the scope as a square wave when the scope's time base is about 2usec per division. Set the scopes vertical to about 1/10th of the voltage powering the 555.

Programable Unijunction Transistor, I was using this to allow the cap to build up to a threshold before discharging to the speaker.

Whats interesting is when I first connect the oscope to this circuit, and I had the scope on the +/- of the cap, I was able to see the voltage line bounce, when it discharged.

Then, when I changed the settings for the time, and the Volts for the channel I was using, the scope just stopped working completely, it showed a flat line with zero motion.

Perhaps I had it on a setting it did not like.

That is a good idea on the 555, I will definitely try that out and see if I can get some readings, and I will change out some resistors and caps to see if I can pick up different waves.

Thanks!

 


Get Your Ad Here