230V A.C. mains detection issue, GPIO not stable and false detection due to noise

Thread Starter

red_apple2009

Joined May 10, 2013
1
Hi,
My application is to detect the AC voltage presence using Continuous high or low signal.
I am Getting Same issue with TCA6424A, MSP430F167, Atmega328P and ESP8266
I am using a Non-Isolated power supply with 120mV Vp-p as supply.
Circuit is as shown below where I need GPIO continuous Hi or Low

With this when voltage detected it is not going to zero instead it is somewhere around 0.6-1.2v

And sometimes there is a noise on IO which is Reaching Vp-p as much as 32V as shown below

I Tried Below circuits , with TVS

The 34v noise clamped and I am only getting Ripple of 0.4-0.6v at AC Presence
When I used Schottky arrangement of GPIO As shown below 34v noise clamped but ripple was 0.8-1.2v

now my question is which arrangement is better for my GPIO stability?
TVS of Schottky configuration? Because rise time of noise is less than 10nS. even TVS is giving better performance I am not sure will it sustain those type of continuous noise!
And controller is stucking / not responding when I get this noise or sometimes giving random AC detection signals. but with TVS/ schottky arrangement its not happening but when The GPIO state is above 1v instead of ground Its false triggering like detecting high even there is AC present. is there any way I can make this low level to 0V or less than 200mV.
Can I know what type of noise it is? and its source
 

Attachments

Picbuster

Joined Dec 2, 2013
1,047
Hi,
My application is to detect the AC voltage presence using Continuous high or low signal.
I am Getting Same issue with TCA6424A, MSP430F167, Atmega328P and ESP8266
I am using a Non-Isolated power supply with 120mV Vp-p as supply.
Circuit is as shown below where I need GPIO continuous Hi or Low

With this when voltage detected it is not going to zero instead it is somewhere around 0.6-1.2v

And sometimes there is a noise on IO which is Reaching Vp-p as much as 32V as shown below

I Tried Below circuits , with TVS

The 34v noise clamped and I am only getting Ripple of 0.4-0.6v at AC Presence
When I used Schottky arrangement of GPIO As shown below 34v noise clamped but ripple was 0.8-1.2v

now my question is which arrangement is better for my GPIO stability?
TVS of Schottky configuration? Because rise time of noise is less than 10nS. even TVS is giving better performance I am not sure will it sustain those type of continuous noise!
And controller is stucking / not responding when I get this noise or sometimes giving random AC detection signals. but with TVS/ schottky arrangement its not happening but when The GPIO state is above 1v instead of ground Its false triggering like detecting high even there is AC present. is there any way I can make this low level to 0V or less than 200mV.
Can I know what type of noise it is? and its source
Use the opto circuit and solve result in software;
use interrupt trigger change from low to high ( could detect false spikes)
or
monitor line and when high for one 1/2 period time declare as valid high.
same for low declare as valid low.

Picbuster
 

Irving

Joined Jan 30, 2016
3,845
Never use a non-isolated supply, always have an isolation barrier between your mains supply and your gpio input.

Use the opto-isolator as shown to detect zero crossing to drive an interrupt, resetting a 40mS timer, which is configured to generate an interrupt itself on timeout. When the zero crossing detected set a global AC_on flag. When the timer interrupts, clear the global flag.

If you want an actual gpio hardware input, configure a 555 timer as a monostable with a 40mS timeout. The zero-crossing output is connected to trigger it, giving a high output. When AC lost the output goes low.
 
Top