Ac measurement up to 400 vac

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Ac measurement up to 400 vac

Post by Derrihj »

I got this circuit were gain is:
Gain= R8/(R1+ R2+ R3) ;
Gain= (22K)/( 1.2M + 1.2M + 2.2K) = 0.0091
And voltage out is:
Eg: 220vac = 311 peak.
Vout =0 .0091 * 311 = 2.8301 volt (peak output voltage)
As you can see R7 resistor is used to increase DC voltage level op-amp output.
Now output peak voltage from op-amp is 5 + 2.8301 = 7.8301
But microcontrollers can not measure voltage greater than 5 volt,so a voltage divider made up of two resistors both 10k is used to divide the output by two:
Vout = 7.8301/2 = 3.90155
Now this divided output is sent to ADC of microcontroller my quetion is now how do we put this in flowcode calculator inorder to display any change in Ac voltage input eg 220vac up to 400vac on a 16x2 LCD?
Attachments
IMG_20190507_125130.png
(18.48 KiB) Downloaded 1076 times
Last edited by Derrihj on Tue May 07, 2019 10:53 am, edited 2 times in total.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Ac measurement up to 400 vac

Post by Jan Lichtenbelt »

Dear Derrihj

I have first to give a general WARNING. Vac of 400 Volt, means Vtop-top = 400 x 2 x √2= 1131 Volt!! All components connected to this voltage must be applicable for this voltage.

A second WARNING is that mostly one pin of the Vac will be grounded with the other pin at the high voltage. If not know which is which, additional care has to be taken.

A third WARNING that that there are general requirements for distances between the parts at such high voltages and the housing. The distances depend if the housing is grounded or not.

I'm afraid that your proposal for reducing the Vac to an acceptable level and adding it to a dc voltage is not working and very dangerous. Solutions are e.g. using a transformer to separate the high voltage from the low voltage, or dividing the VAc voltage to lower levels and using an optical coupler to separate the high voltage from the low voltage.
Measuring of AC with a microchip is not possible. You have first to make dc from the ac by means of a diode bridge and capacitor. This dc must be lowered to 5 volt, if necessary. And a last this dc can be measured with an ADC of a microchip.

If you are Dutch, there is a very good forum for the electro part of your problem. https://www.circuitsonline.net/forum. But there will be equal forums in other languages.

Succes and be carefull

Jan

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

Thank you very much sir but also educate me here were i may be wrong 400 x 2 x √2= 1131
Where is the 2 coming from and what is it for i thought it would be 400 x √2= 565 peak volts only.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Ac measurement up to 400 vac

Post by Jan Lichtenbelt »

Dear Derrihj

You are right: The ac voltage Vt is:

Vt=V0.sin ωt.

The peak value V0 is indeed Vac x √2. And the Vtop-top= 2x V0 = Vac x 2 x √2.

Kind regards

Jan

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

Yes sir you know am looking foward to making an ac voltage stabilizer but coded in flowcode because i just find my self liking flowcode very much so in my ac volt stabilizer am looking at 130vac to 280vac to give me an out put between (200 - 250vac) so me talking about 400vac (which is 565 peak giving me 10v op-amp out divided by 2 = 5 volts maximum) is just a safety measure coz my stabilizer will cut off at 280vac as v- high

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

Ok if that wont work advise me also on this second setting will it work, and if it will how do we go about the calculation to display Vin on the LCD?
Attachments
IMG_20190408_221013.jpg
IMG_20190408_221013.jpg (103.04 KiB) Viewed 4671 times
Last edited by Derrihj on Tue May 07, 2019 10:57 am, edited 2 times in total.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Ac measurement up to 400 vac

Post by Jan Lichtenbelt »

Dear Derrihj

First of all, I'm not a high voltage specialist.

But your last setup will 100% sure give very dangerous fireworks. One of the diodes of the diode bridge will connect the 230AC to ground.

I STRONGLY advice you to buy a transformer for 230Vac to a low voltage. It cost about 5 pounds. And start safe experiences!
(e.g. https://www.conrad.nl/p/printtransforma ... el-1382847

Succes

Jan

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

Ok then i get you a transformer is a safe way to go that i know but expensive, anyway since u recomend it can u help with a full drawn diagram on paper and the calculations in flowcode calculator on how to display Ac voltage on lcd just help with diagram with all the components and flowcode calculation then that will be a good educative experiernce for me in this area coz i really need to learn it from the experts so that i dont land into trouble.Thanks again sir for your efforts waiting to hear from you sir.

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Ac measurement up to 400 vac

Post by Jan Lichtenbelt »

Dear Derrihj
Voeding microchip.jpg
(1.79 MiB) Downloaded 1282 times
This is about the setup. Start with C1=10µF, C2=1µF and C3=1nF.
Change in VAc must give changes in the DC voltage on top of C1. Therefor excess of charge (if VAc decreases) must flow away by means of R1+2. The value of R1+2 depends on which response time you need. If e.g. a response time RC of 0.1 second fulfils, then R1+R2 must be in de order of 10k. Take R3=1k.
If you use the transformer with 6Vac output *), you need a low drop voltage regulator, as shown in the figure. This voltage regulator needs the second capacitor C2. And each microchip needs C3 to decrease high frequent noise.
The 5Vdc can only be used for the microchip, else it will influence your ADC measurements.

Try this as a first electronic setup. Choose your microchip and start making a flowcode yourself.
Stop with discussion here, because this part of the forum is particular Flowcode 8. If you have still questions on electronics, find another special forum, or go to "electronics parts" of this forum. If you have problems with your Flowcode, open a new discussion here and upload your flowcode file.

Succes

Jan

*) 6VAc output will perphas be to low. Choose the 9Vac transformer preferable.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

But i have an ac voltage stabilizer here with me that has worked for months very well but is using that second setting that i posted, i have every notes about it apart from the code so i thought i could make my own code using flowcode,But what i dont undestand now is how did that programmer make that stabilizer work the perfect way using that second setting i posted.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Ac measurement up to 400 vac

Post by Derrihj »

Thanks sir for your advise, I used a transformer and I was able to read Ac up to 300 vac and the circuit was very accurate same reading with my Unit digital meter now am ready to make my voltage stabilizer it will have a low and high cut option and display both input voltage and output voltage on lcd in real time. This is my second flowcode succes project.

Post Reply