Isolation

The voltage and current sensors detailed above give us voltage outputs that are in a safe range but there is always danger with things that are connected directly to the mains wiring from the effect of power surges, shorts, miswiring or other unexpected effects, without isolation a surge could travel through to the computer causing some severe damage!

So we protect the electronics, computer and ourselves from the dangers of mains electricity with some clever chips called optoisolators. I have used the Avago Technologies HCPL-7520 linear optoisolator chips recommended by the Cornell PowerBox guys. There are two of these one for the current signal and one for the voltage signal:

An optoisolator transfers a signal optically from one electronic circuit to another. The circuits are therefore isolated electricaly. The HCPL-7520 allows us to isolate the sensor electronics from the Arduino electronics, but it also does a host of other useful things.

The next stage in the circuit is the Ardunio microcontroller board. The main requirment that is of concern here is that it requires an input signal voltage of between 0 and 5V. We want to use this whole range for reasons that I will outline below, we want our maximum voltage and current values to correspond to 5V.

Our input voltage to the HCPL-7520 alternates between max values of -0.256 and +0.256 Volts, the Ardunio detailed below however requires a voltage that is always positive. A useful feature of the HCPL-7520 is that it allows us to bias the output signal of the chip. This bias value is determined by Vref / 2, our Vref is 5V and therefore we will be biasing the output voltage by 2.5V. 2.5V is now effectively the 0V of the input voltage. The HCPL-7520 also allows us to amplify the input signal, this is called gain and is given by the Vref / 0.512. With the biasing and amplification our output signal will now be 0V when the input signal is -0.256V and 5V when our input signal is +0.256V.

Important: The HCPL-7520 opto isolators require two separate power supplies one for the HIGH side (the side connected to the mains wiring) and the other for the LOW side (the Arduino side). I used the Arduino for power on the LOW side and a 5V DC adaptor I had spare on the HIGH side. Note that both grounds are also separate. 

The picture above doesnt make this very clear, have a look on the circuit schematic to see it more clearly.

Datasheet from farnell: HCPL-7520

AttachmentSize
isolation.JPG164.83 KB
ansha's picture

Re: Isolation

hello!!!

i have few questions regarding power box project by students of cornell university

1. in the calculation of gain, why Vref is divided by 0.512?

2. can we replace HCPL 7520 by any other optoisolator? if yes then please name it

3. can we replace 0.2 ohm current sensing resistor by potentiometer?

4. can we replace solid state relay S216S02 by any other SSR? if yes then please name it

5. what changes in calculation should be done if the input volatge is 230V?

please reply

thank you

a newbie's picture

Re: Isolation

During 1st experiment, i connect the HIGH side and LOW side with same power supply, and i measure with oscilloscope, it blown my HCPL 7250

Now i have seperated the power supply at HIGH side and LOW side, and it is work. It come out with SINEWAVE waveform, but it is incorrect from the formula.

In voltage sense, i stepdown my 340Vpeak voltage to 0.15Vpeak. According the formula "Vin = 0.512 / 5VRef ( Vout - 5VRef / 2)" from the cornell guy website, hence my Vout should be 3.96Vpeak, but measure by oscilloscope, i get the Vout is 2Vpeak. In cornell website, i found that the 120Vrms is 170 V Peak-to-Peak, and in your voltage sensing u write the 240Vrms is 340Vpeak, and i wonder the 240Vrms is 340 Vpeak-to-peak or 340 Vpeak?

Thank for the http://openenergymonitor.org/emon/node/58, but im using PIC16F877A as my microcontroller, could it difference compare with Arduino? and the hardware part is suitable for my PIC16F877A? Sorry 2 bring so much of question for u...

TrystanLea's picture

Re: Isolation

Hey, 120Vrms is 170V peak. So 240Vrms gives a peak of 340V. Vout 2Vpeak -2.5V bias  corresponds to a Vin of 0.205Vpeak...

the hardware for http://openenergymonitor.org/emon/node/58 should work fine with the PIC, you would just need to adapt the firmware a bit.

a newbie's picture

Re: Isolation

Yea it would be much easier and hassle-free if i use the arduino board to get the values but i am trying to do using a microcontroller. Based on ur reply, i just have to separate the supplies and grounds of both the high and low voltage side respectively. If not, i am guessing my circuit would short circuit and blow up? Haha.

TrystanLea's picture

Re: Isolation

I dont think it would short circuit, but you certainly would have no isolation.

Im not sure if I was clear when I say supplies I mean power supply consisting of 5V and GND.  

so you need one supply for the high side and one separate supply for the low side

Does that make sense?

a newbie's picture

Re: Isolation

I have questions regarding ur circuit. Can the grounds and VDD of the TWO High Voltage HCPL-7520's be shared or is it separated?
Do u know what is the equation to calculate to input voltage of the HCPL-7520? If u do, can u pls post it up for me. I am sry to ask these questions as I am very new in this field.

TrystanLea's picture

Re: Isolation

Its ok to connect the VDD and GND of the HCPL's on the high side. As long as the HIGH side is separate from the LOW side that's the main thing. I detail some how to calculate input voltages in the voltage and current section. Is there anything there I can clarify? If your quite new to this field I recommend going for the Mains AC: non invasive energy monitor here, its both simpler and safer and I will be able to help you more on it as It has been a while since I have worked on this version with the HCPL's. 

Jesper Gravgaaard's picture

Re: Isolation

Thank you for a great home page about a great project!

I have been planning to make a copy of your unit for my own Arduino. One part of your design is however not completely clear to me.

As far as I can see you should use different power supplies for the HIGH and LOW side of the HCPL-7520 to achieve proper isolation.

Where do you get your 5V power for VDD1/GND1 from?

I believe the PowerBox guys used a seperate power supply for this - but I wonder if you are doing something else?

Kind regards,

Jesper Gravgaard

TrystanLea's picture

Re: Isolation

Hello Jesper Gravgaard, Thanks for highlighting this. The description should have been a lot clearer.

Yes you do need to use two separate power supplies one for the HIGH side and the other for the LOW side. I used the Arduino for power on the LOW side and a 5V DC adaptor I had spare on the HIGH side (for VDD1/GND1). Both grounds are also separate The picture above was taken before I soldered in the 5V DC adaptor wires to the high side.

I will update the page to make it clearer now.

Thanks

Trystan

Anna's picture

Re: Isolation

Hi Trystan,

Sorry for the bother, but i have another question, when i connect up the circuit (I using an open current sense which is basically a metal strip of 0.025ohm (bought from RS components)and when i run your arduino sketch (the updated one) the values for everythign except voltage come as zero and the value for voltage is around 40 ... how come??

Thanks so much for the help
Anna