SunGlass-BOT || Automatic SunGlass Robot.

5.2K186

Intro: SunGlass-BOT || Automatic SunGlass Robot.

A Sun Glass that automatically detects light intensity and closes or opens it's black glass.

So from now on you don't need to worry about eyes, this Glass is here to automatically protect your eyes.and also Opens the glass for ease of viewing at low light.

This robot is made using Arduino and some basic parts. Sounds cool,isn't it?

Update August2018: This robot has been Featured as TOP PROJECT on HackSpace Magazine #issue9 https://hackspace.raspberrypi.org/issues/9

STEP 1: Parts

1. 1x arduino pro mini (5v 16 MHz)

2. 1x micro servo motor (any model is good but it needs to be small)

3. 1x LDR ( LIght depending resistor)

4. 1x 10k ohm resistor

and of course

5. a Sun glass

------------------------------------------------

for programming you'll need

a USB to TTl converter or Arduino UNO.

I'll upload code Using UNO.

Buy electronic components at utsource.net

STEP 2: Principle

We'll make a voltage divider circuit and connect it with arduino. Now we know that LDR is a variable resistor and it's resistance value changes according to light intensity. So as our Resistor is 10k our value will be in between 0 to 1023 . If there is bright or a medium sun light the value will be less than 100. In room light the value will be something around 500 to 600. If too dark the amount will be 1023. You got it, right? now let's proceed.

STEP 3: The Circuit

The circuit is simple enough to build. I've tested it on bread board. Then soldered it on arduino pro mini. make room for the LDR as it will have to detect the light.

STEP 4: Programming the Arduino Pro Mini

As you can see we don't have a USB programming option on pro mini. Use a USB to TTL converter or use an ARDUINO UNO. We all have an UNO right? So why waste money?

just remove the ATmega328P ic from arduino uno using a screwdriver to lift it up.

the connect the pin as following

UNO -------- Pro mini

5v---------------vcc

Gnd------------Gnd

tx----------------tx

rx----------------rx

reset----------- rst

You may watch the video to do so (language different)

That's it and then connect arduino uno usb cable and connect to your pc or android to upload the code.

before uploading go to tools>board type> select arduino pro mini

also select the right processor 5v 16 MHz in our case. See picture.

Then upload the code

Code link https://github.com/ashraf-minhaj/SunGlass-Bot-Auto...

//*SunGlass-Bot an automatic sunglass by ashraf minhaj.
//full tutorial on youtube:  www.youtube.com/c/fusebatti
//Contact if necessary ashraf_minhaj@yahoo.com

#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 (depends on how you connect servo)//
    delay(100);        //a bit delay for the servo to move there
  }
  else
  {
    sglass.write(80);  //black glass up
    delay(100);
  }
}

Upload it and see how it works.

STEP 5: Prepare the Sun Glass

Push hard to remove the black glasses and glue them on a hard wire just like this. and then mound the servo and add a servo arm to glue it with the extra glass frame we made. You may power it up using any 5v 1A power source. I'll be using a home made power bank.

STEP 6: Done!!!!!!!!

Power up the circuit and you should see the arduino light up. Now go out and have fun with this weird looking amazing Sun Glass Robot.

4 Comments

I would add a headlamp, mp3 player, and phone.

Thorondor95 Thanks and i will definitely try this on next version. But i'm afraid arduino pro mini may run out of processing memory if i try #TMRpcm (audio play),#GSM (to make call) #ServoTimer2 (servo run) all together. But i'll definitely try.

Please upload the code
Please upload it by Tomorrow