Arduino Clock With a Dc Motor (single Needle)

by PJ2000 in Circuits > Arduino

12369 Views, 66 Favorites, 0 Comments

Arduino Clock With a Dc Motor (single Needle)

image.jpg
Hi,
I was trying to make a clock with arduino with a single motor but it was not possible with the standard method as there has to be at least two needles
Hours, and minutes so I tried something new. In this clock there are six divisions in an hour instead of five, each division representing ten minutes.
For eg. If the needle is after 12 and points the second division the time is 12:20.
The project is easy and the coding part is also quite simple

You'll Need....

- arduino: 1
- dc motor: 1
- l293d: 1
- cardboard
- breadboard or you can solder
Tools
- protractor
- computer
- scissors
- compass

Making the Dial

image.jpg
image.jpg
image.jpg
To make the dial first cut a circle of cardboard with a radius of 7cm. Then divide the circle into 4 equal sectors of 90 degrees. Mark the point as 12, 3 , 6, and 9. Then divide each sectors into three equal parts of 30 degrees each. Mark the points as 1,2,4,5,7,8,10, and 11. Then divide each sector of 30 degree into 6 equal parts of 5 degrees each. Mark them as 10,20,30,40, and 50.
Now make small hole according to your motor and fix the motor in it. Cut a needle from cardboard or fix any stick to the motor for the needle
And the dial is ready

Connecting Arduino and Motor

image.jpg
image.jpg
Connecting l293D to Arduino
- Pin 1 of l293D to enable (5v)
- pin 2 of l293D to pin 3 Arduino
- pin 3 of l 293D to pin motor
- pin 6 of l293D to pin motor
- pin 4 of l293D to ground
- pin 7 of l293D to pin 4 Arduino
- pin 8 of l293D to 5v
- pin 16 of l293D to 5v
Connect motors to 3 and 6 pin of the ic

NOTE: DO NOT CONNECT THE MOTOR DIRECTLY TO ARDUINO. IT WILL DESTROY YOUR IT.

Program

int in1=3;
int in2=4;


void setup()
{
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);

}
void loop()
{
{
digitalWrite(in1,LOW);
digitalWrite(in2,HIGH);
delay(11); // you need to change the value according to your motor speed




digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
delay(600000);

}
}

Now just upload the code, set the time and a arduino clock is ready