Voltage Regulators (LM7805) & Capacitors

Greetings all --

I've spent the last several hours researching something I don't understand but have failed to figure it out on my own -- so I thought I would ask the experts :slight_smile:

I've been tinkering with a RFID Door Lock project I found at instructables.com -- but I absolutely do not understand how the values for the capacitors on either side of the voltage regulator in the schematics were selected.

I've looked at datasheets for both Fairchild and National for the 78XX v-reg's but found that the size of capacitors used in their examples were much smaller than those used in the schematic for the project I've been looking at.

The forums I have sifted through have provided some crazy-intense explanations of how to calculate for the size of a capacitor used with a v-reg, but I'm hoping someone can spell it all out in a much clearer fashion so I can grasp the concepts moving forward.

While I'm on the subject though, ... in the example project I noted above, the author is using a 12vdc Electric Strike Plate for the door lock mechanism. According to his schematic, he's feeding 15vdc to the electric strike and then to the 7805 v-reg to supply power to the arduino. Why would you not ALSO throw in a 7812 v-reg before supplying power to the lock mechanism? And if you were to do so... it begs the question... what size capacitor would you use on the input side of the 7812?

Thanks for your help! :slight_smile:

The relay/solenoid can be pretty tolerant of voltage, just have to control the current thru it really to activate it.
If the power in to the 7805 is decent DC, you don't need too big of a cap.
If its really dirty AC and you are drawing lots of current, then need bigger caps to smooth the AC transitions out or you will see ripple on the 5V side.
If you're just powering digital circuits, you might find that acceptable.
If you have some audio going, then you might not - it will be audible as 60 Hz, 120Hz and maybe 180Hz hum depending on your rectification of the AC.

The forums I have sifted through have provided some crazy-intense explanations of how to calculate for the size of a capacitor used with a v-reg, but I'm hoping someone can spell it all out in a much clearer fashion so I can grasp the concepts moving forward.

Without explaining what you don't understand, this thread is probably going to end up in the same direction.

Whenever current is drawn from a regulator, the voltage will start to drop. There is a certain amount of time it takes before the regulator notices and increases voltage to compensate. This is known as ripple. The amount of ripple will be larger if more current is drawn from the regulator. To compensate, a capacitor provides a temporary bank of energy. This helps keep the voltage stable resulting in less ripple.

So when picking values of capacitors you need to know the maximum amount of current load and expected amount of ripple. Principle applies to both the input and output side. The difference is that the voltage ripple will be different.

Keep in mind most designs will calculate the minimum caps need and then select something larger.

Thank you both for your replies! I will try to be more specific in my questions but I am not beyond doing a little homework, so if you have any specific questions about the hardware I'm dealing with please ask!

With the circuit from the instructables site set up on my breadboard I was able to see that at peak current the circuit was drawing just under half an amp.

Now, judging from the data sheets on the v-regs noticeably smaller selections of smoothing capacitors, I presumed that this was the "default" for the LM7812 under a constant load and at the minimum voltage required to keep the current flowing through the regulator.

What I don't understand is the relationship between the "default" capacitors in the data sheet with those selected by the original author of the schematics for RFID door lock circuit. I realize the reason for the larger capacitors has to do with the load placed on the regulator at certain points in time, but it doesn't appear to be a linear relationship (load doubles leads to capacitor size doubled)

What got me thinking about this was the fact that the original schematic doesn't have a 7812 v-reg in circuit... Only a 7805 for the arduino portion of the circuit. So if I wanted to add that missing 7812, I would need to figure out / calculate the correct smoothing capacitors to the circuit along with the new 7812.

Again, thank you for your response... It is truly appreciated!

Well the only capacitors I see specified in the instructable (I can't seem to open the schematic without paying, so I'm not going to bother) are 22pF. This doesn't sound like a value that was calculated, but just picked.

Typically you'll see 33µF or 47µF on the input and 0.1µF on the output. Spend some time doing the math and you'll see these are usually large enough, or even overkill, for more applications.

Actually, in many cases, something like a filter cap is just selected by trial and error, by looking at the output of the regulator during use. You make a quick guess based on experience), then correct appropriately. It's way faster than doing a bunch of calculatuions. For some simple things, there may be no cap needed at all.

In filtering, sometimes you use a really big cap in prallel with a really small cap. The big cap gets rid of big ripple, but because it has a small amount of inductance, it can't get rid of small, high-frequency ripple, so they just try some small caps until the high-frequency is gone. It's faster than trying to calculate the inductance of the larger cap and calculating how the ripple is affected by all of the other components etc.

I hate to suggest anything radical, but you could always read the datasheet from the manufacturer of your device and see what the manufacturer says you should use.

One thing I found reading 7805 datasheets is that the values recommended by the manufacturers vary. Sometimes the specs vary - e.g. the max voltage.

-j

baylorbear:
What got me thinking about this was the fact that the original schematic doesn't have a 7812 v-reg in circuit... Only a 7805 for the arduino portion of the circuit. So if I wanted to add that missing 7812, I would need to figure out / calculate the correct smoothing capacitors to the circuit along with the new 7812.

As noted before - you don't need a regulator for the solenoid, as it will likely be tolerant of the higher voltage level; also, a 7812 may or may not be able to supply the current needs for the solenoid (you didn't mention what they were) if you did use it, and might go into over-current/thermal shutdown. I personally wouldn't worry about regulating the voltage to the solenoid - that part doesn't need it (unless your input voltage was much higher). Stick to reading the datasheets and how to calculate the cap values needed. As noted by others, most circuits use the default values that the datasheet recommends, or they are found thru trial and error (by measuring the ripple with an oscilloscope).

Thanks again to all the replies!

Based on the feedback here, I think I will not be adding the 7812 to the circuit.

But for clarification, the electric strike is a 12vdc 450mA from Kawamall.

The schematics on the Instructable tutorial call for a leading 100uF/25v cap on the input of the 7805 and a following 10uF/10v cap on the output of the 7805.

In my circuit, I've got a Fairchild LM7805. The "typical use" schematic provided in the datasheet recommends a 0.33uF leading Cap and 0.1uF following Cap. The author of the Instructable didn't mention what manufacturer his 7805 was, so I looked at several online and couldn't find any that recommended a 100uF / 10uF combination.

For the "ready state" of the circuit, it is pulling around 60-75mA waiting for an RFID card to be read. When one is found to be correct, the current spikes to ~500mA total while the electric strike is activated. Given these circumstances, how might one "guess" that the appropriate capacitor size needed for the 7805 should be the 100uF/10uF used in the current design when only 0.33uF/0.1uF is recommended in the datasheet?

Based on everyone's feedback, I'm guessing that the Caps really wouldn't make-or-break the circuit at all in this scenario since most have suggested 'trial and error'. Would it be a safe assumption to always opt for larger than necessary caps? (without going overboard of course)

Caps are used for different things. You may want to add the 0.33/0.1 that the manufacturer recommends to prevent oscillation, and add a larger (or two) to help avoid voltage sag when the load changes.

IIRC an arduino clone I have calls for a 47uF and 1uF (or 10uF) on the input side of the 7805, and a 0.uF on the output.

-j

"Based on everyone's feedback, I'm guessing that the Caps really wouldn't make-or-break the circuit at all in this scenario"

True enough - if you are seeing the arduino get upset (like resetting itself) when the door strike thing engages, that's a sign that current into the 7805 is being pulled away, and you need a bigger cap feeding the arduino VCC to keep it alive.

Capacitors are an interesting device. Nobody cares about them until they matter. (e.g. the circuit stops working because of the cap.)

Trust me, I know. I work for a Capacitor company. :wink:

Do you get free samples? 8)

I can't seem to open the schematic without paying

You can't see the additional images on a page of an Instructable without signing up, but you do NOT have get the "pro" (paid) account to do so (the free account should work fine. At least mine does; I don't think it's grandfathered...)