Drinking Bird Clock
Parts
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
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);
}
}
Start with a sheet of 12 inch by 12 inch acrylic (1/2 inch thick). Mark four spots according to the template above.
Using a 1/8 inch drill bit, drill holes 3/8 inch deep into the acrylic.
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.
Drill 1/16 inch holes in each of the bird’s legs.
Insert a resistor into the leg holes.
Wrap a 9 inch long piece of blue wire wrap wire around the other end of the resistor.
Using a 6/32 X 3/8 screw, fasten the bird’s leg base to the acrylic sheet.
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.”
Bend the resistor wires toward the back of the bird to solve the problem.
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.
Insert the bird bodies into the leg assemblies.
Place the microcontroller onto the center of the breadboard. The silver colored end of the
microcontroller should be at the top of the breadboard.
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.
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.
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.
Wrap the “+” wire you just marked to one end of a 4 inch long red jumper. Make this connection as tight as possible.
Wrap this connection with electrical tape.
Plug the other end of the 4 inch red jumper wire into the breadboard—next to the red line on the right side.
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.
Plug one end of a 2 inch long jumper wire into the hole next to pin number one of the microcontroller
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).
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.
Plug the other end of the 2 inch jumper wire into a hole next top in number 2 of the microcontroller
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.
Plug one end of a 2 inch long jumper wire into the bottom left corner of the breadboard.
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.
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.
Attach the red wires from birds two, three and four to the same place you just attached bird number one’s red wire.
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.
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.
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).
Take a blue wire from bird number one and wire wrap it to the transistor leg that you bent in an earlier step.
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.
Repeat this step with a transistor next to microcontroller pin number 25. Wire wrap a blue wire from bird number three to this transistor.
Repeat this step with a transistor next to microcontroller pin number 27. Wire wrap a blue wire from bird number four to this transistor.
The breadboard is backed with an adhesive strip. Remove the paper backing and place the breadboard on the acrylic in its final position.
Remove the “+” tag from the power supply wire (it’s ugly).
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.
Place the power supply wires on the fastener and secure the wires by pressing down the other side of the “hook and loop” fastener.
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