logo elektroda
logo elektroda
X
logo elektroda

How do I detect 230V AC voltage on the ESP8266 for smarthome control?

mateuszkisielmk 288 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21163862
    mateuszkisielmk
    Level 3  
    Hi
    I am making myself a smarthome using esp8266 along the lines of how blebox devices work. I have a device to turn on lights when it gets the right request, and another that detects movement. I would now like to make an on/off option via a switch (normal like for lights). The switch turns on 230V and I have no way to connect it to a lower voltage. So I would like to detect in the esp8266 that there is 230V AC voltage in a particular wire. How should I do this? Usually the control is via a low DC current, and here the situation is a bit opposite.
    I see that blebox has such a ready-made device: https://blebox.eu/wp-content/uploads/actionBoxS_Manual_PL.pdf
    What should I use to do something similar?
  • ADVERTISEMENT
  • #2 21163885
    JacekCz
    Level 42  
    I would bite with an optocoupler (ensuring it works properly on the AC 230V side)
    This quoted module seems a huge mare in relation to the sentence you write about.

    It seems that you only want a statement of the existence of a voltage, not an assessment of the value that you are reckoning with a certain drain of several milliseconds (even if only zw cycles of 50 Hz)
    It is worth / MUST think about the insulation category, whether this has a metal enclosure, moisture hazard etc .... expressive design of the 230V / safety part
    E.g. how far away is this 230V you need to state, and your ESP32 circuit, 30 cm is a different situation to 15 m
  • ADVERTISEMENT
  • #3 21163924
    mateuszkisielmk
    Level 3  
    The distance between the switch and the microcontroller would be about 1.5 m. Why does this distance matter?

    As far as I can see, the optocoupler expects to control DC, not AC. I would need to somehow straighten it first and lower it. How best to do this? I'm keen for it to take up minimal space, I'm trying to enclose the whole circuit in a can.

    Added after 3 [minutes]: .

    I might use a mini power supply like this. What do you think of it?
    https://alle gro.pl/oferta/modul-zasilacz-3-3v-900ma-3w-ac-dc-230v-hlk-pm03-8949532175
  • #4 21163937
    JacekCz
    Level 42  
    mateuszkisielmk wrote:
    would be about 1.5m. Why does this distance matter?
    .

    Well, because either a 230V cable has to be installed in statutory isolation, or we have this metre in a delicate digital signal, prone to interference. 1.5m is not a difficult distance - but you have not specified it so far

    mateuszkisielmk wrote:
    From what I can see the optocoupler expects to control DC, not AC.


    A 500V capacitor (not an electrolyte) as a series element, instead of a resistor, a two-pole rectifier
    You have to answer WHERE yourself, because you have 230V close to the digital signals
ADVERTISEMENT