Introduction: Arduino Clock With a Dc Motor (single Needle)

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

Step 1: You'll Need....

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

Step 2: Making the Dial

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

Step 3: Connecting Arduino and Motor

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.

Step 4: 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

Comments

author
MohamedF97 (author)2016-08-17

If I want to use this idea to make DC-Motor rotate 180 degrees every time i enter this function in my code would it work ?

author
pj200 (author)MohamedF972016-08-18

ya, it will work but you may have to mend the timing and the code a bit according to your needs

Thanks for reading

Pj

author
Kaustav Nandy (author)2015-10-28

If any one wants to have a more accurate clock then they may use stepper motor :)

nice work @pj

author
NoPinky (author)2015-10-26

This could work, but it is highly inaccurate and unreliable. What you acually do is giving the DC motor a pulse of about 11ms and it will turn by a certain degree which varies. For someone who want to built this, he has to find out for himself how long the pulse have to be depending on his motor (given he also feeds 5V to his DC motor).

I expect it to have serious drifts after a while. But yes... it somewhat works.

author
pj200 (author)NoPinky2015-10-27

hi , nopinky thanks for reading the instructables. I will make changes according to your comments and mention the type of motor used. As far as accuracy is concerned the watch is quite accurate and gives precise time

author
pj200 (author)2015-10-24

thanks for the appreciation

author
bhavik zure (author)2015-10-23

that one is simple and super, thanks for sharing

author
pj200 (author)2015-10-18

Thanks a lot

author
pj200 (author)2015-10-18

Thanks

author
chrisjlionel (author)2015-10-18

super.

author
farooqkhan (author)2015-10-16

nice

:) :))

it works!

About This Instructable

8,056views

60favorites

License:

More by pj200:Interactive Plant Mood DetectorTelephone Booth BOSEBuild SpeakerBig Ben BOSEBuild
Add instructable to: