I'm trying to make a device that can sense 230VAC pulses coming from signal wires from light switches around the house. I just need to detect the presence of 230VAC in the wire, so i opted to by a couple of LTV-814A's to do the job.
I just need a little kick start on how you would make sure the DC signal is stable on the other side of the optocoupler. The DC signal 3.3v wire can stay as a digital "HIGH" when the mains zero cross, or will this not be a problem at all. To finish of the question i may add that there are no load really on the signal wires.
I'm aware of the dangers of 230V. My brother is an electrician and we do this little project together, and we of course are going to make everything metal is properly insulated and inside a closed circuit box.
A small value capacitor will smooth out the pulses. However, showing a schematic of how you are wiring the device into the AC circuit would give me a little more confidence in what you are doing. In particular, how are you limiting the AC current to the device to less than 50ma? And how are providing for cooling the device?
Paul_KD7HB:
A small value capacitor will smooth out the pulses. However, showing a schematic of how you are wiring the device into the AC circuit would give me a little more confidence in what you are doing. In particular, how are you limiting the AC current to the device to less than 50ma? And how are providing for cooling the device?
Paul
Well, what we plan on doing is having the signalling wire go into the optocoupler as the only load, and then hook up a neutral to the other end. The signal comes from a live wire inside the light switch. So there shouldn't be anything that could pull more amps than the optocoupler accepts, or am I completely off track?
Sorry I can't show schematic as i don't know how to draw such a thing on the computer.
nohns:
Well, what we plan on doing is having the signalling wire go into the optocoupler as the only load, and then hook up a neutral to the other end. The signal comes from a live wire inside the light switch. So there shouldn't be anything that could pull more amps than the optocoupler accepts, or am I completely off track?
Sorry I can't show schematic as i don't know how to draw such a thing on the computer.
Draw the schematic on paper and scan or photograph and post on a reply.
Well the optocoupler will act as a dead short unless the current is limited to the value in the data sheet. So some resistors are in order to make that limit. And the peak voltage of the AC is 1.414 times the RMS value of 230 volts.
To reduce the current to 50mA for the opto coupler input you will need to put a 4700 Ohm resistor in series, that resistor will dissipate 11.5 Watts, to keep it from getting overly hot, you should use a 25 Watt resistor, though it will still get pretty warm.
outsider:
To reduce the current to 50mA for the opto coupler input you will need to put a 4700 Ohm resistor in series, that resistor will dissipate 11.5 Watts, to keep it from getting overly hot, you should use a 25 Watt resistor, though it will still get pretty warm.
Thanks, outsider. You're using Ohm's law here right?
Paul_KD7HB:
Draw the schematic on paper and scan or photograph and post on a reply.
Well the optocoupler will act as a dead short unless the current is limited to the value in the data sheet. So some resistors are in order to make that limit. And the peak voltage of the AC is 1.414 times the RMS value of 230 volts.
Paul
Here is the supposed circuit, I could use, with the properly inserted resistor. How do I reduce the huge peak in voltage at the start of the pulse? Capacitors?
Why 50mA. That's the absolute max value of most opto couplers.
You shouldn't go anywhere near that. And you don't have to.
If you use the internal pull up of an Arduino pin, then you can drop that pin voltage with ~250uA current.
An opto LED current of 0.5-1mA is more than enough to sink that pin current to ground with the opto transistor.
I would connect the opto transistor between pin and ground, with internal pull up enabled in pinMode.
And add a 100n cap, also from pin to ground, to bridge zero crossings.
And use two 100k/1/4watt current limiting resistors in series (for safety) for the opto LED.
(most common resistors can't withstand 230AC for a long time)
That could be 100k in the phase line and 100k in the neutral line (safer if the board's polarity can be swapped).
Leo..
Didn't think he would swallow that 25W resistor stuffed into a wall box. Oh well.
Was not a suggestion, was trying to show him what's involved in dropping 230V to 1.2,
sorry for any confusion.
That's not how to do it - you use a capacitive dropper for this sort of application, backed up by a fusible
resistor in case the capacitor fails. The capacitor needs to be mains rated safety capacitor.
[ Of course getting your insurance company to pay up if you burn down the house is another matter if you attach to the mains directly and get it wrong - much better to use a non-contact method like a CT if not confident of what you are doing. ]
Wawa:
Why 50mA. That's the absolute max value of most opto couplers.
You shouldn't go anywhere near that. And you don't have to.
If you use the internal pull up of an Arduino pin, then you can drop that pin voltage with ~250uA current.
An opto LED current of 0.5-1mA is more than enough to sink that pin current to ground with the opto transistor.
I would connect the opto transistor between pin and ground, with internal pull up enabled in pinMode.
And add a 100n cap, also from pin to ground, to bridge zero crossings.
And use two 100k/1/4watt current limiting resistors in series (for safety) for the opto LED.
(most common resistors can't withstand 230AC for a long time)
That could be 100k in the phase line and 100k in the neutral line (safer if the board's polarity can be swapped).
Leo..
So you're saying that two 1/4 watt 100k resistors is enough for this job? Can they really carry 230v without getting really hot?
MarkT:
That's not how to do it - you use a capacitive dropper for this sort of application, backed up by a fusible
resistor in case the capacitor fails. The capacitor needs to be mains rated safety capacitor.
[ Of course getting your insurance company to pay up if you burn down the house is another matter if you attach to the mains directly and get it wrong - much better to use a non-contact method like a CT if not confident of what you are doing. ]
So I shouldn't really use an optocoupler for this application? What other situation would you wish to use such an optocoupler then? How do i build a "Capacitive dropper"?
nohns:
So you're saying that two 1/4 watt 100k resistors is enough for this job?
Can they really carry 230v without getting really hot?
So I shouldn't really use an optocoupler for this application? What other situation would you wish to use such an optocoupler then? How do i build a "Capacitive dropper"?
Yes, the opto transistor only has to switch a tiny amount of current.
The opto LED can do that with a tiny amount of light.
Heat is voltage times current. Less current is less heat.
Two 100k resistors in series draw 230/200k= 1.15mA, and use ~0.26watt (0.13watt each).
A temp rise of maybe 20C above ambient if you use common 1/4watt resistors.
IMHO not worth building a (more dangerous) capacitive supply for that ~1mA load.
Leo..
Wawa:
Yes, the opto transistor only has to switch a tiny amount of current.
The opto LED can do that with a tiny amount of light.
Heat is voltage times current. Less current is less heat.
Two 100k resistors in series draw 230/200k= 1.15mA, and use ~0.26watt (0.13watt each).
A temp rise of maybe 20C above ambient if you use common 1/4watt resistors.
IMHO not worth building a (more dangerous) capacitive supply for that ~1mA load.
Leo..
Okay thanks! I will try building the circuit and return to this topic with the result