-->
Page 1 of 1

NodeMCU as smart switch

PostPosted: Mon Feb 08, 2021 5:43 am
by Coldbreeze16
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.

Re: NodeMCU as smart switch

PostPosted: Wed Mar 03, 2021 12:24 pm
by guysnraw
Hi why do you need a 3.3v relay when you can power everything with 5v? Using Mycroft, raspberry pi would be costlier instead u can use amazon echo dot. Install tasmota and control via echo, using 2way switch connect with relay so u can mechanically also control. Hlk is costlier for powering up, buy ac to dc adapter board from calcatta electronics web, it's just 25Rs or 40 don't remember exactly. Instead of node mcu use esp12e or f which is very cheap and buy ams1117 module for converting 5- 3.3v. I will send you how to properly run esp12f if you want.