Author Topic: Detecting AC signal  (Read 15514 times)

0 Members and 1 Guest are viewing this topic.

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Detecting AC signal
« Reply #25 on: July 03, 2014, 03:52:13 am »
Hi,

Here is an other possibility, its a zero crossing detector made with generic parts.

http://www.dextrel.net/diyzerocrosser.htm

Or you could also replace the existing switch with a wireless one.
 

Offline nsayer

  • Regular Contributor
  • *
  • Posts: 133
  • Country: us
    • Geppetto Elecronics
Re: Detecting AC signal
« Reply #26 on: July 05, 2014, 08:27:45 pm »
I took a fresh look at the optoisolator category. I've discovered the LTV-824. It's a tenth the price and can serve the same purpose adequately. The only real gotcha is that it's not an intentionally slow transistor like in the MID-400, which means your controller would have to poll for a millisecond or so to insure it doesn't mistake a zero crossing for absence of voltage.
Buy my stuff!! It's not at all terrible!! http://tindie.geppettoelectronics.com/
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2797
  • Country: au
Re: Detecting AC signal
« Reply #27 on: July 05, 2014, 09:28:02 pm »
I took a fresh look at the optoisolator category. I've discovered the LTV-824. It's a tenth the price and can serve the same purpose adequately. The only real gotcha is that it's not an intentionally slow transistor like in the MID-400, which means your controller would have to poll for a millisecond or so to insure it doesn't mistake a zero crossing for absence of voltage.

You can also use the (pulsing) opto output to trigger an interrupt on the micro each AC half period.  In the interrupt routine you set a variable to the small number.  As part of a timer interrupt (say 10ms) you decrement the same variable (but only if > 0).

Assuming 50Hz mains, you'd have the zero-cross interrupt (pre)setting the variable every 10ms (half cycle).  If the pulses stop coming in, the timer interrupt will hit zero (after n * 10ms).  At that point you trigger the "off" state.

The "on" state can be triggered in the zero-cross interrupt after checking that you're not already in the "on" state.

There's other ways to do it of course and you can refine it to give control over the AC detection and absence times.
 

Offline mij59

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: nl
Re: Detecting AC signal
« Reply #28 on: July 06, 2014, 03:06:44 am »
I took a fresh look at the optoisolator category. I've discovered the LTV-824. It's a tenth the price and can serve the same purpose adequately. The only real gotcha is that it's not an intentionally slow transistor like in the MID-400, which means your controller would have to poll for a millisecond or so to insure it doesn't mistake a zero crossing for absence of voltage.

Use a pullup resistor and capacitor network with a time big time constant (1 second or so), use the output of the optocoupler to discharge the capacitor.
The capacitor voltage will stay "low" as long as the ac signal is present.
Use a comparotor  to detect if the capacitor voltage is "high" or "low".
 

Offline sunnyhighway

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: nl
Re: Detecting AC signal
« Reply #29 on: July 06, 2014, 01:41:39 pm »
You could build your own optoisolator using a neon signal light and an LDR or photodiode or phototransistor.
 

Offline nsayer

  • Regular Contributor
  • *
  • Posts: 133
  • Country: us
    • Geppetto Elecronics
Re: Detecting AC signal
« Reply #30 on: July 08, 2014, 07:58:03 pm »
Use a pullup resistor and capacitor network with a time big time constant (1 second or so), use the output of the optocoupler to discharge the capacitor.
The capacitor voltage will stay "low" as long as the ac signal is present.
Use a comparotor  to detect if the capacitor voltage is "high" or "low".

Software is cheaper.  8)

It turns out that a little brainstorming has led us/me to a simple circuit that does a few things for the OpenEVSE II board set. The circuit is a pair of S1M diodes from each hot line (240 VAC here in North America is delivered with a center-tapped ground reference, so each hot line is 120 VAC to ground/neutral, and each is 240 volts away from the other - because it's 180 degrees out-of-phase), wired with the anode to the respective hot line and the cathodes tied together. The common cathode line goes into a series resistor, into the anode of the LED part of the opto and then to ground (and ground specifically - not neutral like you might expect).

This circuit allows the controller to verify that a low impedance path to ground exists, and also for it to detect whether one or the other of the hot lines is actually a neutral line. The controller's own digital input pins will provide the thresholding (it doesn't have to be terribly accurate). If you don't see the line go low at least once within 10 ms or so, then that's a ground failure. If you watch it transition three times and time how long it spends low and how long it spends high, then if it's high longer (meaning the zero-crossing time plus a half-cycle), that means that one of the "hot" lines is a neutral. If it's low longer (meaning that the only high period will be near zero-crossing), that means that both of them are hot.

The diodes insure that you can't get a false-negative on the ground failure test by cross-conducting from one hot to the other.
Buy my stuff!! It's not at all terrible!! http://tindie.geppettoelectronics.com/
 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 349
Re: Detecting AC signal
« Reply #31 on: July 08, 2014, 09:08:30 pm »
people could rightly be annoyed if you put current into the safety gnd

don't have the standards in front of me but I recall ~1 mA is a limit for leakage current in consumer line equipment - you need to run your opto led  lower than that


here: http://www.chromausa.com/pdf/app-notes/AN%20-%20Leakage%20Current%20Part%20I%20-%2003252013.pdf

the 5 mA "permenantly attached power" means hard wired by an electrician from your equipment into a mains box

so you need to run with less than 0.5 mA with a 3 prong plug cord that goes to a regular gnded wall socket
« Last Edit: July 08, 2014, 09:11:58 pm by f5r5e5d »
 

Offline nsayer

  • Regular Contributor
  • *
  • Posts: 133
  • Country: us
    • Geppetto Elecronics
Re: Detecting AC signal
« Reply #32 on: July 08, 2014, 10:27:14 pm »
That's about how much we're talking about, except that it's (most likely) a 240 volt outlet, like a NEMA 6-50 or L6-30 rather than a 5-15.

There's a chicken-and-egg problem at work. The spec requires us to test the safety ground to make sure it's present and effective. But you can't *do* that without tickling it.
Buy my stuff!! It's not at all terrible!! http://tindie.geppettoelectronics.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf