0
Offline
Full Member
Karma: 0
Posts: 128
|
 |
« on: March 21, 2012, 06:23:02 am » |
I am trying to determine is an AC water pump is running or not with an Arduino. The pump is plugged in to an outlet. I could use a 220V relay that closes a circuit attached to and digital input, but that's too mechanical. I googled a bit and came upon these two schematics using optocouplers, please comment if there are any "catches"  I'd place the R1 before D1 on that one.  The trouble with these is that they will be blinking at 50Hz and the Arduino may get wrong reading at zero crossing. I could use some advice on how to address that with capacitors, values and so on; I am really weak at electronics.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 272
Posts: 25464
Solder is electric glue
|
 |
« Reply #1 on: March 21, 2012, 06:29:14 am » |
If you are weak on electronics, steer clear of mains it could kill you.
A capacitor on the output of those diodes will do, value 1uF but it needs a peak voltage rating in excess of 350V.
It is much better to deal with the blinking in software, that is only consider something is off when it reads off for two or three reads with a 1 millisecond delay between reads.
|
|
|
|
|
Logged
|
|
|
|
|
Brasil
Offline
Sr. Member
Karma: 2
Posts: 306
|
 |
« Reply #2 on: March 21, 2012, 07:13:33 am » |
I using this solution  1. Work fine with PS2501 and PS2505 2. PS250X can work with 80V AC 3. R1 don´t warm soo much, not need big dissipation 4. C1 is a poliester capacitor 5. Work fine with ~110V and ~220-~230V 6. With only one C1 I can energize 2 ps250X
|
|
|
|
« Last Edit: April 29, 2013, 07:48:17 am by mmoscz »
|
Logged
|
4x Duemilanove (clone) Uno torrado (clone) Amiga 1200 40MB Windows XP
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 272
Posts: 25464
Solder is electric glue
|
 |
« Reply #3 on: March 21, 2012, 07:18:32 am » |
3. R1 don´t warm soo much, not need big dissipation Yes but I think you need a bigger resistor than that, that is more power than just 0.125W. Also note the voltage rating on C1. I used a similar circuit on a set top box and the 0.25W resistor caught on fire when C1 failed.
|
|
|
|
|
Logged
|
|
|
|
|
Brasil
Offline
Sr. Member
Karma: 2
Posts: 306
|
 |
« Reply #4 on: March 21, 2012, 07:27:57 am » |
3. R1 don´t warm soo much, not need big dissipation Yes but I think you need a bigger resistor than that, that is more power than just 0.125W. Also note the voltage rating on C1. I used a similar circuit on a set top box and the 0.25W resistor caught on fire when C1 failed. I rear the temp of R1 with a optical termometer, and only warm 3 graus over ambient temp. C1 fail, all circuit is protect by PS250X, but can use a bigger resistor, but in this case, only one R1 with 5W we will not have a fire. Sorry, what voltage rating about are you talking?
|
|
|
|
|
Logged
|
4x Duemilanove (clone) Uno torrado (clone) Amiga 1200 40MB Windows XP
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 272
Posts: 25464
Solder is electric glue
|
 |
« Reply #5 on: March 21, 2012, 07:30:08 am » |
Agreed 5W resistor will not cause a fire but a smaller one will. This was tested in the safety lab where I worked. It was running on 240V.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 128
|
 |
« Reply #6 on: March 21, 2012, 08:55:24 am » |
Thank you for your answers, I think the case can be closed.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 1
Posts: 222
Arduino rocks
|
 |
« Reply #7 on: March 21, 2012, 11:45:54 am » |
In the schematic with the capacitor in series with the optocoupler's LED, what is the function of the capacitor? I know you can limit AC current with a series capacitor, but why is the resistor alone not enough?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #8 on: March 21, 2012, 12:09:51 pm » |
In the schematic with the capacitor in series with the optocoupler's LED, what is the function of the capacitor? I know you can limit AC current with a series capacitor, but why is the resistor alone not enough?
A series capacitor will have a specific impedance at the AC frequency so it will act like an additional resistor to the AC current, thus allowing a smaller R1 resistor ohmage and wattage to be used. However such a cap should be rated for direct connection to AC power lines and are not inexpensive caps.
|
|
|
|
|
Logged
|
|
|
|
|
Brasil
Offline
Sr. Member
Karma: 2
Posts: 306
|
 |
« Reply #9 on: March 21, 2012, 12:33:34 pm » |
|
|
|
|
|
Logged
|
4x Duemilanove (clone) Uno torrado (clone) Amiga 1200 40MB Windows XP
|
|
|
|
Toronto, Canada
Offline
Edison Member
Karma: 2
Posts: 1233
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
|
 |
« Reply #10 on: March 21, 2012, 01:35:20 pm » |
@Grumpy_Mike I used a similar circuit on a set top box and the 0.25W resistor caught on fire when C1 failed. This was tested in the safety lab where I worked Just a question here... Why C1 failed ? Is it the die-electric become a conductor ? A cap is just two metal plate seperated by a die-electric-isolation... And the cap is rated WAY OVER Main Voltage peak... <-- I assumed... So how the ... a cap fail ? Bad Die-Electric Isolator ? Manufacturer lie on the rated voltage ?
|
|
|
|
|
Logged
|
|
|
|
|
Brasil
Offline
Sr. Member
Karma: 2
Posts: 306
|
 |
« Reply #11 on: March 21, 2012, 01:45:55 pm » |
Maybe can´t use CAP less that 150% or 200% over voltage to safe work, I don´t try with CAP less that 440V with ~230V, My first test I used one cap 230V, but with ~110V.
|
|
|
|
|
Logged
|
4x Duemilanove (clone) Uno torrado (clone) Amiga 1200 40MB Windows XP
|
|
|
|
Offline
Edison Member
Karma: 3
Posts: 1712
|
 |
« Reply #12 on: March 21, 2012, 02:04:07 pm » |
Remember the peak voltage of ac is 1.41 times the rms, the peak voltage can cause the sielectric to breakdown even tho you dont think of it so 120rms is 169 p2p(peak to peak) and 240rms is 339p2p So for 240 you need a cap rated for probably 400 to be safe
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 6
Posts: 1399
Arduino rocks
|
 |
« Reply #13 on: March 21, 2012, 02:13:59 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Grand Blanc, MI, USA
Offline
Edison Member
Karma: 43
Posts: 2491
"We're a proud service of the Lost Electricity Reclamation Agency"
|
 |
« Reply #14 on: March 21, 2012, 02:19:41 pm » |
I was going to ask, the circuits being discussed only detect if the appliance is powered if the appliance is switched by some external switch, and the same switched power is fed to the detector circuit. Some sump pumps are one example of this, but I'm not thinking of any others off the top.
|
|
|
|
|
Logged
|
|
|
|
|
|