Table Lighting

This Simple Project is crafted to illuminate a table when a motion is detected at a specific area for quick need for light at night. Table lamps take too much space on a table and it tends to fall around.To overcome these problems this project has been designed with multiple features.

This Table unit consists with 12V rechargeable battery , so even in no power condition,table unit will operate.

Also an USB charger port is added to easily charge your phone and at the same time keep it closer to you.

Two Plug sockets are added at the side of the table for power requrements.(eg; you can easily plug in your laptop charger)

Motion is detected by an Ultrasonic sensor.If there is any movement on the sensor area, the table will instantly illuminate for 30 seconds.(change the code for adjust the time period)

This table has many uses as an alternative for table lamp in domestic use as well as a useful equipment in a workbench.

Tools & Components

1 X Arduino Nano Board (ATmega 328P)

1 X 5VDC Relay Module

1 X Ultrasonic Sensor

1 X 12V Battery

1 X 230VAC to 12VDC Converter

2 X Switch(230V & 12V)

1 X USB Port

2 X Plug Socket

Connecting Wires

Tinted Glass Sheet

Metal or Plastic Casing

Black Rubber Sheet

Glue Gun & Glue Sticks

Connecting Components

Relay Module Sig. Pin     - Arduino D12

Ultrasonic Sensor Trigpin- Arduino D02

Ultrasonic Sensor Echopin- Arduino D03

Arduino Code

//2020 CraftyBin@Blogspot®
//Author - (Chathura H.)

int relay = 12;
int trigPin = 2;  
int echoPin = 3;   
long duration, cm, inches;

void setup() {

  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(relay, OUTPUT);
  digitalWrite(trigPin, LOW);
  delayMicroseconds(5);
}

void loop()
{
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  cm = (duration / 2) / 29.1;
  inches = (duration / 2) / 74;

  Serial.print(cm);
  Serial.print("cm, ");
  Serial.print(inches);
  Serial.print("inches");
  Serial.println();
 
  if (cm < 30) {
    digitalWrite (relay,HIGH);
    analogWrite (A0, 135);
    analogWrite (A4, 0);
    delay(30000);
  }

  else if (cm > 30) {
    digitalWrite (relay,LOW);
    analogWrite (A0,0);
    analogWrite (A4,1350);
  }
}

Building Table

You can Design and build the Table however you desire, as long as it can contain all equipments inside.

Here is some images of crafted Table :






 In this project a old 4-port USB hub is used for charging purposes as shown in the above image  

Safety First !

Always Connect the 230VAC Main supply if you are absolutely sure that the components are connected correctly without changing polarity and short circuited the wiring.

Even if it seems nothing is wrong : DOUBLE CHECK EVERYTHING !!

Your Feedback is very important to us.
Please Leave a comment about how you feel about this project.


Post a Comment

Previous Post Next Post