Creating a stable 5V DC supply out of 6 V (RMS) AC

In summary, to power two ATmega 8A μCs from a 6 V AC transformer, you will need a 9 V transformer and a capacitor to smooth out the voltage.
  • #1
Wrichik Basu
Science Advisor
Insights Author
Gold Member
2,138
2,713
I need to create a 5 V stable DC supply out of 6 V AC from a transformer. By "stable", I mean that I do not want the ripples in the voltage that one gets from the output of a full-wave bridge rectifier. I have to feed this to two ATmega 8A μCs.

I am going to create the following circuit:

Untitled Sketch 9_bb.png


6 V RMS means ≈ 8.5 V peak. The capacitor will hopefully smooth out the ripples. The LM 7805 voltage regulator will bring down the voltage to 5 V. I can attach a heat sink to it if it tends to get heated up too much.

I don't yet have all the materials; once I get them, I can use the Arduino analogRead() function to have a look at the waveform of the output of the circuit because I don't have an oscilloscope.

Does this circuit look okay? Any suggestion for improvement?
 
Engineering news on Phys.org
  • #2
I wonder if 6V isn't too low for LM7805. Unless I am misreading it datasheet says min 7 V (hardly surprising, each junction eats around 0.6 V, there is probably more than one on the current path, so there is not much margin). I am not sure though how it will work with RMS vs peak. (That's not the only thing I am not sure about, I know next to nothing).

Instead of struggling with analogRead() consider investing in something like DIY DSO138. I have been on that path several years ago, it was worth every cent I paid :wink:
 
  • Informative
Likes Wrichik Basu
  • #3
Borek said:
I wonder if 6V isn't too low for LM7805. Unless I am misreading it datasheet says min 7 V (hardly surprising, each junction eats around 0.6 V, there is probably more than one on the current path, so there is not much margin). I am not sure though how it will work with RMS vs peak.
In that case, I can use a 9V transformer.
Borek said:
Instead of struggling with analogRead() consider investing in something like DIY DSO138. I have been on that path several years ago, it was worth every cent I paid :wink:
Never knew of oscilloscopes in that price range. Checked out some YouTube videos, and this one seems to be really helpful. Will surely buy it with the rest of the items. Thanks!
 
  • #4
You don't say how much DC current you need. Your circuit should work fine for very low currents. The capacitor needs to be large enough (WRT your current) to 'stay above' the 7805 minimum input voltage at your desired current (without overloading the transformer). Using a higher-than-required supply voltage (with a linear regulator) results in more heating of the regulator - current (again) is a critical parameter. There are 'LDO' (low dropout) regulators which require less 'headroom' than the venerable 7805.
 
  • Like
Likes DaveE
  • #5
Dullard said:
You don't say how much DC current you need.
< 1 A.
 
  • #6
At 1A, the voltage of a 100uF capacitor will decay at (approx) 10,000 V/S (10V/mS). Ic = CdV/dT. You need the capacitor to 'carry' the load for something approaching 10mS (P-P time for bridge-rectified 50 Hertz). The peak charge currents (from the transformer) will exceed the 1A rating (by a lot) - the peak voltage will be much-reduced (as a result). Your arrangement is probably OK for < 10mA.
 
  • Informative
Likes Paul Colby
  • #7
Wrichik Basu said:
ATmega 8A μC
From the datasheet, "Operating Voltage Range (V) = 2.7 to 5.5"

So why are you wanting to run your uCs at 5.0V? Run them at 3.3V instead, and use a buck DC-DC converter to generate the 3.3V rail from the 6Vrms transformer. But as @Dullard points out, you need to be sure that your transformer doesn't droop too much (from series current losses) as you pull power out of it.
 
  • Like
Likes DaveE
  • #8
Oh, and your circuit picture does not show the required switch and fuse in-line with the AC Mains input. Even if you are planning on adding them to your project, you should always show them in your schematics and drawings. It shows that you have some experience with AC Mains projects... :wink:
 
  • Like
Likes sysprog, davenn and dlgoff
  • #9
berkeman said:
So why are you wanting to run your uCs at 5.0V?
Basically I will program the ATmega's with Arduino bootloader, and for that, I need to supply 5V to the microcontrollers.
berkeman said:
Oh, and your circuit picture does not show the required switch and fuse in-line with the AC Mains input. Even if you are planning on adding them to your project, you should always show them in your schematics and drawings. It shows that you have some experience with AC Mains projects... :wink:
Drawing circuits in Fritzing is a pain. The software doesn't have most of the ICs I am using; I am adding them using a Note. Further adding switches and fuses will only increase the complexity, so I decided to hide them below "220 V, 50 Hz AC". For my experiments, I have the necessary safety equipment in place.
 
  • #10
Wrichik Basu said:
Basically I will program the ATmega's with Arduino bootloader, and for that, I need to supply 5V to the microcontrollers.
Okay. Then I would go with the higher output voltage transformer and still use a DC-DC Buck converter to generate the 5V.
 
  • Like
Likes Wrichik Basu
  • #11
This (very common) power supply design is actually pretty tricky to analyze, because it is very non-linear. The best treatment I've seen is from this 1980 National Semi handbook (back in the days when tech companies would actually teach circuit design to their customers!). Today, people would put the schematic in a simulator and get an answer with little understanding of what's happening. Back then, one applications engineer would do a bunch of simulations and then write a guide for other engineers to design from.

In any case, the appendix on "Power Supply Design" is what I would read first. Here you can see pictures of the "droop rate" that @Dullard referred to as well as graphs that quantify the results.

You will find that the total resistance in the circuit that charges the capacitor (mostly the transformer windings for low power designs) is a key parameter. If you want to do the design right, you need to take into account that the line voltage may vary, for commercial product design we would use at least +/- 10%; this has a big impact on the worst case heat that the linear regulator has to dissipate. Also, at low voltages, don't neglect the voltage drop across the diodes. You can use Schottky diodes to get about a 0.5V improvement there.
 
  • Like
  • Informative
Likes sysprog, Wrichik Basu and berkeman
  • #12
DaveE said:
The best treatment I've seen is from this 1980 National Semi handbook
Thanks! Bookmarked. I used to have a hard copy up until about 5 years ago. It was very well-worn, as you might imagine. :smile:
 
  • Like
Likes sysprog and hutchphd
  • #13
berkeman said:
Thanks! Bookmarked. I used to have a hard copy up until about 5 years ago. It was very well-worn, as you might imagine. :smile:
I left my "well worn" copy in my office in 2007. I thought, I can get all of that data on the web now. Big mistake. For your favorite "well worn" books. I still miss being able to spin around in my chair, grab a data book, open it to a bookmarked page for a common IC (LM324, comes to mind) and immediately get a spec for output impedance or something. Yes, it's in the cloud, but that doesn't mean it easy to find or quick.

Dave's Office 008a.jpg
 
  • Like
  • Love
Likes sysprog, Wrichik Basu, davenn and 1 other person
  • #14
Looks almost exactly like my bookcase at work about 15 years ago. Slowly but surely, I recycled more and more as part of various company moves.
 
  • Like
Likes Klystron and DaveE
  • #15
Wrichik Basu said:
< 1 A.
Really? 1A for an Arduino?
 
  • #16
DaveE said:
Really? 1A for an Arduino?
Well, technically it's two of them. But still...
Wrichik Basu said:
I have to feed this to two ATmega 8A μCs.
 
  • Like
Likes DaveE
  • #17
DaveE said:
Really? 1A for an Arduino?
To be fair, he did say less than 1 A :wink:
 
  • Like
Likes Wrichik Basu and DaveE
  • #18
Wrichik Basu said:
Does this circuit look okay? Any suggestion for improvement?
100 uF will be insufficient reservoir capacitance.
The quick design process advances from both ends to meet at the reservoir capacitor.
A 9 volt, 1 amp transformer will droop by about 5% to the specified 9 Vrms when loaded.
That is a peak voltage of 9 * √2 = 12.73 volts.
The two conducting silicon diodes in the bridge will drop about 1 volt each = 10.73 volt.
The regulated output is 5 volt. The regulator dropout voltage is 2 volts higher = 7 volts.
So capacitor ripple must be less than; dv = 10.73 - 7 = 3.73 volts.
For 50 Hz the full wave ripple will be at 100 Hz. That is a period of dt = 10 ms.
The maximum load is 1 amp.
C = Q / V ; by definition, and; Q = I · t ; so C = I · dt / dv.
Required minimum reservoir capacitance; C = 1 A * 0.01 sec / 3.728 V = 0.00268 farad = 2680 uF.
There is no tolerance for components or supply voltage in that computation. Use 4700 uF.
 
  • Like
  • Informative
Likes Wrichik Basu, hutchphd and Averagesupernova
  • #19
Baluncore said:
100 uF will be insufficient reservoir capacitance.
The quick design process advances from both ends to meet at the reservoir capacitor.
A 9 volt, 1 amp transformer will droop by about 5% to the specified 9 Vrms when loaded.
That is a peak voltage of 9 * √2 = 12.73 volts.
The two conducting silicon diodes in the bridge will drop about 1 volt each = 10.73 volt.
The regulated output is 5 volt. The regulator dropout voltage is 2 volts higher = 7 volts.
So capacitor ripple must be less than; dv = 10.73 - 7 = 3.73 volts.
For 50 Hz the full wave ripple will be at 100 Hz. That is a period of dt = 10 ms.
The maximum load is 1 amp.
C = Q / V ; by definition, and; Q = I · t ; so C = I · dt / dv.
Required minimum reservoir capacitance; C = 1 A * 0.01 sec / 3.728 V = 0.00268 farad = 2680 uF.
There is no tolerance for components or supply voltage in that computation. Use 4700 uF.
Yes, this a good way to approach this design.

However, be careful about the assumption of 5% drop in transformer voltage. This rule of thumb mostly applies to AC circuits with sinusoidal currents. In low ripple rectifiers with capacitive loads, the actual peak current that creates the voltage drop is many times the DC load current because the capacitor is only recharged for a short period of time. You might see that the transformer output voltage is flattened significantly at the peaks because it can't support the high peak current. This is the genesis of much of the non-linearity in the design nomographs in the hand books.

For example (using crude ball-park estimates) let's say a 12V transformer sags 5% with a 1AAC load. This is roughly 0.6Ω of series impedance. Now, let's assume that the capacitor is recharging only for 20% of the time. Then a 1ADC load might draw 5A pulses from the transformer and thus create a 3V drop at the peak instead of the 0.6V drop expected.

This is one of the few analog circuits where trial and error in the lab or simulators are pretty useful.
 
  • Like
Likes tech99
  • #20
The big problem was the reservoir capacitor. Calculated 2680 uF works, I would use 4700 uF.

Now that is fixed I don't worry too much about the diode conduction angle because as it increases the storage time, dt will be reduced.

Cheap 1 amp Si diodes will show significant resistance above 1 amp. You might replace them with 3A schottky diodes.

You might also halve the transformer resistance by specifying an 18VA transformer, rather than 9VA.

In this model, with a regulated output 1 amp load, the 1 amp Si diodes are dropping 1.35 volt at an Ipeak of 4 amp. You can see how with the original calculated values, that once operating (6ms) the headroom (yellow trace) remains positive.

Circuit1.png


circuit2.png
 
  • Like
  • Informative
Likes eq1, sysprog, Wrichik Basu and 1 other person
  • #21
Baluncore said:
100 uF will be insufficient reservoir capacitance.
The quick design process advances from both ends to meet at the reservoir capacitor.
A 9 volt, 1 amp transformer will droop by about 5% to the specified 9 Vrms when loaded.
That is a peak voltage of 9 * √2 = 12.73 volts.
The two conducting silicon diodes in the bridge will drop about 1 volt each = 10.73 volt.
The regulated output is 5 volt. The regulator dropout voltage is 2 volts higher = 7 volts.
So capacitor ripple must be less than; dv = 10.73 - 7 = 3.73 volts.
For 50 Hz the full wave ripple will be at 100 Hz. That is a period of dt = 10 ms.
The maximum load is 1 amp.
C = Q / V ; by definition, and; Q = I · t ; so C = I · dt / dv.
Required minimum reservoir capacitance; C = 1 A * 0.01 sec / 3.728 V = 0.00268 farad = 2680 uF.
There is no tolerance for components or supply voltage in that computation. Use 4700 uF.
Thanks a lot for this calculation.
Baluncore said:
Cheap 1 amp Si diodes will show significant resistance above 1 amp. You might replace them with 3A schottky diodes.
Will the 1N5822 Schottky diode (datasheet here) be suitable in this case?
Baluncore said:
You might also halve the transformer resistance by specifying an 18VA transformer, rather than 9VA.
9V 2A or 18V 1A? Actually I am trying to keep down costs. At first, I thought that I would build my prototype with Arduino and then transfer it to a stripboard and use one ATmega 8A. Then it turned out that the way I have written the code (which I cannot change), one μC won't suffice, and I need another one for reading user input. So I decided to connect the two via Serial communication. 2A transformers are twice the cost of 1A transformers. But 18V 1A is still within the reach.
Baluncore said:
In this model, with a regulated output 1 amp load, the 1 amp Si diodes are dropping 1.35 volt at an Ipeak of 4 amp. You can see how with the original calculated values, that once operating (6ms) the headroom (yellow trace) remains positive.
Which software are you using for this simulation?
 
  • #22
Wrichik Basu said:
Will the 1N5822 Schottky diode be suitable in this case?
Those diodes look good.
Wrichik Basu said:
9V 2A or 18V 1A? Actually I am trying to keep down costs.
If you use 4700 uF for the reservoir, and use a schottky diode bridge, you should not have problems with the 9VA transformer.
Wrichik Basu said:
Which software are you using for this simulation?
I use LTspice. It is free software. https://en.wikipedia.org/wiki/LTspice
https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html
When you download and install LTspice you can run the attached .asc file.
Remove the extra .txt extensions which allow the text files to be attached to this post.
 

Attachments

  • Linear_reg_1.asc.txt
    2.2 KB · Views: 214
  • Linear_reg_1.plt.txt
    364 bytes · Views: 184
  • Like
  • Love
Likes sysprog and Wrichik Basu
  • #23
Instead of the good old 7805 something new, with lower voltage drop would be better.
quick find
There are others. Plenty of them, actually :wink:
 
  • #24
Rive said:
Instead of the good old 7805 something new, with lower voltage drop would be better.
quick find
There are others. Plenty of them, actually :wink:
The website from where I buy these things doesn't have a very long range of voltage regulators. They have some low dropout ones, but they are all SMD. I am not very good at soldering THT components, let alone SMD.
 
  • #25
Surely you have a spare USB phone charger around?
 
  • Like
Likes eq1
  • #26
pbuk said:
Surely you have a spare USB phone charger around?
Of course, yes. I can rely on that, but I want to design the circuit myself (where possible), which often leads to fruitful learning experience. For example, I gathered valuable knowledge in this thread, which will surely be useful in the future.
 
  • Like
  • Love
Likes davenn, Averagesupernova and berkeman
  • #27
Wrichik Basu said:
Of course, yes. I can rely on that, but I want to design the circuit myself (where possible), which often leads to fruitful learning experience. For example, I gathered valuable knowledge in this thread, which will surely be useful in the future.
This is an excellent attitude to have. So often we see people come on this forum (usually kids/teenagers) who think they are inventing something by throwing a bunch of complex hardware together. They don't see it but to engineers they are creating a huge Rube Goldberg machine. We condition these youngsters to do that by going the 'purchase something already available' route. That is not to say we should reinvent the wheel at every opportunity.
 
  • Like
Likes davenn, sysprog and Wrichik Basu
  • #28
berkeman said:
Thanks! Bookmarked. I used to have a hard copy up until about 5 years ago. It was very well-worn, as you might imagine. :smile:
Sometimes there's just no acceptable substitute for hardcopy ##-##

1609264042238.png
 
  • Like
Likes AlexCaledin
  • #29
Wrichik, you didn't mention which, if any, Ardiuno sensors you'll be using as many of the sensor packages won't do well with this design, as drawn, because it doesn't have any filtering.

Probably the sensor that would suffer the most is the capacitive touch sensor because the main's common mode is passed completely unattenuated. Good USB chargers for cell phones have common mode chokes to suppress this noise so you use the device while charging. You can tell when you're using a cheap one because the cursor will jitter under your finger. Common mode can be a big problem, especially if you have your circuit plugged into a power strip with a lot of other things also plugged into it.

Since it's just a learning exercise, I wouldn't worry about it too much. But if you have really noisy sensor readings farther down the line, try switching your project to being powered from a high quality USB charger, if the noise goes away you'll know what the culprit is.

This app note has more information on it.
https://www.murata.com/~/media/webrenewal/products/emc/emifil/knowhow/26to30.ashx
 
  • #30
Wrichik Basu said:
I don't yet have all the materials; once I get them, I can use the Arduino analogRead() function to have a look at the waveform of the output of the circuit because I don't have an oscilloscope.

Oh ya, when you're doing this make sure you only connect the ADC to nodes after the rectifier that are referenced to the same ground as the Arduino. You can get into some hazardous situations for you and the equipment if you don't.

https://www.newark.com/pdfs/techarticles/tektronix/FFM.pdf
 
  • #31
eq1 said:
Wrichik, you didn't mention which, if any, Ardiuno sensors you'll be using
I will be using only the TSOP 1838 infrared receiver. It's datasheet shows a circuit that can be used to suppress power supply disturbances, if there are any.

1609306397994.png

eq1 said:
Oh ya, when you're doing this make sure you only connect the ADC to nodes after the rectifier that are referenced to the same ground as the Arduino. You can get into some hazardous situations for you and the equipment if you don't.

https://www.newark.com/pdfs/techarticles/tektronix/FFM.pdf
Yes, of course, it will always be after the rectifier. I know that microcontrollers cannot withstand AC.
 
Last edited:
  • Like
Likes davenn
  • #32
pbuk said:
Surely you have a spare USB phone charger around?
If you don't here's a tip I learned decades ago. Go to the nearest car rental counter. Tell them you left your charger in a rental car. They will show you to a bin full of chargers, cords, phones, and other devices that people left behind and they'll say, "Help yourself."
 
  • Like
  • Haha
Likes Algr, Wrichik Basu, pbuk and 1 other person
  • #33
DaveE said:
The best treatment I've seen is from this 1980 National Semi handbook (back in the days when tech companies would actually teach circuit design to their customers!).
I've got that National handbook and several other National handbooks (e.g. Audo applications handbook with tons of op-anp circuits Yes, back in the days there was an annual Mid-American Electronics Conference in Kansas, City that I would always attend and the chip vendors would hand out their free data books. I also have the full set of Fairchild Semiconductor handbooks and a Signetics's IC databook and their their Digital, linear, mos applications book. I don't use them much these days however.

edit: I just noticed that I also have a Hewlett-Packard Optoelectronics Designer's handbook
 
  • Like
Likes DaveE and berkeman
  • #34
With 6V AC, the rectifier must be "doubling" (or how do you call it in English), and then the regulator ought to be switching, LM2575T−5G seems best (very reliable).
DoubleRect.png

The thing is, the regulator input must have some "spare" volts, to give time for the microprocessor to finish the process in case of sudden AC supply disappearance. Even if there's no AC sensor to warn the processor, the "excessive" voltage (and capacitance) helps to withstand possible transient AC interruptions. The LM2575 allows up to 40V at its input!
 

Attachments

  • LM2575-D.PDF
    642.9 KB · Views: 171
Last edited:
  • #35
AlexCaledin said:
LM2575T−5G seems best
I will make a note of this, but unfortunately won't be able to buy it because the website from where I buy my components does not have this.
 
  • Like
Likes AlexCaledin

Similar threads

Back
Top