Well said, I have a broken microwoven, I wish I could make a drill machine!I think it's going to be an ozone generator.
Well said, I have a broken microwoven, I wish I could make a drill machine!I think it's going to be an ozone generator.
National SemiconductorThe circuits from post 16 are best for determining peak to peak AC, its not helping to calculate RMS ? I knew about this IC, https://www.ti.com/lit/an/snoa690/snoa690.pdf

Because power = Voltage squared divided by resistance. To obtain a figure that represents the amount of voltage that would dissipate an equivalent power in a resistor to a DC voltage then one has to calculate the average power that it would dissipate. hence the average of the square. (And the average of the square is not equal to the square of the average)so why square?
there was some discussion earlier about the maths, and complexity needed,Because power = Voltage squared divided by resistance. To obtain a figure that represents the amount of voltage that would dissipate an equivalent power in a resistor to a DC voltage then one has to calculate the average power that it would dissipate. hence the average of the square. (And the average of the square is not equal to the square of the average)
Squaring is easy - most microcontrollers have a single cycle multiply these days. Square rooting is difficult, but unnecassary. Just compare the mean-square value you have calculated to the square of the target value.
You also don't need to store all the samples, you can just run an IIR filter routine. If you choose a time constant for the filter of 256 samples, then the filter is trivial even on an 8-bit processors.there was some discussion earlier about the maths, and complexity needed,
just done some quick thoughts on the need to square, which is to make all signals positive if all signals are positive.
as you say no need to take squareroot , hence it just becomes a running average ! seems strange , but thought id ask,


1. what do you mean by " the analog input at A0 Arduino uno pin is fluctuating too much"@Reloadron @lan0 @ drjohsmith @panic mode @Jerry-Hat-Trick
I do appreciate all of your suggestions and comments here. Looks like we are making complexity, thinking either way around and as a result the goal of this project is not going correctly.
As I posted #79 the circuit is silly, but kindly consider following facts,
1. We understand why the analog input at A0 Arduino uno pin is fluctuating too much. I have my Arduino code, and unfortunately, when I run the voltage comparison loop to activate relays, the relays get confused which load they should turn on, may be I have to draw a good tab changing transformer proteus Model.
2. Couple of circuit has presented for measuring perfect peak to peak AC and possibilities to get true RMS value.
3. We need a rectifier from the AC source, we need voltage divider. If we consider DC component and ripple may be we need low pass RC?
4. Start with a small (safely connected) mains transformer, 4 to 6 VAC would do, then you can work out the resistor values to give around the 4 to 4.5 volts at the ADC. Whether you have the ADC looking for the rectified peak values, or a slower smoothed DC voltage depends on how fast you need the voltage value updated. With such a very small current through the diodes (<1mA) they won't heat up, so the 0.6V across them won't change much. I like this simple way, kindly put your comments here,
View attachment 362028
5. I already posted a solution using opto-coupler, but here is a DIAC as a simple voltage to time generator. (DIAC model found on web)The better diacs have 28~34V specs and 15uA trigger, but they do not bother to spec temperature tolerances of the dV
ST do spec the break over voltage so you get some idea. You would need to measure some, and maybe do a 2 point calibrate, and table/equation but it is very simple in hardware. The code would capture dT and look for the shortest time per half cycle to extract the peak voltage. Its cheaper, It is much smaller and cheaper than a transformer There is a precision/cost trade off - 'jellybean' DIACs are under 1c at lcsc, tighter tolerance, lower trigger max parts from ST are ~ 5c .
View attachment 362029
Kindly discuss only this points and the code I posted.
Hi,Dear All,
I am trying to design one of the AC sensing circuit as follows, my goal is to make 5V analog to ADC's by Arduino Uno which is taking the input at A0 analog pin.
View attachment 361525
C4 and C5 are used to smooth the pulsating DC com-ing from the rectifier. C4 performs the main bulk filter-ing by reducing low-frequency ripple, while C5 filters out high-frequency noise. The integrated digital voltmeter measures and shows the DC voltage after this filtering stage.R14 forms part of a feedback path or voltage divider used for voltage monitoring. The load resistors R12 and R13 are elements of an additional smoothing network. C6 further filters the output. D27 and D28 provide reverse-polarity protection and also function as part of a clamping/regulation circuit.
Kindly suggest me anything better.
@drjohsmith, kindly consider this post only. Don't mixed up things with other references/ forums. LM324 voltage stabilizer is different one. It's not hard to understand. Keep it as simple as it is. Post #111 should discuss here.@MrAl
wel. said , if your catching up, be aware the op has multiple posts over multiple forums over multiple years on this project ,
Qdos to them for keeping at it , but its hard to understand
.
@MrAI, If you have time kindly read this full thread. See the reference code, sampling parameter is already defined.Hi,
This thread grew too fast so there are a lot of pages that I can't read right now, but I thought I would throw in a little.
For something like this we have to know what the expectations are for the output. That is, how accurate does it have to be. That includes the number of bits the ADC will be using to sample the output.
Filtering is the easy part there are a lot of ways to filter, including in code.
We also have to know how FAST you have to sample the output. Is it once per millisecond, once per second, or once every 10 seconds for example. This makes a BIG difference in the way we would filter it.
In one application I did a while back I only had to sample once every 10 seconds so the filtering was really simple.
Another key point is how fast do you have to sample after the circuit is first turned on. That tells us how fast the circuit has to reach steady state. There are some tricks that can be used here too, but only if needed.
Uhm .@drjohsmith, kindly consider this post only. Don't mixed up things with other references/ forums. LM324 voltage stabilizer is different one. It's not hard to understand. Keep it as simple as it is. Post #111 should discuss here.
Your response should be to the point.Uhm .
You say don't consider other forums , but your the one that references previous posts in other forums .. !
I assume it's with reference to yourself when you say it's not hard to understand..
That's great news ,
Lets hope we move to a clear set of definitions and not the apparent ever changing set of pictures / code / schematics from who knows where.
So your insulting me saying I find your circuit hard to understand.Your response should be to the point.
If you don't want to respond its good sometime. If I were you, I will just avoid things that is Hard. Let's say you have 40+ years experience but it's should not be click always
for me threads with too many replies are a red flag. usually this means problem is not stated clearly and concisely. an XY problem...@MrAI, If you have time kindly read this full thread.