Help selecting a capacitor and resistor

Thread Starter

leo.leo.leo

Joined Apr 4, 2017
19
Help finding capacitor and resistor for a circuit diagram

Hi, I'm new here and also pretty new to electronics.

I'm working through the book Electronic Circuits for the Evil Genius 2nd Ed.

I'm stuck on the attached circuit (regulated power supply). I can't find any reference to the value of the capacitor or the resistor.

I'm guessing the cap could be 1000uF. Does that seem correct?

I'm fairly sure the resistor is 470 ohm (because the book always uses one of these in series with a LED).

Apologies if this is a dumb question. I wish I could find an errata for this book. IMG_0378.JPG
 

wayneh

Joined Sep 9, 2010
17,498
There's a lot of wiggle room here and no single right answer. The current-limiting resistor for the LED depends on the LED and how bright you need it to be. To max it out to 20mA, you'd choose ~300Ω. But you can extend the life of the LED and get plenty of brightness for an indicator light at just 5mA, where you'd use a 1,200Ω. Anything in between is also fine.

Likewise the capacitor to choose depends on the load current and what it needs. Some loads might not need any cap there. And personally I'd move it to the input side.

If you take a look at the data sheet for the regulator, it probably recommends a small (0.1µF) ceramic on both the input and output sides, to prevent oscillations. Ditch the book and use a data sheet.
 

ian field

Joined Oct 27, 2012
6,536
There's a lot of wiggle room here and no single right answer. The current-limiting resistor for the LED depends on the LED and how bright you need it to be. To max it out to 20mA, you'd choose ~300Ω. But you can extend the life of the LED and get plenty of brightness for an indicator light at just 5mA, where you'd use a 1,200Ω. Anything in between is also fine.

Likewise the capacitor to choose depends on the load current and what it needs. Some loads might not need any cap there. And personally I'd move it to the input side.

If you take a look at the data sheet for the regulator, it probably recommends a small (0.1µF) ceramic on both the input and output sides, to prevent oscillations. Ditch the book and use a data sheet.
A 470 resistor is probably as low as you want to go with 9V - I'd try 1k first.

The data sheet and application note will give you examples of suitable capacitors - there should be a smoothing capacitor where the rectifier feeds the regulator.

There should be one in the wall-wart, but its worth having one close to the regulator pin.

There are a few pitfalls - some regulator types can burst into song if you make the capacitor ESR too good.
 
Last edited:

spar59

Joined Aug 4, 2007
64
The capacitor shown needs to be 0.1uF as stated by wehneh.

Similarly the resistor can be more than 470R, the efficiency of modern LEDs is much better than they used to be so less current is needed for adequate brightness, less current equals lower running cost and longer LED life.

However one item that is blatently missing is a smoothing / reservoir capacitor between the rectifier diode and the regulator input, typically this would be a 1000uF electrolytic as reservoir capacitor to get rid of ripple with a 0.3uF ceramic (or similar) in parallel with it to reduce its impedance at high frequencies and thus eliminate possible high frequency instability in the regulator.

A typical wall mounted (i.e. plug type) power supply would normally include the smoothing capacitor, though possibly smaller than 1000uF, but it is not shown in the diagram.

Also a voltage regulator such as this needs at least 3 volts or so difference between input and ouput voltage, hence ideally 12V input for 9V output, however many unregulated plug in power supplies give out considerably more than their stated voltage, particularly at low loads and hence a 9V unit may be suitable but check its voltage doesn't drop too low with your intended load or the regulator will be unable to do its job.
 

ian field

Joined Oct 27, 2012
6,536
FWIW, the standard resistor supplied with LEDs for use in 12V systems is 470Ω. Of course this is from the guys selling the LEDs. But anyway, good LEDs can maintain a real 20mA, and 9V batteries are often not really 9V.
The rechargeable 9V PP3 is a fair bit less.

Recent LEDs are more efficient - that circuit is from an old book.

I remember when LEDs were just adequate for indicator lights - now, some of them can hurt your eyes.
 

Thread Starter

leo.leo.leo

Joined Apr 4, 2017
19
Thanks. I really appreciate the answers.

In case it helps, here's the supplied breadboard picture. IMG_0380.JPG

Could the large capacitor be for the smoothing mentioned by spar59 or is it on entirely the wrong side?
 

wayneh

Joined Sep 9, 2010
17,498
A small cap on the regulated side is usually recommended, and close the IC as noted. There's really no reason to have a big cap on the regulated side, since the voltage on that side should be smoothed by the regulator itself and doesn't need additional filtering (certainly not for an LED). It adds the complication that the energy in the cap will drain back through the regulator if the input power is removed from the regulator. Some designs place a reverse-biased diode across the regulator to carry that current safely around the regulator instead. Placing the cap on the input side will store more energy because of the higher voltage (assuming the cap is rated for it) and provide a smoother, filtered input to the regulator. Not that it matters to the regulator.
 

spar59

Joined Aug 4, 2007
64
Just a quick comment on wayneh's post.

"Placing the cap on the input side will store more energy because of the higher voltage (assuming the cap is rated for it) and provide a smoother, filtered input to the regulator. Not that it matters to the regulator."

The regulator will not be damaged by an input that does not include a reservoir / filter capacitor but if there is no capacitor whatsoever the input voltage will drop to zero 100 times per second (full wave rectification) or 50 times per second and stay at zero for half a cycle (half wave rectification). With zero input voltage the regulator can't give any output, never mind a regulated one.

The filter capacitor needs to be large enough so that with the intended output current being drawn, the regulator's input voltage (and I mean as seen in instantaneous terms on an oscilloscope, not the average or RMS as seen on a meter) never drops below the regulator's drop-out voltage which is often around 3V higher (but check the manufacturer's data sheet) than its designed output voltage.
 

Thread Starter

leo.leo.leo

Joined Apr 4, 2017
19
There's really no reason to have a big cap on the regulated side, since the voltage on that side should be smoothed by the regulator itself and doesn't need additional filtering (certainly not for an LED).
I think the intention is that this will be used to supply power for all the remaining breadboard circuits in the book. I was wondering if maybe the 1000 uF cap (if that's what it is) might be useful for some of the circuits.
 

Tonyr1084

Joined Sep 24, 2015
7,899
Once again the peanut gallery has to chime in on something. Here's my thoughts on this: Remove the regulator all together. Just use a little higher resistance and the LED can be powered directly from the source.

Assuming your unregulated wall wart (WW) is putting out 12 volts with no load on it. AND assume your LED has a forward voltage of 2.2 volts (usually a modern red LED will be about that - but look at the data sheet for that particular LED). Subtract 2.2 volts (or whatever forward voltage your LED happens to be) and then use Ohms Law. If the information on your data sheet says 20 mA max then figure for about 75% of that (20 x 0.75) about 15 mA will give you PLENTY of brightness from the LED.

Ohms law says that Resistance is equal to Voltage divided by Current. So if you want 15 mA on an unregulated WW that is pushing 12 volts unloaded then you'd divide 12 by 0.015 which gives you 800Ω.

Because the diagram shows the WW is only a half wave rectifier then it means that half the power produced by the WW is lost. You MIGHT see some flicker. If so - then a filter cap placed where you show yours in the drawing will be sufficient. Now, when it comes to recommending capacitance - I'm still learning too. But I'd think that a 1000 µF cap would be PLENTY of reservoir to make any flicker disappear.

So in a peanut shell - ditch the regulator for this circuit. Measure the output voltage with a meter. Connect a capacitor across the output and measure the voltage again. You'll be surprised to learn how RMS comes into play on this. But for quick reference, if you have a 9V unregulated WW and you connect a WW, you can expect (assuming 9V) 12.7 volts (9 x 1.414). 1.414 is the square root of 2 and is typically used to calculate the peak voltage of a sine wave that is measured. A 9 volt AC sine wave is effectively 9 volts at 0.707 (or 70.7%) of its peak voltage. Putting a capacitor in the circuit will capture that peak voltage.

There's a lot to learn about AC and DC, about current and resistance, and about capacitance. It's my opinion that you don't need a regulator in your circuit. To restate it - you don't need the regulator, just a capacitor and a little bigger resistor to do the same job. However, speaking about jobs - what is it you're ultimately after? To learn? To accomplish something? To meet the requirements of a test at school? Well, here (AAC) is a good place to learn and get advice. The only true dumb question is the one nobody thought to ask.

[edit] discovered an error in my calculations for the resistance at 12 volts / 15 mA. Edited the figures and came up with a new number. If you've already read my post - re-read it please for corrected information.

ALWAYS DOUBLE CHECK YOUR MATH. (like I didn't at first)
 

Thread Starter

leo.leo.leo

Joined Apr 4, 2017
19
Thanks and, by the way, I love peanuts.

My goal is to get into physical computing, really just for pleasure. The computing side I'm OK with but I'm sorely lacking on the physical side. So, I'm trying to get to grips with the basics and learn to walk before running.
 

ian field

Joined Oct 27, 2012
6,536
A small cap on the regulated side is usually recommended, and close the IC as noted. There's really no reason to have a big cap on the regulated side, since the voltage on that side should be smoothed by the regulator itself and doesn't need additional filtering (certainly not for an LED). It adds the complication that the energy in the cap will drain back through the regulator if the input power is removed from the regulator. Some designs place a reverse-biased diode across the regulator to carry that current safely around the regulator instead. .

Indeed - too much capacitance on the output can cause weird things to happen. Its not a bad idea to add an external bypass diode - but not many people bother.
 

crutschow

Joined Mar 14, 2008
34,412
There's really no reason to have a big cap on the regulated side, since the voltage on that side should be smoothed by the regulator itself and doesn't need additional filtering (certainly not for an LED). It adds the complication that the energy in the cap will drain back through the regulator if the input power is removed from the regulator.
That's really only a problem if the input is suddenly shorted to ground.
If you just remove the AC to the rectifiers, the filter capacitor will be drained by the output load, so the output voltage will never exceed the input voltage and there's no need for a protection diode.
 

wayneh

Joined Sep 9, 2010
17,498
That's really only a problem if the input is suddenly shorted to ground.
If you just remove the AC to the rectifiers, the filter capacitor will be drained by the output load, so the output voltage will never exceed the input voltage and there's no need for a protection diode.
See the TS's circuit - the filter cap is downstream of the regulator. The output voltage will always exceed the input voltage once there is no input, until the cap has discharged.
 

Tonyr1084

Joined Sep 24, 2015
7,899
Said it before - will say it again: Why use a regulator? All the circuit is doing is lighting an LED. Simple enough to just use a cap and resistor to control flicker and brightness. When it comes to a regulator - FAGHETA-BOUT-IT.
 

crutschow

Joined Mar 14, 2008
34,412
See the TS's circuit - the filter cap is downstream of the regulator. The output voltage will always exceed the input voltage once there is no input, until the cap has discharged.
Only if there's no load.
If there's a load the output capacitor will discharge which will draw current through the regulator to discharge the input capacitor.
That will keep the output voltage below the input.
 
Top