Smart Lamp - CED

by Sofía Dos Santos in Circuits > Electronics

180 Views, 0 Favorites, 0 Comments

Smart Lamp - CED

WhatsApp Image 2022-11-13 at 11.44.30 PM.jpeg

Hi! Here I am going to teach you how to make a lamp with automated variation. It has two possible moves, vertically and horizontally. For this project you need to have a basic knowledge of programming, robotics and standardized drawing (IRAM standards). 

We made a normal lamp, and we automated it, so that it can be used for plenty of functions. It is easy, funny and cheap to do it, so it´s a great option if you want to do something different. 

Supplies

arduino NANO.jpg
servomotor.jpg
Placa Led.jpg
Pulsador.png
PCB vacío.jpg
Potenciometro.jpg
WhatsApp Image 2022-11-16 at 8.35.41 PM.jpeg
WhatsApp Image 2022-11-16 at 8.36.48 PM.jpeg
Soldadora de estaño.jpg
Tin solder.jpg
3d printer.jpg

Materials used: 

  • 1 Arduino NANO 
  • 2 Servomotors 
  • 1 Led plate
  • 1 Switch 
  • 1 PCB 
  • 2 potentiometers 
  • Screws (many)
  • At least 25 male to male and male to female wires 
  • 1 Electric soldering
  • Tin solder
  • 3D printer (this is the best option, if you don´t have one or you can't send it to print, you can do it with wood or metal as well) 

Manufacturing Plans

WhatsApp Image 2022-11-16 at 2.21.39 PM.jpeg
WhatsApp Image 2022-11-16 at 2.21.23 PM.jpeg
WhatsApp Image 2022-11-16 at 2.20.34 PM.jpeg
WhatsApp Image 2022-11-16 at 2.20.10 PM.jpeg
WhatsApp Image 2022-11-16 at 2.18.12 PM.jpeg
WhatsApp Image 2022-11-16 at 2.19.07 PM.jpeg

For you to understand, I made the manufacturing plans for you to know all the dimentions and the measures well, before you print it, or do it with another material. Here are the plans.

Anyways, this sketches will be useful for the next step aswell:

Design

WhatsApp Image 2022-11-14 at 12.37.45 AM.jpeg
WhatsApp Image 2022-11-14 at 12.35.23 AM.jpeg
WhatsApp Image 2022-11-14 at 12.34.15 AM.jpeg

 If you want, for the part of the design, you can do it yourself, but here are some photos of the project made in Onshape and the link to access. 

You will need it if you want to print it in 3D. But, in this type of process there is always a margin of error with respect to the accuracy of the measurements.

https://cad.onshape.com/documents/86922e321cafc6c92dd0789c/w/f63e7eff373b3283dcc1cedc/e/a4a9b50811916384c8e65fe5

Also, here is a folder where you can find the parts separated it to print it.

https://etrrar-my.sharepoint.com/:f:/g/personal/sechaniz_etrr_edu_ar/Eu1v0d0Au_ZEi_QrdxY5OVIBBt0Uh4B4vx7YLoQYZwmKaQ?e=jGQyt3


Assembly

ejemplo.png

For this step you must look at the name of the parts that I putted in photos of the manufacturing plans. Like it shows in the photo. Thats because it´s easier to explain and understand

Assembly 1

WhatsApp Image 2022-11-16 at 11.31.47 PM.jpeg

1- First, you must put one servomotor in the biggest hole of the part A (the cylinder). It must fit with the superior cover of the servomotor. Anchor it with some screws in the holes that the servomotor already has. 

Assembly 2

WhatsApp Image 2022-11-16 at 11.32.11 PM.jpeg

2- In the part D, make a hole in the opposite place where there is already one and put there and stick the insertion that comes with the servomotor. 

Assembly 3

WhatsApp Image 2022-11-16 at 11.32.37 PM.jpeg

3- You must put the part A and the part D together inserting the servomotor with the insertion in one side. And on the other side, insert the rod that is in the 3d folder in the link that we showed before. 

Also, take the servomotor wire out of the hole opposite to where it is 

Assembly 4

WhatsApp Image 2022-11-16 at 11.33.02 PM.jpeg

4- Solder two wires to the led plate and pass each one through the two holes that are in part B.

Assembly 5

WhatsApp Image 2022-11-16 at 11.33.29 PM.jpeg

5- Then pass the wires of the led plate through the hole where you passed the servomotor wires. 

Assembly 6

WhatsApp Image 2022-11-16 at 11.33.59 PM.jpeg

6- In the Part E you must insert the servomotor in the rectangle of the base and anchor it with screws. 

Assembly 7

WhatsApp Image 2022-11-16 at 11.34.21 PM.jpeg

7- Make a hole down the part D for the insertor of the other servomotor that comes with it. 

Assembly 8

WhatsApp Image 2022-11-16 at 11.34.46 PM.jpeg

8- And finally put it together.

Circuits

WhatsApp Image 2022-11-16 at 11.00.28 PM.jpeg

For the circuits you must follow these photo. I did it in "Tinkercad" because is easier to understand.

Be carefull with which port do you use to connect the components.

Code

I programmed it to turn on and turn off the light with the button, and to rotate the position with the servomotors. Here is the code if you want to copy it. 


// C++ code

//

#include <Servo.h>


Servo servo_2;


Servo servo_3;


void setup()

{

 pinMode(0, INPUT);

 pinMode(A0, INPUT);

 servo_2.attach(2, 500, 2500);

 pinMode(A1, INPUT);

 servo_3.attach(3, 500, 2500);

 pinMode(5, OUTPUT);

}


void loop()

{

 while (digitalRead(0) == HIGH) {

  servo_2.write(map(analogRead(A0), 0, 1023, 0, 180));

  servo_3.write(map(analogRead(A1), 0, 1023, 0, 180));

  digitalWrite(5, HIGH);

 }

 delay(10); // Delay a little bit to improve simulation performance

}

Tips