Drinking Bird Clock

by MikeTheMaker in Circuits > Clocks

15993 Views, 40 Favorites, 0 Comments

Drinking Bird Clock

Clockmain.jpg


This "Hours Only" Drinking Bird Clock project is an excerpt from my iPad app, "How to Make a Science Fair Project."  The hour--in binary--is determined by the motion of the birds.  A moving bird is a "one," and a still bird is a "zero."  From left to right, the birds represent, "eight, four, two, one."

This is intended to be a simple way to get "into" microcontrollers.  No soldering is required, only wire wrapping and twisting wires together.  The electrical work is primarily done on the breadboard, so things are just "pushed" into place. 

Parts

parts picture.jpg

Parts List

 

 

(1) 12 inch x 12 inch Clear Acrylic Plexiglass Sheet—1/2 inch thick   estreetplastics.com

(4) Transistors, 2n2222a  #38236  jameco.com

(4) Drinking Birds #DB-100  teachersource.com

(4) Machine Screws, 6-32 x 3/8 inch  local hardware or amazon.com

(1)Wire jumper, 2 inch long  #126360  jameco.com

(1)Wire jumper, 4 inch long  #126342  jameco.com

(1)Breadboard, 3.25 inch x 2.125 inch  #20601  jameco.com

(1)Wire wrap wire, red  30 awg  #22631  jameco.com

(1)Wire wrap wire, blue 30 awg  #22542  jameco.com

 (1) Microcontroller, mbed lpc 1768  #568-4916-ND  digikey.com

(4) Resistors, 10 ohm, 3 watt  #PPC10W-3JCT-ND  digikey.com

(1) Power supply, 5 volt, 3 amp  #271-2583-ND  digikey.com

 

 

Tools you may not have

 

(1) Wire wrap tool  #236785  jameco.com

(1) Wire stripper  #175098  jameco.com

(1) Voltmeter  #1536843  jameco.com

 

 

Misc.  electrical tape, hook and loop fastener (tape)

Software

v19-1.jpg
The mBed LPC 1768 microcontroller includes a cable to connect to your computer.  The mBed device will act as a USB drive.  The compiler is online and instructions for signing on are included with the mBed microcontroller.  The mBed has four "built in" LED's which will illuminate left to right just as our birds bob left to right.

Type in the software listed below, then "compile" (on the mBed website; all your programming work is done "in the cloud" at the mBed website).  When you compile, the complete code will be downloaded to your computer.  Transfer this file to your MBED USB device.


#include "mbed.h"

 

DigitalOut myled1(LED1);

DigitalOut myled2(LED2);

DigitalOut myled3(LED3);

DigitalOut myled4(LED4);

DigitalOut bird1(p21);

DigitalOut bird2(p23);

DigitalOut bird3(p25);

DigitalOut bird4(p27);

 

 

int main() {

    while(1) {

                

        //seven o'clock

        myled1=1;

        bird1=1;

        myled2=1;

        bird2=1;

        myled3=1;

        bird3=1;

        myled4=0;

        bird4=0;

       

        wait (1800);

        wait (1800);

    

       

        //eight o'clock

        myled1=0;

        bird1=0;

        myled2=0;

        bird2=0;

        myled3=0;

        bird3=0;

        myled4=1;

        bird4=1;

       

        wait(1800);

        wait(1800);

       

        //nine o'clock

        myled1=1;

        bird1=1;

        myled2=0;

        bird2=0;

        myled3=0;

        bird3=0;

        myled4=1;

        bird4=1;

       

        wait(1800);

        wait(1800);

       

        //ten o'clock

        myled1=0;

        bird1=0;

        myled2=1;

        bird2=1;

        myled3=0;

        bird3=0;

        myled4=1;

        bird4=1;

       

        wait(1800);

        wait(1800);

       

        //eleven o'clock

        myled1=1;

        bird1=1;

        myled2=1;

        bird2=1;

        myled3=0;

        bird3=0;

        myled4=1;

        bird4=1;

       

        wait(1800);

        wait(1800);

       

        //twelve o'clock

        myled1=0;

        bird1=0;

        myled2=0;

        bird2=0;

        myled3=1;

        bird3=1;

        myled4=1;

        bird4=1;

       

        wait(1800);

        wait(1800);

       

        //one o'clock

        myled1=1;

        bird1=1;

        myled2=0;

        bird2=0;

        myled3=0;

        bird3=0;

        myled4=0;

        bird4=0;

       

        

        wait(1800);

        wait(1800);

       

        //two o'clock

        myled1=0;

        bird1=0;

        myled2=1;

        bird2=1;

        myled3=0;

        bird3=0;

        myled4=0;

        bird4=0;

       

        wait(1800);

        wait(1800);

       

        //three o'clock

       

        myled1=1;

        bird1=1;

        myled2=1;

        bird2=1;

        myled3=0;

        bird3=0;

        myled4=0;

        bird4=0;

       

        wait(1800);

        wait(1800);

        

        //four o'clock

        myled1=0;

        bird1=0;

        myled2=0;

        bird2=0;

        myled3=1;

        bird3=1;

        myled4=0;

        bird4=0;

       

        wait(1800);

        wait(1800);

       

        //five o'clock

        myled1=1;

        bird1=1;

        myled2=0;

        bird2=0;

        myled3=1;

        bird3=1;

        myled4=0;

        bird4=0;

       

        wait(1800);

        wait(1800);

       

        //six o'clock

        myled1=0;

        bird1=0;

        myled2=1;

        bird2=1;

        myled3=1;

        bird3=1;

        myled4=0;

        bird4=0;

       

        wait(1800);

        wait(1800);

       

   

    }

}

 

page23acrylic.jpg

     Start with a sheet of 12 inch by 12 inch acrylic (1/2 inch thick).  Mark four spots according to the template above.

23.jpg

Using a 1/8 inch drill bit, drill holes 3/8 inch deep into the acrylic.

 

 

24t.jpg

     Remove the drinking bird from his leg base and drill a 3/16 inch diameter hole in the center of the bird’s leg base.

24b.jpg

Drill 1/16 inch holes in each of the bird’s legs.

25t.jpg

Insert a resistor into the leg holes.

25m.jpg
Using a wire wrap tool, wrap a 9 inch long piece of red wire wrap wire around one end of the resistor.

25b.jpg

 

Wrap a 9 inch long piece of blue wire wrap wire around the other end of the resistor.

26t.jpg

  Using a  6/32 X 3/8 screw, fasten the bird’s leg base to the acrylic sheet.

26m.jpg

Do the same with the other 3 birds.  Notice that  the adjacent ends of the resistors touch.  In the world of electricity, this is not a good thing.  It is called a “short circuit.”

26b.jpg

 

     Bend the resistor wires toward the back of the bird to solve the problem.

27t.jpg

 

  Now the four bases should look like the picture above with a red wire on one end and blue on the other of each bird.

27m.jpg

Insert the bird bodies into the leg assemblies.

27b.jpg

 

    Place the microcontroller onto the center of the breadboard.  The silver colored end of the

microcontroller should be at the top of the breadboard.

28t.jpg

 

  Carefully push the microcontroller into the breadboard.  It will be a snug fit.  Be certain that all the pins are aligned with holes; you don’t want to bend a pin.

28m.jpg

Cut the end of the wire coming from the 5 volt power supply. Separate the cable into it’s two component wires. Remove about ½ inch of black insulation from each of the wires using a wire stripper.



28b.jpg

  Separate the two exposed copper ends of wire.  Plug the power supply into the wall. You can touch the copper wires, five volts will not hurt you.  Don’t let the wires touch each other, as this could damage the power supply.  Touch the wires to the probes of a voltmeter (voltmeter set on DC voltage).  If the needle on the meter moves to the right, then the wire touching the probe is positive.  If not, reverse the wires.  When the needle on the meter moves to the right, the wire touching the red probe is positive.  Mark that wire  “+” with a label or tape.

29t.jpg
d29a.jpg

Wrap the “+” wire you just marked to one end of a 4 inch long red  jumper.  Make this connection as tight as possible.

29m.jpg

Wrap this connection with electrical tape.

29b.jpg
d29b.jpg

Plug the other end of the 4 inch red jumper wire into the breadboard—next to the red line on the right side.

30t.jpg
d30a.jpg

Wrap the other power supply wire to one end of a 4 inch long black jumper wire.  Tape this connection.  Plug the open end of the black jumper wire into the breadboard on the left side.

30m.jpg
d30b.jpg

Plug one end of a 2 inch long jumper wire into the hole next to pin number one of the microcontroller

30b.jpg
d30c.jpg

 

Plug the open end of the 2 inch long jumper wire into a hole on the left side of the breadboard (in the column with the previously inserted black wire).

31t.jpg
d31a.jpg

Plug one end of a 2 inch long jumper wire into a hole on the right side of the breadboard, in the column under the previously inserted red wire.

31m.jpg
d31b.jpg

Plug the other end of the 2 inch jumper wire into  a hole next top in number 2 of the microcontroller

 

31b.jpg

Plug the power supply into an outlet.  The microcontroller should turn on and three LED’s on the lower left should be illuminated.  Unplug the power supply after you have seen that it works.

32t.jpg
d32a.jpg

 

Plug one end of a 2 inch long jumper wire into the bottom left corner of the breadboard.

32m.jpg
d32b.jpg

Plug the other end of the 2 inch long jumper wire into the lower right hand corner of the breadboard, next to the blue stripe.

32b.jpg
d32c.jpg

Using the wire wrap tool, take a red wire from bird number one and wrap it around one end of a 4 inch long red jumper wire.


33t.jpg
d33a.jpg

 

Attach the red wires from birds two, three and four to the same place you just attached bird number one’s red wire.

33m.jpg
d33b.jpg

Take the other end of this red jumper wire and insert the pin into the lower right side of the breadboard, next to the red line.

33b.jpg

Turn a transistor over and examine the wire legs.  Take the leg that is opposite the tab and bend it out to the side. This leg needs to be bent up—it will not be going into the breadboard.  It is ok if it touches the metal side of the transistor’s case.

 


34t.jpg
d34a.jpg

Insert a transistor in the breadboard next to pin number 21. The leg next to the tab goes into a hole next to the blue line (second hole from the right side). 

34m.jpg
d34b.jpg

Take a blue wire from bird number one and wire wrap it to the transistor leg that you bent in an earlier step.

34b.jpg
d34c.jpg

Take another transistor and attach it next to microcontroller pin number 23 in a manner similar to the last transistor.  Wire wrap a blue wire from bird number two to this transistor.

35t.jpg
d35a.jpg

 

Repeat this step with a transistor next to microcontroller pin number 25.  Wire wrap a blue wire from bird number three to this transistor.

 



35m.jpg
d35b.jpg

Repeat this step with a transistor next to microcontroller pin number 27.  Wire wrap a blue wire from bird number four to this transistor.

36t.jpg

The breadboard is backed with an adhesive strip.  Remove the paper backing and place the breadboard on the acrylic in its final position. 

35b.jpg

Remove the “+” tag from the power supply wire (it’s ugly).

36m.jpg

Take a one inch long strip of a “hook and loop” fastener and attach (remove the paper backing to expose the sticky side) it to the acrylic.

36b.jpg

Place the power supply wires on the fastener and secure the wires by pressing down the other side of the “hook and loop” fastener.

37lt.jpg

Press the wires down and arrange them so that the clock looks neat.  Plug the clock in and it will start running—displaying seven o’clock (the right three birds will bob).  There is no way to set the clock (that would have required more parts and programming).  You must start the clock at 7 A.M. or 7 P.M. if you want it to display time correctly.  If you want to really confuse your friends (they will probably have enough trouble reading the time using binary numbers), start the clock at a different time—like four o’clock—and mentally subtract three hours from the time displayed. Have fun!

For more detail--and a little fun--the iPad app, "How to Make a Science Fair Project" tells you more. http://itunes.apple.com/us/app/how-to-make-a-science-fair/id433405652?mt=8