Sunglass robot

Published Dec 13, 2021
 1 hours to build
 Intermediate

This is a sunglass robot it automatically the sunglass is on when you are in sun and when you come in shade it gets off sound cool right so let's get started and learn how to make it.

display image

Components Used

Arduino Nano
Arduino Nano
1
LDR -Photocell Photoresistor
LDR -Photocell, Photoresistor
1
9g Servo Motor
DFRobot Accessories 9g micro servo (1.6kg)
1
Sunglass
1
Description

Video

Hello, guys, my name is Krish Singh Chandhok and I am 11 years old Today I am making a sunglass robot it's working when you are in sun and gets of when you are in shadow.lets see how to make it

 

Step 1:connect servo motor and LDR 

Solder the all the components on the board with the help of the diagram.

Step 2: remove the glasses.

Remove the glasses from the sunglass.

Step 3: stick the glass on the servo horn like this.

Now stick the servo motor on the frame.

Step 4: stick Arduino Uno and LDR sensor on the frame like this .

Like this.

 

Step 5: Upload the code.

#include<Servo.h>
Servo sglass; //servo name
int ldr= 0;   //connect LDR to A0
int value= 0; //define value 0
void setup() 
{
 Serial.begin(9600); //this is not necessary-but to show value to pc
 sglass.attach(9);   //declare in which pin the servo you attach
}
void loop()
{
 value = analogRead(ldr);  //read value-analog from A0
 Serial.println(value);    
 delay(100);
 if(value<100)  //change the value as you wish
 {
   sglass.write(155); //black glass down
   delay(100);     //a bit delay for the servo to move there
 }
 else
 {
   sglass.write(80);  //black glass up
   delay(100);
 }
}

 

 

Step 6 : ready to work.

Power on the project wear the glasses and it's ready to work.

Demo : here's the demo you can watch

Downloads

IMG_20211213_202146 Download
sunglass robot Download
Comments
Ad