Nodemcu with sensors and switches

Smart lights and switches are expensive, so I’ve setup cheap lights and sensors for my rooms with nodemcu. Parts that I have for this project:

  • AC 220V to DC 5V 500mA Step-Down Power Supply Module - $1.80
  • HC-SR501 PIR motion sensor - $1.00
  • DHT11 sensor - $1.00
  • nodemcu - $3.50
  • 5V Relay Board Module - $1.50

All parts are from ebay and under $10 total.
Here is configuration for HASS and the code for nodemcu board.
I am thinking off adding light and sound sensors, so lights can be turned on with clapping or when it’s dark(now I use sun sensor for triggering lights on).
Also I have one 16X2 LCD display which works great with nodemcu, so it can be used to show some information.

1 Like

could you put some pictures of your Project, and schematic?

here is all parts packed and screwed on the ceiling. I know it’s not the best box :slight_smile:
Schematic is simple. Neutral wire from 220v is connected to Power supply and lights, Live wire to the relay and Power supply and from relay to lights
Supply Module is used to power nodemcu and sensors/switches that use 5V, all other are powered from the board 3.3V pins. Data wires are connected to pins of your choice.