Maker Pro
Maker Pro

How to make a mains detection unit using an optocoupler

EES2017

Mar 17, 2017
1
Joined
Mar 17, 2017
Messages
1
For an engineering project we need to make a mains detection circuit to detect our mains input and send a signal to a microprocessor. I need to know whether it should be contact or non contact and what other parts i'll require
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Starting with an optocoupler in mind is a good idea as it will provide potential isolation and thus is a major step in ensuring safety.

Here's an exemplary circuit.
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
Are you looking for a circuit to be added to a pc board design, or a stand alone unit? If you think about it, any cell phone charger or other low voltage power supply is a mains detection unit.

For an on-board design or if you want to detect loss-of-mains very rapidly, that is a bit more work. For isolation, start with either a small power transformer or an optical coupler. The transformer can be either a standard small power transformer or a current transformer that has one of the mains leads fed through it. A standard transformer is larger, but the output voltage does not vary with the mains current going somewhere else.

These will give you a sine or square wave output proportional to the mains voltage or current. What happens next depends on what aspect of the mains you are testing for.

ak
 

Externet

Aug 24, 2009
891
Joined
Aug 24, 2009
Messages
891
Done that, and as I was unable to find it on the market, took :
- 1 phototransistor
- 1 neon bulb
- 1 resistor for the bulb
- superglued together and
- wrapped in black shrink tubing.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
For an engineering project we need to make a mains detection circuit to detect our mains input and send a signal to a microprocessor. I need to know whether it should be contact or non contact and what other parts i'll require

Also check out Fairchild App note AN3006 and Microchip AN958.
M.
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Years ago I used Externet's post #4 method, except that I used an LDR instead of a phototransistor.
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
Alot will depend on the nature of the detection required?
Simply the presence or not, or zero crossing or random phase etc.
M.
 
Top