IoT Based Automatic Table Lamp project
In this project, we will make an IoT based automatic table lamp using Arduino, which can turn on and off automatically based on human presence. This system uses a PIR sensor to sense human presence and detect human motion. The circuit works on the readings from this sensor. A relay module is an electrical switch which allows microcontrollers to control large electrical loads.
In this project, a two-channel relay module is used, with only one relay. To control a single relay on the circuit, the VCC, GND and IN1 pins of the relay module are used. The relay module is used as active LOW, that is, when the IN1 pin is HIGH, the relay is OFF and when it is LOW, the relay is activated.
The connection of the Arduino, PIR sensor and relay module is done as follows:
- PIR sensor’s data OUT pin is connected to Arduino’s Digital I/O Pin 8. An LED is connected to pin 13 of Arduino to indicate whether the light is turned ON or OFF.
- IN1 pin of the Relay Module is connected to Pin 9 of Arduino.
- A bulb is connected to mains supply through relay. One terminal of the bulb is connected to one wire of the mains supply. The other terminal of the bulb is connected to the NO (Normally Open) contact of the Relay Module.
- COM (Common) contact of the Relay is connected to the other wire of the main power supply.
When there are no people around the lamp, the OUT pin of PIR sensor remains LOW. If the sensor detects any human motion around it, the output becomes HIGH. This is captured by the Arduino and it in turn activates the relay by making the relay pin LOW. This turns on the lamp.
If the IR radiation becomes stable, for example when the person leaves or takes a nap, then the output pin of the sensor becomes LOW again. This is situation, the Arduino turns off the relay by making the relay pin HIGH.
Therefore, with the proper Arduino programming, we can easily make an automated table lamp, which can help greatly in saving electricity. A similar circuit and PIR sensor can be used to make other automated projects, like automatic flush system, automatic door opener, etc.
- Arduino UNO
- PIR Sensor
- 5V relay module
- 100 Ω resistor
- Jumper wires
Image credit: electronicshub.
int in1 = 9;
int sensor = 8;
int led = 13;
unsigned long t=0;
Image credit: arduinoprojecthub
- Saves electricity and energy
- Cost effective
- Completely automated system
- Might turn off if no human motion is detected, but light is still required, like while reading a book.
Let us know your comment on “IoT based automatic table lamp using Arduino” in the section below.
Start your IoT journey with IoT Basics from IoTDunia.