W
W
we12019-12-21 14:46:06
Arduino
we1, 2019-12-21 14:46:06

How to determine that a person turned on the light?

How can one distinguish the situation when a person, relatively speaking, plugged the plug into the socket, from the situation when the plug was in the socket, but there was no electricity, and then it appeared. In both cases, the power will turn on, but the device should work only if the inclusion is made consciously by the user. A plug is any switch that makes/breaks a contact.
What could be the solution?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
Konstantin Zaitsev, 2019-12-21
@KonstantineZ

Feed 220 should not turn on the device, it should only be turned on with a momentary button, just like we turn on a computer =)

T
towin, 2019-12-21
@towin

Reliable and 100% - no way.
If the light went out at the power plant or the introductory switch to the apartment, it is likely that other appliances, such as a refrigerator, are also included in the network. This means that by applying a weak current to the 220V terminals through a 1MΩ resistor and measuring the voltage on them, you can figure out if there is another load in the network.
This must be done very carefully, it is forbidden to connect the arduino directly to 220 volts with any pins, only through resistors of at least 1 MΩ. The device must be battery powered so that it can work while there is no voltage in the 220V network.
Another option is to use a capacitive hand sensor hidden in a plug or switch. So that when turned on, we can determine whether a person is holding the plug.

V
Vladimir Kozhevin, 2019-12-21
@vovik0

If the input power is lost -> we transfer to the error state and do not turn it on until the user presses the button or turns it on / off.
And the load connection is easy to track with a current sensor (eg ACS758xCB).

L
lonelymyp, 2019-12-22
@lonelymyp

Measure the length of the TDR wire by the method or by resistance, if the wire is long, then the plug is definitely stuck somewhere.
The question is how to link this with the fact that there can be 220 volts in the wire so that the length determination circuit does not die.

D
Dmitry Romanov, 2021-02-05
@DRomanov1972

towin @towin
Reliable and 100% - no way.

Why so? Determines the presence of 230V on the power cord before power is supplied to the device by a toggle switch located on the device case. Connect the circuit, of course, to the toggle switch to the network wire.
601d86b2a1611481464634.gif

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question