This code is to create a prototype for a smart home lighting automation system. It uses NodeMCU ESP8266, DHT11 sensor, PIR Motion sensor, a LDR , IR sensor, some LEDs, a small fan and a breadboard. One of the LEDs should only light up when it senses presence from the PIR Motion Sensor, another one of the LEDs should only light up when it senses presence from the IR Sensor, another one of the LEDs should only light being controlled by the IR, and lastly the fan should automatically switch on when certain temperature and humidity from the DHT11 sensor is recorded above the one stated.
The project is intergrated into the Blynk App which has two gauges one for seeing the temperature and another for seeing the humidity on the phone. It also has 4 buttons. The first button is for either switching between manual mode or automatic mode. During automatic mode the system works by itself switching ON and OFF lights and the fan without any human intervention. During the manual mode the lights are now controlled using the Blynk App to switch them ON or OFF, that is were the other three buttons come into play to manually switch ON or OFF the three lights using the Blynk App.