Arduino: Project 30: Automatic Table Lamp

So this project is actually dedicated to my mom. It solves a very common problem: leaving electrical appliances on even when no one is in the room. So this smart lamp turns on when you sit at your table and turns off a little while after it senses that you’ve left.


Things Required:

  1. Jumper Wires
  2. Arduino UNO
  3. Relay
  4. Lamp that is powered through your House AC supply
  5. PIR Sensor
  6. breadboard
  7. USB Cable
  8. Arduino IDE on computer

Reference Material:

  1. I referenced this (LINK) article for the project and for getting to know the working of the PIR sensor. Note that in the project done here they’ve just used an LED, which I’ve replaced with a relay.


View on/ Download from Github: (LINK)

int pir_pin=8;
int relay_pin=7;
int pir_value;

void setup() {
  pinMode(pir_pin, INPUT);
  pinMode(relay_pin, OUTPUT);
  digitalWrite(relay_pin, LOW);

void loop() {
  pir_value= digitalRead(pir_pin);
    digitalWrite(relay_pin, HIGH);
  } else {
    digitalWrite(relay_pin, LOW);

Stay Tuned for upcoming posts on Arduino Projects! Want to be the first to know when a new and amazing post comes up?? Then feel free to subscribe!

Happy Learning!!

This image has an empty alt attribute; its file name is stay-tuned.gif

2 thoughts on “Arduino: Project 30: Automatic Table Lamp

  1. Brillant work . Aarushi

Leave a Reply


Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close