## Connect 220V AC to xmega`s ADC

18 posts / 0 new
Author
Message

Hi.
I would like to Connect 220V AC to xmega`s ADC so I googled for finding the circuit suitable for that and I found this:

but I could not understad why they use R71 and R72?
Does anyone have any idea for connecting 220V AC to xmega`s ADC?

Of course you realise that you can kill yourself with that circuit!

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

js wrote:
Of course you realise that you can kill yourself with that circuit!

Or someone else.

The internet's a wonderful thing but my word there are some crap circuits online.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

:D

could you please suggest me a circuit to do this ?!

I would use a small isolation transformer, something down to 6,9 or 12Vac.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

nta_xyz wrote:

could you please suggest me a circuit to do this ?!

Start by looking at the circuit you posted...

1) Can you identify what each component does?
2) Can you work out the electrical parameters for each component?
3) Why are there two 60k resistors when you can buy 120k ones?
4) Why do John and I think that this design has the potential to kill someone?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Hint...

if you were to draw a block diagram of the circuit I think there would be 4 blocks.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

js wrote:
I would use a small isolation transformer, something down to 6,9 or 12Vac.

could you please give me a schematic?

Brian Fairchild wrote:
nta_xyz wrote:

could you please suggest me a circuit to do this ?!

Start by looking at the circuit you posted...

1) Can you identify what each component does?
2) Can you work out the electrical parameters for each component?
3) Why are there two 60k resistors when you can buy 120k ones?
4) Why do John and I think that this design has the potential to kill someone?

3) I use two 60k because when I put one 120K it became heat! but with these two resistor I did not feel warm on the resistor.

1&2)yes except R71 and R72 I can explain what does each component.
R62 and R142 and R70 use for voltage divider so 220V convert to 1.5v AC. DZ23 and DZ24 use for protection if voltage goes up to 3V.
and I think C43 is for reducing noise!
4) I do not understand why you and john think that this circuit may harm me or someone else?! :D

Quote:
... but with these two resistor I did not feel warm on the resistor.
whimper..... 'aaaaaaaaaarrk.... NEVER touch anything that has more than 30V on it !

If the 220VAC Active and Neutral lines are EVER reversed then the GND will actually be at 220VAC (not close to zero) potential above earth = VERY high risk of electrocution and death.

There are 2 parts to this., AC and DC
R71, R72 and the 3.3V produce a DC offset at VT3.
The AC is superimposed on that offset.

Last Edited: Mon. Jun 2, 2014 - 07:25 AM

nta_xyz wrote:

I use two 60k because when I put one 120K it became heat! but with these two resistor I did not feel warm on the resistor.

But you could have used a single resistor with a higher wattage. But a good circuit would still use two resistors. Why? What voltage appears across each resistor? What voltage rating do resistors have?

nta_xyz wrote:

1&2)yes except R71 and R72 I can explain what does each component.

OK, so answer this...what is the maximum and minimum voltage your 220vac feed will show? What is the maximum and minimum voltages that will appear across the capacitor?

nta_xyz wrote:

4) I do not understand why you and john think that this circuit may harm me or someone else?!

What is the signal called GND in your circuit connected to?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

mikech wrote:
Quote:
... but with these two resistor

There are 2 parts to this., AC and DC
R71, R72 and the 3.3V produce a DC offset at VT3.
The AC is superimposed on that offset.

But the capacitor will smooth out the rectified AC, its only 1uF but the load is negligible

DC voltage is supplied to the last potential divider

The circuit is not very good, nowadays an isolation amp is cheap

Back in the day I hear they used to use arrays of resistors for this kind of thing, if a resistor failed no one died

Im exaggerating!, ten years as a sparky and of all the 230V shocks I have seen no one ever got hurt! not to say its not dangerous, it really is, its stark contrast though, on a building site if u get 230V you are a laughing stock

These days things have moved on and there is lots of health and safety

(on a side note I always like to see people fitting TVS diodes and theres seldom any discussion on their design, its like the blind leading the blind

I think the TVS diodes is the most complex consideration for that circuit

A final note for anyone inexperienced playing with mains

Do your homework, power electronics is much more dangerous than say wiring panels, everything is in a smaller space

if you must then always:

Use a 30mA RCD

Use proper differential probes for oscilloscopes

These arent optional or get them when you can afford them, dont start without them, no circuit of project is worth a human life.

If you play with mains on a bench and don't have these as a minimum you are playing with fire.

Thats coming from a time served JIB electrician with ten years experience who branched into power electronics some time ago

If you really need to look direct at 220V then use a small AVR that sit on the hot side, (run from the 220V to measure) and let it communicate to your XMega over something isolated.

But there are many ways to avoid to connect direct to the 220V
so tell us what it is you want to measure and at which speed?

Are you looking for zero crossing info, or just power on/off info, or other?

What else is the uC connected to?

Sealed box, or is there a user interface also connected to the device?

JC

DocJC wrote:

Sealed box, or is there a user interface also connected to the device?

It's called 'Haptic Feedback' :P

I think you should know what I need to do.

I need to measure the AC voltage (0_380 Volt) with xmega and know the value of voltage momentarily.

so if anyone knows a good way to do this please guide me.

nta_xyz:

I have done about the same thing for a home build wattmeter. I measure voltage and current simultaneusly and integrate over the voltage/amperage multiplication. And I have isolated output for oscilloscope too.

Difference is, I user an isolation amplifier, ISO122, and a hall-element current transducer, ACS712, to isolate the hot side from the safe side. ISO122 get +/-15V (and ground) from an isolated dc-dc converter, the current transducer dont need power on the hot side. 230V is divided down to by a resistor divider (2 resistors and nothing else), and fed into an opamp coupled as uni-gain amplifier. The resistors MUST be of high voltage type, minimum 400V. The instrument is battery operated.

ISO122 and ACS712 is a bit expensive, but well worth the money compared with the riscs of a non-isolated circuit. Transformers could do the same.

I would not use the circuit you showed, especially not the capacitor. It filters out spikes and other irregularies, and thats exactly what I would like to see.

Beware if you test this on a breadboard with high voltage exposed. Dont touch!

Peter

Do you have to measure to N or phase to phase ?
So I guess that you need 3 ADC's (for the 3 phases).
I would have a small micro (Tiny85 will do) on the hot side that have ground to N (- 1/2 Vcc if the hole sine wave is needed).
and then send data over at optocoupler.