Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Connecting 240V live mains to PIC microcontroller safely

Status
Not open for further replies.

arisu1love

Newbie level 5
Newbie level 5
Joined
Nov 15, 2010
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,343
Hi,

For my project, I need to connect a 240V mains live connection wire to a PIC input pin to detect the zero crossing of the sinusoidal waveform. Is there a safe way to do the connection since it is 240V?
 

also the signal must be full wave rectified as the micro-controller will not recognise negative voltages!
 

use a diode to clip the negative half then feed this to optocoupler (dont forget to use resistor). Now you can interface it with ucontroller. That is all.
 

Microchip has documented this pretty well in their application note for X10 home automation : **broken link removed**

Although it's not isolated, its pretty good.
 
If you are using a linear power supply for your PIC then you can use the low voltage AC on the secondary of the transformer.
This will not require an opto-isolator, just a resistor to a zenner diode. The zenner will clamp the positive half cycles and remove the negative half cycles. You can add a small capacitor to avoid spurious transitions.
You do NOT need to use full-wave rectified AC, but if you do, remember that the frequency will be doubled.
 

Hi, connect IO through 1M resistor to 240VAC directly, it is OK for MCU since there are 2 diodes built inside, which can limit the voltage at IO from -0.7 to VDD+0.7, however, the system is hot, and can not touch directly.
it is a wide use solution, let me know any doubts.
 

better use a comparator & get directly a sqare wave
 

Use IN4007 and 33k and feed to opto-coupler(CYN17 or 4N35) the output of the opto-coupler is DC level <=5.0V

Remember this should be live wire. If you reverse the connection the Opto-Coupler is no more :(

Thankyou
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top