C
C
Chega2017-02-22 15:58:13
Arduino
Chega, 2017-02-22 15:58:13

How to detect the position of a light switch?

There is a general switch for the whole light in the house, which is connected to the contactor in the shield. I want to use it as a detector of the presence of people in the house, because. when leaving, it is always turned off if no one is at home. Wanted to do it on ta-12 and esp8266 by installing TA-12 on the contactor. But I ran into the problem of pickups in the box, the sensor shows complete nonsense. Pulling this whole thing into the switch itself will not work, there is not enough space. Can someone tell me a fresh solution, are there solutions on the market for detecting the presence of voltage or something like that? ACS758 I put something in the gap. The sensor or solution is desirable to be compatible with esp8266. everything will work according to the mqtt protocol.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Gusev, 2017-02-22
@who_is_it

A circuit with a damper capacitor and a diode bridge (like in LED corn lamps) that will keep the optocoupler open. On the other hand, you safely read this optocoupler and do what you want.
Or you can keep a constantly on light somewhere, which can be read by a light sensor.
Instead of an optocoupler, you can also hide a 220 relay, which will again switch the low-voltage line and the MK will read the log 0 or 1.
You can hang a 5V power supply in the lighting circuit and monitor its output voltage - if it doesn’t output anything, then there is no light. If there is nowhere to put the controllers and too lazy to pull the wires / nowhere to wedge in the shield, then we hang this power supply with an esp pin in a convenient place, which will yell through the air that power is coming to it, and if it stops yelling, then the light is turned off)) It will be possible to hide in a convenient place within the reception area of ​​the main controller, which will always be powered.

S
stslam, 2017-02-22
@stslam

Current sensor GY-712 not suitable? There is current in the circuit - the switch is on. (or forgot to turn off, but this is a flaw in your concept)

A
Alexander, 2017-02-22
@NeiroNx

And if you track the position of the switch mechanically?

A
Armenian Radio, 2017-02-22
@gbg

Umm ... how did you mount it so that you caught all the pickups? your contactor probably has additional contacts, use them.
By the way, did you take into account that we have a change in the socket, which means that the sensor will produce rectangular pulses, and not 1 and 0?

P
pmaster555, 2017-04-10
@pmaster555

To detect AC voltage on the line, I used the MID400
here is the datasheet https://www.fairchildsemi.com/datasheets/MI/MID400.pdf
if you do not forget about the capacitor, then the output will be 1 or 0. depending on whether there is voltage or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question