NodeMCU as smart switch
Posted: Mon Feb 08, 2021 5:43 am
I'm planning on using one NodeMCU board at each switchboard at home, make them communicate via MQTT over WiFi to my Raspberry Pi 4 from where I can make a crude web interface through which I can control the lights and fans of all rooms. I've several questions.
1. I want to power the NodeMCU directly via mains with an HLK-PM03 AC-DC converter with one 250mA fuse on input end and a 22uF capacitor and a varistor on output end. Will this be adequate? Is there a cheaper way to power it?
2. Each NodeMCU will control maybe 2-3 relays. I have a few 5V relays from arduino experiments (https://www.electronicscomp.com/1-chann ... lay-module). For the love of God I can't find 3.3V Relays in India. Obviously I won't have a separate power supply for relays. Can I drive these relays with NodeMCU? Or must I use a logic level shifter or just switch to ESP32 board?
3. I want physical override for the appliances ie- I can turn the light on either via the physical switch or via the MCU through RPi (mostly for my technically challenged parents). I would be replacing the concerned single way switches on the electric board with two way SPDT switches or is there a way to do this with existing switches?
4. Is there a way to know the status of each switch (physical and MCU relay) whether it is on or not and relay it to RPi?
5. Implementing own control center with PHP/ HTML via MQTT would be better or using Tasmota firmware since I'm also planning to integrate it with a voice assistant like Mycroft.
1. I want to power the NodeMCU directly via mains with an HLK-PM03 AC-DC converter with one 250mA fuse on input end and a 22uF capacitor and a varistor on output end. Will this be adequate? Is there a cheaper way to power it?
2. Each NodeMCU will control maybe 2-3 relays. I have a few 5V relays from arduino experiments (https://www.electronicscomp.com/1-chann ... lay-module). For the love of God I can't find 3.3V Relays in India. Obviously I won't have a separate power supply for relays. Can I drive these relays with NodeMCU? Or must I use a logic level shifter or just switch to ESP32 board?
3. I want physical override for the appliances ie- I can turn the light on either via the physical switch or via the MCU through RPi (mostly for my technically challenged parents). I would be replacing the concerned single way switches on the electric board with two way SPDT switches or is there a way to do this with existing switches?
4. Is there a way to know the status of each switch (physical and MCU relay) whether it is on or not and relay it to RPi?
5. Implementing own control center with PHP/ HTML via MQTT would be better or using Tasmota firmware since I'm also planning to integrate it with a voice assistant like Mycroft.