ac switch?

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As an input I have a AC signal with a range of 0-220VAC.
I just want to make a simple switch to know whether the AC is on/off
off = 0-10VAC
grey area = 10.1-19.9VAC
on = 20VAC and above

I was thinking of using a photocoupler (PS2705-1) for this but I have been making the calculations and I will be highly dependent on the current transfer ratio (which has quite a big range, 50%-300%). I plan to make more than ten of these and I dont like to recalculate resistor values for each piece

Aside from buying a tight range photocoupler, what else could I use?

EDIT: added attachment of schematic.
there are three resistors in the input because I only have 1/4W resistors here.
schematic shows 4N35 but i plan to use PS2705-1

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might want to look at Fairchild Semi's FSAR001B. I havent looked too closely at the chip, but many years ago I did a circuit similar to what you want using two transistors, a high voltage mosfet, a zener and a couple of resistors to implement a universal dc/ac input. You could input DC from 0..32V and AC from 12V to 240V and it would use a technique like the FSAR001 uses to chop the AC waveform.
Basically the circuit used a zener diode as the voltage reference. When the instantaneous AC voltage exceeded the zener voltage it would turn the mosfet off. When the voltage dropped below, the mosfet would turn on. Therefore the load (optocoupler) would never see a voltage beyond that of the zener. Because the mosfet did the switching, it is lossless.

Note a 'simple' solution, but the parts are cheap.

You could also look at using a capacitor for a reactive droppper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding your circuit - you need a diode across the opto led to protect it. The reverse voltage of leds is only around 5V. Beyond that they will die in time.
Putting two zeners in series (one each way)will give you a more defined switching point.

It is generally wise to use a number of resistors in a high voltage circuit. Apart from power disipation, resistors also have a voltage rating. A lone 1/4w resistor will die in time from overvoltage. Using a number of them avoid this. Or use a properly rated resistor.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, when dealing with 220 VAC it is often wise to start with a transformer unless you have a good reason not to.

This drops the voltage down to levels useful for present day circuitry designs, and provides electrical isolation from the Mains supply.

If you use a small power supply transformer, say 230:12 V, CT (Center tapped), then ignore the 12 V output and use the center tap and one end you have a 6V AC output.

This is still too high for 5V logic, so drop it through a resistive divider to get something smaller.

Now either AC couple it to an op amp, or DC couple it to an op-amp set up as an adder to add in a DC offset to raise the AC to the mid-point of the supply.

The gain doesn't really matter too much. You want it set up so that 20 VAC, attenuated, then gained, is in the linear range of the op-amp.

The 0-10 VAC is now also within the linear range.

Anything over perhaps 30 VAC will saturate the op-amp to the rail, which for this purpose doesn't matter at all.

The output now feeds a "window" comparator, made from the remaining op-amps on the chip selected. Perhaps just two comparators instead of a window detector.

V <= 10 output. V<= 20 output. Neither of the above is then V > 20.

This circuit would give you pulses with each cycle of the power supply. Not an issue if a micro is sampling the circuit and storing the input status for the Main program.

One could, however, do more in the analog front end, either a sample and hold or a "detector", (RC filter); but these days that is usually done in software, especially for such a low frequency signal (50/60 Hz), which I presume this is.

This is a lot of parts, but with 1% resistors it can be "calibrationless".

If you are only building 10 units it might be easier to put a pot in the circuit, using the optos, and tweak each PCB manually. Then put a dab of glue on the pot.
This is certainly less expensive that transformers, and still gives you isolation.

The opto will also give you pulses outputs.

An ADC can easily track the output in an ISR and again set a value for the Main program to use, Valid, Undefined, High.

Many of the micros also have an analog comparator which could also be used, once the signal is isolated and attenuated and the "negative" voltage is blocked or offset, (recall that AVRs DON'T like negative voltage on their input pins!).

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to have the isolation, so I dont think I will go with the ac-dc linear regulator.

I hope to have minimal components, so if I could I would like to avoid transformers.

Browsing around fairchild semi's site, this seems a better part than the one i have initially found http://www.fairchildsemi.com/pf/...

I think I like the idea of a pot.
So, if I want isolation and if I am going from AC to DC, then it is either a photocoupler or a transformer?

Is there a better circuit config for the photocoupler? One that will not be much dependent on the current transfer ratio of the part?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, another option is to skip all the op-amp stuff and go digital.

Use a simple diode to R-Zener voltage regulator, with a cap across the zener, (or similar).

Use this to power a Tiny. The Tiny measures the incoming voltage via a resistive divider and its ADC.

The Tiny outputs a digital signal via the opto-coupler. This could be a USART driving the opto, sending data packets, or it could be frequency modulated, or pulse width modulated, etc.

For example, < 10 V: 500 Hz square wave output.
10-20 V: 750 Hz output.
> 20 V: 1000 Hz output.

Two items to be aware of:

The Tiny sits on the incoming power supply, it is NOT isolated. This may or may not be a problem.

The 0-10 V input range is problematic for this method, as the input is what is powering the Tiny and the LED inside the opto-coupler.

If No output signal is acceptable to indicate 0-10 V, and the Tiny only outputs a signal for 10- 20 V, and > 20 V then this method works.

This is essentially calibrationless, which is an advantage.

If you have not worked on "live" circuitry before and you elect to go this route then say so, and perhaps you will get safety some pointers.

For example:

Keep one hand in your pocket when probing the circuit.

Use a battery powered O'scope, or one designed for testing Mains supplies, or you can inadvertently fry your scope's front end.

Be careful how you keep fingers from touching live parts of the circuitry when it is done, and put in a case. A "Caution! High Voltage Inside!" sticker is helpful, as is potting the entire high voltage section. What you do depends upon who is likely, (or even unlikely), to be tinkering with the device in the future.

Keeping the two "halves" of the circuit physically separated on the PCB.

etc.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the pointers. I have tried to avoid mains as much as possible. I am a wuss who likes small voltages. This is why I would like isolation as much as possible.
Haven't digested what you said, will try to simulate this first...