Smart Disk Lamp
![WhatsApp Image 2020-10-21 at 7.57.24 PM.jpeg](/proxy/?url=https://content.instructables.com/FYS/6Z3O/LKV63JM4/FYS6Z3OLKV63JM4.jpg&filename=WhatsApp Image 2020-10-21 at 7.57.24 PM.jpeg)
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
![uno_r3.jpg](/proxy/?url=https://content.instructables.com/FRS/L0RA/LKV63JNR/FRSL0RALKV63JNR.jpg&filename=uno_r3.jpg)
![712uMOJW2qL._SL1500_-1500x1500.jpg](/proxy/?url=https://content.instructables.com/FKK/TXHQ/LKV63JNO/FKKTXHQLKV63JNO.jpg&filename=712uMOJW2qL._SL1500_-1500x1500.jpg)
![61pBEnf2nML._AC_UF1000,1000_QL80_.jpg](/proxy/?url=https://content.instructables.com/F5V/3PYE/LKV63JNN/F5V3PYELKV63JNN.jpg&filename=61pBEnf2nML._AC_UF1000,1000_QL80_.jpg)
![servo_sg90.jpg](/proxy/?url=https://content.instructables.com/F5M/YC7M/LKV63JNP/F5MYC7MLKV63JNP.jpg&filename=servo_sg90.jpg)
![tornado-warm-light-bulb-led-lamp-15-watt-yellow-light-bw-w15l.jpg](/proxy/?url=https://content.instructables.com/FB1/274W/LKV63JNQ/FB1274WLKV63JNQ.jpg&filename=tornado-warm-light-bulb-led-lamp-15-watt-yellow-light-bw-w15l.jpg)
![1-channel-12v-relay-module.jpg](/proxy/?url=https://content.instructables.com/FQE/QXEH/LKV63JZD/FQEQXEHLKV63JZD.jpg&filename=1-channel-12v-relay-module.jpg)
![51R--G95f7L.jpg](/proxy/?url=https://content.instructables.com/F7D/QOES/LKV63JOC/F7DQOESLKV63JOC.jpg&filename=51R--G95f7L.jpg)
![unnamed.png](/proxy/?url=https://content.instructables.com/FDO/XH0P/LKV63KC4/FDOXH0PLKV63KC4.png&filename=unnamed.png)
![drill-2048px-6257.jpg](/proxy/?url=https://content.instructables.com/F72/2N27/LKV63KC3/F722N27LKV63KC3.jpg&filename=drill-2048px-6257.jpg)
![41HAybt1YaL.jpg](/proxy/?url=https://content.instructables.com/F5U/X995/LKV63KC2/F5UX995LKV63KC2.jpg&filename=41HAybt1YaL.jpg)
![2280.jpg](/proxy/?url=https://content.instructables.com/FME/0S2X/LKV63KHV/FME0S2XLKV63KHV.jpg&filename=2280.jpg)
![Screw_Driver_display.jpg](/proxy/?url=https://content.instructables.com/FO0/NKB9/LKV63KK0/FO0NKB9LKV63KK0.jpg&filename=Screw_Driver_display.jpg)
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
![Screenshot 2023-08-04 130928.png](/proxy/?url=https://content.instructables.com/FRN/LA84/LKV63LIN/FRNLA84LKV63LIN.png&filename=Screenshot 2023-08-04 130928.png)
![2.jpg](/proxy/?url=https://content.instructables.com/FFZ/JHH0/LKV63KLL/FFZJHH0LKV63KLL.jpg&filename=2.jpg)
![3.jpg](/proxy/?url=https://content.instructables.com/FP8/SUY9/LKV63KLM/FP8SUY9LKV63KLM.jpg&filename=3.jpg)
![4.jpg](/proxy/?url=https://content.instructables.com/FVW/NFWZ/LKV63KLN/FVWNFWZLKV63KLN.jpg&filename=4.jpg)
![5.jpg](/proxy/?url=https://content.instructables.com/FME/LRDA/LKV63KLO/FMELRDALKV63KLO.jpg&filename=5.jpg)
![6.jpg](/proxy/?url=https://content.instructables.com/FMX/JRYI/LKV63KLP/FMXJRYILKV63KLP.jpg&filename=6.jpg)
![1.jpg](/proxy/?url=https://content.instructables.com/FA0/RZQR/LKV63KLK/FA0RZQRLKV63KLK.jpg&filename=1.jpg)
![7.jpg](/proxy/?url=https://content.instructables.com/F3F/MG9A/LKV63KLQ/F3FMG9ALKV63KLQ.jpg&filename=7.jpg)
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
![LAMP.5.jpg](/proxy/?url=https://content.instructables.com/FEG/6FP7/LKV63LPG/FEG6FP7LKV63LPG.jpg&filename=LAMP.5.jpg)
![LAMP.6.jpg](/proxy/?url=https://content.instructables.com/F0F/OA6C/LKV63LPH/F0FOA6CLKV63LPH.jpg&filename=LAMP.6.jpg)
![LAMP.7.jpg](/proxy/?url=https://content.instructables.com/FM7/JKPA/LKV63LPI/FM7JKPALKV63LPI.jpg&filename=LAMP.7.jpg)
![LAMP.8.jpg](/proxy/?url=https://content.instructables.com/FS6/O4NE/LKV63LPJ/FS6O4NELKV63LPJ.jpg&filename=LAMP.8.jpg)
![LAMP.9.jpg](/proxy/?url=https://content.instructables.com/FKT/ENFY/LKV63LPK/FKTENFYLKV63LPK.jpg&filename=LAMP.9.jpg)
![Picture15.png](/proxy/?url=https://content.instructables.com/FVJ/ONBM/LKV63LPL/FVJONBMLKV63LPL.png&filename=Picture15.png)
![Picture16.png](/proxy/?url=https://content.instructables.com/F7R/RCY2/LKV63LPM/F7RRCY2LKV63LPM.png&filename=Picture16.png)
![ab092b5b-5c7b-4cf2-9269-67e427f123c5.png](/proxy/?url=https://content.instructables.com/FR5/3WQG/LKV63LPN/FR53WQGLKV63LPN.png&filename=ab092b5b-5c7b-4cf2-9269-67e427f123c5.png)
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
![Picture8.png](/proxy/?url=https://content.instructables.com/FQH/677U/LKV63MCX/FQH677ULKV63MCX.png&filename=Picture8.png)
![Picture9.png](/proxy/?url=https://content.instructables.com/FBJ/0QMU/LKV63MD0/FBJ0QMULKV63MD0.png&filename=Picture9.png)
![Picture10.png](/proxy/?url=https://content.instructables.com/FE5/05Z9/LKV63MD1/FE505Z9LKV63MD1.png&filename=Picture10.png)
![Picture11.png](/proxy/?url=https://content.instructables.com/FRS/54OO/LKV63MD2/FRS54OOLKV63MD2.png&filename=Picture11.png)
![Picture12.png](/proxy/?url=https://content.instructables.com/F9A/EGK8/LKV63MD3/F9AEGK8LKV63MD3.png&filename=Picture12.png)
![Picture13.png](/proxy/?url=https://content.instructables.com/FR6/KLSE/LKV63MD6/FR6KLSELKV63MD6.png&filename=Picture13.png)
![Picture14.png](/proxy/?url=https://content.instructables.com/F38/IR0R/LKV63MDB/F38IR0RLKV63MDB.png&filename=Picture14.png)
![IMG_٢٠٢٠١٠١٤_١١٠٨٠٩.jpg](/proxy/?url=https://content.instructables.com/F55/SPLG/LKV63MFH/F55SPLGLKV63MFH.jpg&filename=IMG_٢٠٢٠١٠١٤_١١٠٨٠٩.jpg)
![IMG_٢٠٢٠١٠١٤_١١٠٨١٤.jpg](/proxy/?url=https://content.instructables.com/FE2/K6WL/LKV63MFI/FE2K6WLLKV63MFI.jpg&filename=IMG_٢٠٢٠١٠١٤_١١٠٨١٤.jpg)
![IMG_٢٠٢٠١٠١٤_١١٠٨٤٦.jpg](/proxy/?url=https://content.instructables.com/FAE/YV37/LKV63MFJ/FAEYV37LKV63MFJ.jpg&filename=IMG_٢٠٢٠١٠١٤_١١٠٨٤٦.jpg)
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
![Smart Desk Lamp](/proxy/?url=https://content.instructables.com/FML/W7IL/LKV63NXN/FMLW7ILLKV63NXN.jpg&filename=Smart Desk Lamp)
![WhatsApp Image 2020-10-21 at 7.57.22 PM.jpeg](/proxy/?url=https://content.instructables.com/FKO/58XX/LKV63NZP/FKO58XXLKV63NZP.jpg&filename=WhatsApp Image 2020-10-21 at 7.57.22 PM.jpeg)
![WhatsApp Image 2020-10-21 at 7.57.24 PM.jpeg](/proxy/?url=https://content.instructables.com/FZI/R4LY/LKV63NZQ/FZIR4LYLKV63NZQ.jpg&filename=WhatsApp Image 2020-10-21 at 7.57.24 PM.jpeg)
![WhatsApp Image 2020-10-21 at 7.57.25 PM.jpeg](/proxy/?url=https://content.instructables.com/FT3/OGUO/LKV63NZR/FT3OGUOLKV63NZR.jpg&filename=WhatsApp Image 2020-10-21 at 7.57.25 PM.jpeg)
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);
}