Author Topic: Measure 330V ac with microcontroller  (Read 4348 times)

0 Members and 1 Guest are viewing this topic.

Offline A2Topic starter

  • Contributor
  • Posts: 44
Measure 330V ac with microcontroller
« on: July 20, 2014, 11:14:41 am »
 I have to measure 300V ac max. I took 330Vrms ac (467V peak) to be on safer. Have to remove opamp for cost reduction which could act as buffer & adder.
Directly put that pin to MCU for measurement by level shifting the signal.

1. Divided the ac voltage by two resistors to 2.5V peak or 5V peak to peak.

2. planning to level shift this ac signal to 2.5V. So that at MCU adc pin, signal appears as moving from 0-5V. (ac)

3. I have attached the circuit. (zoom in to see it)

4. But problem is circuit now is on dc bias of 1.455V dc. If we do analysis by superposition, I can find out this.


But I want to level shift the signal so that it stays on 2.5V dc bias & also appears as low impdence source to analog pin of MCU i.e less than 10K.
What resistor values i should choose
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Measure 330V ac with microcontroller
« Reply #1 on: July 20, 2014, 11:39:14 am »
Please do not use this design as it is not safe.

1) Dropping 467V down to 5V across one resistor means that you have a single point of failure, if that resistor shorts out then the full voltage will be applied to your circuit. It is better to use a chain of resistors (all of them high voltage rated).

2) You need a HRC fuse on the input. again in case of failure.

3) There is no protection on the input of your microcontroller and if the input rises above 5V then your chip is dead. Consider fitting a 5V zener diode and a series fuse.

4) You need an indicator that the circuit is live.

When building this circuit you must use large gaps between the circuit traces on your PCB and you must mount the board inside an earthed metal enclosure. If your microcontroller requires controls then you must ensure that the shafts of these controls are grounded to the enclosure.

Please consider abandoning this approach and use a circuit with an analog opto isolator such as the HCNR200, this will be much safer.

Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10220
  • Country: nz
Re: Measure 330V ac with microcontroller
« Reply #2 on: July 20, 2014, 12:14:21 pm »
But I want to level shift the signal so that it stays on 2.5V dc bias & also appears as low impdence source to analog pin of MCU i.e less than 10K.
You don't need to have 10k impedance unless you plan to run the MCU ADC at full sample rate.
If you just want to measure a voltage for display purposes or any slow logic you can drive the ADC from as high as 100K. If you set the ADC clock nice and slow there will be plenty of time to charge up the ADC's internal sample capacitor.

Please consider abandoning this approach and use a circuit with an analog opto isolator such as the HCNR200, this will be much safer.

As above, or at the very least add a capacitor to decouple the mains from the 5V side.
Optoisolater is the better approach though.

« Last Edit: July 20, 2014, 12:17:16 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: au
Re: Measure 330V ac with microcontroller
« Reply #3 on: July 20, 2014, 01:00:22 pm »
Quote
2) You need a HRC fuse on the input. again in case of failure.

Just want to question this.
You probably don't need a HRC fuse unless you don't have any upstream circuit breakers that will break on the current that a non HRC fuse can handle. Such as CAT IV.
Otherwise you may be able to use a glass fuse, even an M205 fuse can handle about 30A, but you need to check the specs.
So if for instance, this device will only be used on circuits that have a 30A circuit breaker upstream, you would be ok with an M205 fuse.

In short the fuse needs to be able break the maximum fault current of where it could be situated. Not necessarily a HRC fuse.
If anyone disagrees with me, please speak.

 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Measure 330V ac with microcontroller
« Reply #4 on: July 20, 2014, 04:37:42 pm »
When I suggested an HRC fuse I was thinking of two things:

1) The input protection circuits of all those Fluke meters that we've seen on teardowns (thanks Dave). It's wise to copy these techniques as the boys and girls at Fluke seem to know what they're doing.

2) The way that an HRC fuse ruptures when subjected to an overload, it does not arc internally and the break in current is clean and quick.

After posting I had a thought, would a capacitive divider be safer than one based on resistors?
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: Measure 330V ac with microcontroller
« Reply #5 on: July 20, 2014, 06:59:47 pm »
No safer, you can just as easily exceed the voltage ratings on a capacitor, and a resistor can have a very high voltage rating in a relatively small size, along with the possibility of you using multiple units in series to reduce the voltage stress per unit.
 

Offline electronics man

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: Measure 330V ac with microcontroller
« Reply #6 on: July 21, 2014, 10:33:33 am »
Maybe use a neon tube or a MOV on the input to keep the voltage within range
follow me on twitter @get_your_byte
 

Offline ConKbot

  • Super Contributor
  • ***
  • Posts: 1398
Re: Measure 330V ac with microcontroller
« Reply #7 on: July 21, 2014, 05:23:44 pm »
When I suggested an HRC fuse I was thinking of two things:

1) The input protection circuits of all those Fluke meters that we've seen on teardowns (thanks Dave). It's wise to copy these techniques as the boys and girls at Fluke seem to know what they're doing.

2) The way that an HRC fuse ruptures when subjected to an overload, it does not arc internally and the break in current is clean and quick.

After posting I had a thought, would a capacitive divider be safer than one based on resistors?
1)The flukes have HRC fuses on the current shunts for when you brain fart, and put the probes across the bus in home load center with it in current mode it doesnt explode in your hands.  The voltage inputs have MOV's and PTCs for input protection.  Check out a teardown of the meters without current measuring (I think one of the fluke datalogging wireless ones was like that?)

2) It does arc internally, its just obscured and then suppressed by the fiber jacket and sand filling.  Any standard/fast blow fuse should be clean and quick.  Nothing else in your house will have HRC fuses, as the breaker/load center provides the 15/30/whatever-is-relevant-in-your-area KA load breaking capacity.

If this whole widget is floating at mains, then dont bother with isolation, as it is obviously irrelevant.  If it isnt then obviously isolation would be a good thing.  depending on cost/space, the analog optocoupler may work well, or an isolation amplifier, or put an ADC on the hot side and run the digital signals back over a digital isolator.  Or if this is a one off, get a small transformer and calibrate that and use it as a potential transformer.

http://www.digikey.com/product-detail/en/3FD-212/MT2101-ND/98294

at $5.25 each, its about the same price as an analog opto, iso amp, or dac/digital isolator.  If your item is mains powered and you have an onboard transformer, monitor that instead, but mind your grounds as there is sure to be a diode in the path somewhere.
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Measure 330V ac with microcontroller
« Reply #8 on: July 21, 2014, 08:22:09 pm »
Well, we have all had a brain fart once in a while, my last one came when I put a meter switched to the ohms range across some 220V terminals. The meter survived and my only clue that something was wrong was that the meter display kept fading out as I applied the probes.  :-DMM

This is why cheap multimeters are a very bad investment.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline A2Topic starter

  • Contributor
  • Posts: 44
Re: Measure 330V ac with microcontroller
« Reply #9 on: July 23, 2014, 07:13:57 am »
Hi I have made some circuit & did some simulation. Only place I am stuck now is selection of capacitor which would act
as low pass filter as system will be bit noisy. (as on page 6 of attached pdf)

I have attached my simulation results in a pdf file. (Move right clockwise the pdf once)
Originally mu circuit will have 330V ac rms & 50Hz. But for simualion I taken 1Hz.


1. First page: It is the actual circuit which I will be used. It will divide the 330V ac & used 5V for dc offsetting by reistor divider.

2. Second page: I have applied superposition theorem. I have removed 5V dc source i.e ground it.
   Equivalent voltage comes out to 1.774V ac rms i.e circuit forms a voltage divider of 1850K: 10K
   
3. Third page: I have applied superposition theorem. I have removed 330 ac source i.e ground it.
   Equivalent voltage comes out to 2.487 dc i.e circuit forms a voltage divider of 20K: 19.79K
   
4. Fourth page: TO measurement thevenin resistance at adc pin, I have grounded all other voltage sources. & checked thevenin resistance
   comes out to be 9.946K or 10K approx.

5. Fifth page: Shows the equivalent circuit diagram when 330V ac rms is applied.
   Divided ac signal is riding over dc voltage with thevenin resistance.
            
6. Sixth page: Now since circuit will be bit noisy. so I want to place a small capacitor so that it act as low pass filter.
               So that ripple from dc source is grounded.
   But i don't know how it will react. What phase shift it will introduce?
   Will it affect the ac waveform shape?
   Don't know if its correct to place capacitor here or not?

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf