logo elektroda
logo elektroda
X
logo elektroda

How do I safely connect the ESP8266 NodeMCU v3 to 230V sockets?

Flawlessss 1494 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18717420
    Flawlessss
    Level 2  
    Welcome,

    I'm planning to set up a little "smart home" fab in my flat.
    I am mainly concerned with on/off control of power sockets using the ESP8266 nodemcu v3.
    The choice of ESP8266 nodemcu v3 here is not accidental as some time ago I already played with this wonder wanting to create a smart escape room.
    I am a programmer so the software issue is taken care of. [I guarantee that it will be polished day by day] :D .
    While looking for similar solutions I came across a ready-made one, but based on radio instead of WiFi, and also using ready-made "socket to socket" - sniffing the signal of the ready-made product and sending from its 'hardware' - so it doesn't help my idea at all.

    My main problem is how to connect the ESP8266 to the socket, as I'm guessing that feeding the board 230V could grill it a bit....
    The schematic would certainly be based on taking power from the socket for the board itself and conditionally passing the 'current' on - this is where I'm banging my head against the wall - can I ask colleagues to help me with specific components and possibly help me figure out the schematic?

    Thanks in advance and best regards,
    Filip
  • ADVERTISEMENT
  • #2 18717490
    tronics
    Level 38  
    Quote:
    wanting to create a smart escape room
    .
    Just don't miss the panic button to unlock the door in case of a w...
    Your colleague has a ready-made product, sonoff products for example. You can upload your own software or espeasy and configure it your way. There is no point in knocking down an open door, especially at this price and availability.
  • ADVERTISEMENT
  • #3 18723910
    pitron
    Level 24  
    Do you want to put esp in every socket? Sonoff is cool for that supl, tasmot.
    I'm switching to zigbee and thinking about a zvawe with a central point to manage them.
    Skipping the sockets it works much better and the battery lasts for months on small sensors.
  • ADVERTISEMENT
  • #4 18740135
    Flawlessss
    Level 2  
    I have solved the subject :) .
    "Work units" for the sockets will consist of ESP-01 + relay and a 230V->5V 700mA 3.5W AC-DC power supply module.
    The command centre (the main server knowing what devices it has around, with a nice page for on/.off) will stand on an ESP8622 NodeMCU V2 in STA_AP mode which (in short) will allow control of the devices from outside the house.

    I am currently struggling with being able to view the COM port for the ESP-01 from under the Arduino IDE. I suspect that when ESP is hooked up to a USB RS232 converter (TX and RX connected and 3.3v + ground) the module is not in 'normal operation' mode. Of course, after programming I disconnect GPIO0 from GND and EN (whatever it is) from 3.3v.
    The module resets all the time and screams something like:

    "ets Jan 8 2013,rst cause:2, boot mode:( 3,6)

    load 0x4010f000, len 1384, room 16
    tail 8
    chksum 0x2d
    csum 0x2d
    v09f0c112
    ~ld"

    After disconnecting from the programmer and connecting only 3.3V and ground, the module connects to its commanded network without any problem, as I can see in the sniffer.

    Added after 1 [minute]: .

    tronics wrote:
    Quote:
    wanting to create a smart escape room
    .
    Just don't miss the panic button to unlock the door in case of a w...
    Your colleague has a ready-made product, sonoff products for example. You can upload your own software or espeasy and configure it your way. There's no point in knocking down an open door, especially at this price and availability.

    'The problem' is that I am too ambitious and want everything my own way.:D
  • #5 18740402
    tronics
    Level 38  
    Well, my colleague has made a bit of a mistake with the esp-01, which has the uart pins removed and the other 3 have a specific function at the start (gpio0, gpio2 and ch_pd).
    If esp is to control a larger number of sockets, a board with e.g. 4 or 8 relays (or ssr) and an expander e.g. mcp23017 is recommended.
    The advantage of this solution is that you can e.g. use the gpioa from the expander as input and the gpiob as output and operate it by software. personally, i would choose esp07 (with ceramic antenna and possibility of external connection and bigger flash) or esp12e (biggest flash).

    Quote:
    I am too ambitious
    .
    Here a colleague would have the hardware taken care of, proven in operation and basically safe. Soft could still be "ambitnaja samorobnaja"
  • #6 18740413
    Flawlessss
    Level 2  
    tronics wrote:
    Well, my colleague missed a bit with this esp-01 which has the uart pins removed and the other 3 have a specific function on startup (gpio0, gpio2 and ch_pd)
    If esp is to control more sockets, then a board with e.g. 4 or 8 relays (or ssr) and an expander e.g. mcp23017

    ESP-01 is to control one socket unit (relay) :) .
  • #7 18740704
    khoam
    Level 42  
    Flawlessss wrote:
    ESP-01 is supposed to control one socket unit (relay)
    .
    In this case, the ESP-01 should suffice - there are plenty of such modules on ali. On the other hand I would consider using Shelly-1 as a hardware platform - you can always swap the firmware for your own, such more ambitious ;) .
  • #8 18740774
    tronics
    Level 38  
    Quote:
    In that case, the ESP-01 should suffice
    .
    Apparently yes, but for something controlling the power supply we use a module that has specific GPIO requirements at the start.... and nothing will be done because apart from dedicated ones there are no others derived.
    ESP07 or 12 don't cost much more, and offer far more flexibility in this respect. And even more ambitious would be to do not on wifi, but ble on e.g. CC2541 (with core 51 ;) )
  • ADVERTISEMENT
  • #9 18740848
    khoam
    Level 42  
    tronics wrote:
    Apparently yes, but for something controlling the power supply we are using a module which has specific requirements for GPIOs at the start...
    .
    GPIO 0 and 2 have their limitations, but that doesn't mean you can't use these pins sensibly on the ESP-01 for I2C support for example.
    https://www.elettroamici.org/en/esp-01-nanoboard-esp8266/
    I once built this circuit for fun and it worked OK.
  • #10 18746307
    pitron
    Level 24  
    tronics wrote:
    ble on e.g. CC2541 (with core 51 ;) )
    Better Zigbee CC2531

Topic summary

The discussion revolves around safely connecting the ESP8266 NodeMCU v3 to 230V power sockets for smart home applications. The original poster seeks advice on how to power the ESP8266 while controlling the current to the sockets. Various solutions are proposed, including using Sonoff products, which allow for custom firmware uploads, and the use of ESP-01 modules with relays for individual socket control. Recommendations include using a 230V to 5V AC-DC power supply for the ESP board and considering alternative modules like Shelly-1 for more robust solutions. The conversation also touches on the limitations of GPIO pins on the ESP-01 and suggests using ESP07 or ESP12E for greater flexibility and functionality.
Summary generated by the language model.
ADVERTISEMENT