Smart Disk Lamp
smart desk lamp
This desk lamp is different in these points …..
It lights when there is a person or motion and the light is weak or there is no lighting but if there is more lighting and motion it doesn’t work
I care about this idea because of some reasons;…..
first, this idea shows very simple and I like the simple idea and work about it to show very beautiful and very flexible
Second I need to make this idea to use it for my desk to use it when I study
My inspiration was my desk needed a desk lamp and I think that why I make this but more function I see this idea on the website but another function and this is the link to the website
Supplies
List of Components
- 1 Arduino UNO
- 1 Breadboard
- Wires
- 1 ultrasonic
- 1 LDR
- 1 Relay
- 1 Bulb
- 1 Screw cap
- 2 potentiometer
- 2 servo motors
- 1 Electrical plug
- 1 adaptor (6 v)
- Spacers
Softwares
- Fusion 360 (CAD Software)
- Arduino programming
- Tinkercad
Tools
- Drill
- Laser Cutting Machine
- 3D Printer
- Screwdriver
Test the Circuit
I write the code on Arduino programming and make the circuits by using these steps :
- Connect the Arduino to the breadboard by putting the positive (5v) and negative (ground) pins on the (+) , and (-) on a breadboard
- Put the LDR on the pin (4) on Arduino and (+) (-) on a breadboard
- Put (ultrasonic ) (echo ) on pin (2) (trig ) on pin (5) on Arduino and (+) (-) on a breadboard
- Put the potentiometer on one of them on the (A0) and the other on (A1) on the Arduino and (+),(-) on the breadboard
- Put the servo motor on pin (11) on Arduino and the other on (9) and put the other weirs on (+), and (-) on the breadboard
CAD Design
I used fusion software to design a smart desk lamp and I used some tools to design it like Sketch, offset, projection, Extrude, revolve Joints, and Filet
The CAD process of the project
1. I design a drawn circle to make the bases of the lamp by using offset and extrude.
2. make a rectangle to make the arms in this step by using the sketch and offset
3. use a joint tool to join the parts of the design and the part of the lamp I used to make it revolve, extrude, and filet
4. I port nuts and nails to make the hole in the arms
Put Arduino, relay, ultrasonic, and servo motors
Downloads
Fabrication
I designed the shape of the desk lamp on fusion and I used a laser cutting machine to cut the two bases and the four arms
I used 3D printing to print the part of the lamp and the part of ultrasonic
Assemble
I used the help of my EX to make this Project Actually, so I appreciate her help
Coding
#include <Servo.h>
Servo myservo2;
int potpin2 = 0;
int val2;
Servo myservo;
int potpin = 0;
int val;
int ldr = 4;
int bulb = 3;
int trig = 5;
int echo = 2;
void setup() {
myservo2.attach(11);
myservo.attach(9);
pinMode (ldr, INPUT );
pinMode (bulb, OUTPUT);
pinMode (trig , OUTPUT);
pinMode (echo ,INPUT );
Serial.begin(9600);
}
void loop() {
long duration, cm;
digitalWrite(bulb, LOW);
delayMicroseconds(echo);
digitalWrite(bulb, HIGH);
delayMicroseconds(trig);
digitalWrite(bulb, LOW);
duration = pulseIn(echo, HIGH);
cm = duration/29/2;
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(100);
int motion ;
if (cm < 30) {
motion =1 ;
} else {
motion =0;
}
int brightness = digitalRead (ldr);
if (motion){
if (brightness) {
digitalWrite (bulb, HIGH);
}
else {
digitalWrite (bulb, LOW);
}
Serial.print(brightness);
Serial.print(",");
}
else {
digitalWrite( bulb, LOW );
}
val = analogRead(potpin);
Serial.println(map(val, 0, 1023, 0, 180) );
val = map(val, 0, 1023, 0, 180);
myservo.write(val);
val2 = analogRead(potpin2);
val2 = map(val2, 0, 1023, 0, 180);
myservo2.write(val2);
delay(15);
}