Introduction: Make an Arduino Timer
This project is based on the ardweeny from solarbotics because its cheap (10 $) and its small (28 DIP)
it counts down from 999 to 0 (seconds)
it has a 250V 10A Relay.
here is a short video of it counting down from 30 to 0:
Step 1: Parts List
Ok so here is the parts list:
as for all items these are suggestions
*one Ardweeny (or an ATmega168/328 chip with apropriate chrystal, resistor and capacitor)
*one USB to FTDI Adapter for programming the ardweeny (if you dont already have one)
*8 NPN transistors capable of driving 30 mA each. (We used BC547 (keep the pinout in mind!)
*3 PNP transistors capable of driving 200mA each. (We used BD136 (Odd pinout here too!!)
*3 7-Segment displays (We used KINGBRIGHT SA52-11EWA common anode)
*11 resistors for the transistor bases (i used 200 ohm resistors (!!!OBS these are not on the print, see picture in step:[comming soon])
*7 resistors for the segments (150 ohms for an output of around 20 mA)
*2 10 pin header
*2 2 pin header
*1 28 DIP socket, narrow (you could solder the chip in but i would hate to have to solder it out if something gets burned!)
*1 6V relay (if you need this to switch things on and off)
*one protective diode (We used some 1N4007 ones we had lying around)
*1 Potentiometer (We used a 4k7 because we had one around)
*Wires... lots of wires
That should be it. on to the next step
ok, so we made this on perfboard (not having any PCB´s)
we have made a Print that you could use on you PCB´s
its in .fzz so you will need fritzing (a free awesome program) to open it
it has the layout,
keep in mind that on this pcb ALL transistors are layed out as Emitter Base Collector, however when using BC547 and BD136 transistors the pinouts will be different.
if you making this on a perfboard, you can use the method we did:
Solder your stuff on the board, and when you are done, put in the arduino (ardweeny)
remember the resisters for the transistors (forgot those in fritzing.
i attached mine like this:
then, the code!
the code is on pastebin:
just copy the raw copy/paste at the bottom.
in the top part, you then setup the pins you are gonna use,
just replace the variable disp1 with the pin your first displays anode is hooked up to
as the code are right now, it just starts after 10 seconds, how ever, deleteing the line: delay(10000); will remove that delay, and further more removeing the two // infront of the lines:
//currentButton = deBounce(lastButton); //Using the debounce function to see if the button has been pushed
//if (lastButton == LOW && currentButton == HIGH)
and in the end
will enable you to use a button, with a pulldown resistor on.
hope you can use this, peace out :D
We have a be nice policy.
Please be positive and constructive.