PDA

View Full Version : How to detect Line Voltage



Ioannis
- 17th January 2012, 11:18
I wonder if there is a opto or similar device to detect the presence of 240VAC with isolation.

The first that came to mind was to use an opto isolator with a capacitor and a diode, but thought it may exist something more compact.

I want to check the state of room thermostat that supplies line voltage with the PIC input.

Ioannis

HenrikOlsson
- 17th January 2012, 11:55
Hi,
There are optoisolators with two LEDs connected antiparallell to each other. With one of those a couple of resistors would be all that is needed. Make sure the resistors can handle the peak voltage across them!

Ioannis
- 17th January 2012, 12:03
Thanks Henrik. It is the heat from the resistor that I am concerned. Of course SMD need more care in the selection.

Ioannis

Acetronics2
- 17th January 2012, 12:25
Hi, Ioannis

as far as you do not measure mains, you can use a capacitor in series to reduce resistor dissipation ( resistor is just here to limit the current peak @ power on )

http://www.esr.co.uk/manuals/mk181.pdf

you also can try a neon bulb and a LDR or photodiode ... placed into a black shrinkable " tube"

Alain

Ioannis
- 17th January 2012, 13:59
Thanks Alain. That was my first thought, to use a capacitor, but want to avoid it as it is large and costly.

This is going for a production device, so all matter.

Maybe I will find a low current opto and just use large enough resistors.

Will see.

Ioannis

ardhuru
- 17th January 2012, 15:00
Hi Ionnis,

There doesnt have to be too much heat dissipation. An opto like what Henrik suggested (my favourite in that category is PC814/817 for its compact 4 pin dip package) would need about 100K in series with mains. So, this resistor would dissipate slightly over half a watt; a 1 watt resistor should do fine.

Also, you arent interested in any timing issues here, just the presence or absense of the signal. So, you can afford to have a slower changing waveform per cycle on the opto's output. In which case, you can increase the 100K further, perhaps right upto 220K, to reduce the dissipation even further.

And, if you use an opto with just one diode, your series resistor would heat up even less.

Regards,

Anand Dhuru

HenrikOlsson
- 17th January 2012, 15:40
And, if you use an opto with just one diode, your series resistor would heat up even less
Nah, be careful there. In that case you'll need an external diode across the LED in the isolator since the LED can only take a couple of volts (6V for the PC817) in the reverse direction and then the current going thru that diode will have to go thru the resistor(s) as well. That's the main reason I suggested the dual LED isolator.

If the PIC is isolated you could live with a voltage divider and a zener and then direct to the PIC input.

/Henrik.

Ioannis
- 17th January 2012, 15:46
Anand: I have to make an extended research for the opto coupler that need the less current.

Henrik: unfortunately it will not be isolated. The voltage divider would be a good option in that case.

The other idea would be to use a small(?) relay with coil directly made for line voltage. But regarding the wasted power, it would be not so good one.

Ioannis

dhouston
- 17th January 2012, 16:40
Here is a schematic (http://www.discovercircuits.com/DJ-Circuits/zerocross3.htm).

Dave
- 17th January 2012, 18:17
I would use a single led opto rather than a dual and put a 1N4004 diode and appropriate resistor in series with it.