loading
This is my interpretation of the stereotypical time bomb that you see in so many cheesy action movies. The hero has to figure out which line to cut to stop the timer and keep the bomb from exploding.

In this case, we have 3 wires. One wire stops the timer (yay!), another wire speeds up the timer (panic!), and a third wire sets the timer to zero (uh-oh!).

This instructable is a sequel to my basic clock instructable: https://www.instructables.com/id/Arduino-Clock-using-Standard-Clock-Display/ 
and it is basically a port of a project I did last summer for the XL_Star board from element14.com: http://www.element14.com/community/people/ntewinkel/blog/2011/08/30/the-crazy-countdown-timer-is-complete

The main difference from the basic clock is that I added 3 button inputs that are handled by some jumper wires instead of buttons, and I updated the software.

The software now counts down, check the wire status, and add the required code to do the right thing based on wires cut, as well as adding the final action when the timer hits 0.

Step 1: Parts

For this Instructable, you will need:

1 Arduino (I used an Arduino-nano)
1 LTC-617 clock display (you might need to solder male headers onto it)
many jumper wires
1 button
4 resistors: 10k or close (to prevent short between gnd and 5v on button press, and for the "crazy wires" buttons)
(optionally) Something to make an interesting action for when the clock hits zero.

For me this was a no-cost project as I already had all the parts.
The clock display was part of a grab bag I bought long ago. I imagine they should be very inexpensive and might even be salvageable from old clock radios.
Little buttons and resistors are also salvageable from old electronics (reset buttons from old computers, for example), and also very inexpensive to purchase.
The Arduino starts at around $15 on eBay, though I would expect anyone would be unlikely to ever use it for only just this one project, unless you really do use it with a large amount of explosives ;)

I used a breadboard for easy connections, but that's not necessary.

Step 2: Make the Connections

There are quite a few wires that need to be hooked up, but if you go carefully and double check each line as you hook it up, it should be pretty straightforward. If you have already built the Arduino Clock from my earlier Instructable, you just need to add the 3 crazy wires, and you need to move the button to A5. For the clock I had it on A4, but it makes sense to keep the 3 crazy wires together.

I'm assuming you already know the basics of getting your Arduino going, so I won't get into those details. If not, there are a lot of nice examples online to get you started (I like the ones at oomlout.com).

Here are the connections that need to be made. On the left is the pin of the LTC, on the right is the Arduino pin. For example, LTC pin 4 is connected to Arduino pin digital7. nc means that pin of the LTC is not connected to anything.
For more details on the LTC connections, please refer to my Arduino Clock Instructable: https://www.instructables.com/id/Arduino-Clock-using-Standard-Clock-Display/

The button is connected in the usual buttony way using a pull-down resistor which connects the pin to gnd for LOW, and the button when pressed connects it to 5v for HIGH. As a side effect, pressing the button also connects 5v to gnd, which is why we need that 10k resistor to keep it from being a short.
The Crazy Wires are connected just like the button, with a connected wire being always HIGH as if the button was pressed. I used 2 jumper wires: one m-m and one m-f so that it can be easily disconnected in the middle. The jumper wires connect the pin to 5v, and the pin is also connected with a 10k pull-down resistor to gnd to make it a proper LOW when the main jumper wire is disconnected.

LTC - Arduino
1 - nc
2 - nc
3 - nc
4 - d7
5 - d3
6 - d2
7 - d11
8 - d10
9 - d4
10 - gnd
22 - d9
23 - d5
24 - d6
25 - A0
26 - d8
27 - d12
28 - A1
29 - gnd

button:
5v - button - A5 - 10k resistor - gnd

crazy wires:
5v - red jumper wire - A4 - 10k resistor - gnd
5v - blue jumper wire - A3 - 10k resistor - gnd
5v - yellow jumper wire - A2 - 10k resistor - gnd

Action:
pin D13 is already hooked up to an LED

I didn't have space near the Arduino, so in the picture you'll see that the button is connected through a few extra jumper wires.

Note that pin 1 on the clock display is at the bottom left (the pins are under the display area), and every hole counts, even the ones that don't have any connections. On this LTC display, "pins" 11 to 21 are just holes.

Step 3: Install (upload) the Software

The final step is to download the attached software sketch, and upload it to your Arduino.

That's all there is to it - you now have your very own Crazy Countdown Timer!

You can press the button to set the time. Hold the button down to set it quickly. If you hold it for longer than 5 seconds, it will go 10 times as fast.

The centre hour:minute colon blinks for the seconds when there is more than an hour left on the countdown timer, otherwise it displays minutes:seconds and the colon remains steady.

The software has some comments to help you figure it out, but essentially it keeps track of time by checking the value of millis(), and every time 1000 millis have gone by it counts down by 1 second. Millis() returns the number of milliseconds since startup.
When in panic mode, it counts down 10 times as fast - decrementing the second indicator every 10th of a second.

As with my earlier Arduino Clock Instructable, this won't be as accurate as using a real time clock (RTC), but it's good enough for our countdown timer.

When the timer hits zero, the action right now is to turn on the LED that is already connected to D13 (you can see it light up in the video when I disconnect the red wire). Since the pin will provide 5 volts, you can actually also use it to do other actions, like turning on/off a relay or even running a little sound gadget from an old greeting card, for example. You could also modify the code to do more interesting things - for example, you could connect a speaker or buzzer and use the Arduino Pitches library to make a noise (see the Arduino's built-in Digital-Tone_Melody example).

Enjoy!

Step 4: Adding an External Action

To give an example of an external action, I connected the inside sound bits of a greeting card to the action pin.

It's actually quite easy to do - the Arduino action pin and gnd take the place of the battery, and magically it all works :)

In the video you'll see I soldered 2 header pins to the sound circuit to make it easy to connect. One pin is on the + side of the battery holder, and the other is on the -'ve side.

Connect the + side to pin D13, the action pin.
Connect the - side to gnd.

Now when pin D13 goes on (high) as the timer hits zero, it provides 5 volts to the sound gadget, and viola! Annoying sounds are the price of letting the timer hit zero!

<p>Hi. Can you help me to use LTC-637D1P-12S??</p><p>Thanks</p>
Wow great projet for fun. Thaks for share. I want to change it little bit according to my requirement. Two switch. One for add the 5 min in the timer by press it every time. And other to play/pause the timer. And i will ise tm 1637 digital tube. Will u help me with it? <br>Thanks
<p>I am working on very similar project but I am having issues with the wires not detecting when they have been pulled. I sometimes have to wiggle the wire to get it to &quot;notice&quot; its unplugged. Did you experience this at all? I am going to have less issues if I solder the wires directly into the board?</p>
<p>I'm trying to figure out how to modify the code so that it starts after a button press- but am not having much luck...any advice? Want to be able to see the display, and adjust the time, but not have it start counting down until I want it to.</p><p>I tried changing the state of the timer_paused variable based on an input, but that didn't do anything, at least not the way I tried to implement it! </p>
<p>Hi Dave,</p><p>I think you can just do that with a while loop at the top of the loop() function.</p><p>Something like this, assuming you have added a proper start button:</p><p>while (digitalRead(STARTBUTTON) == LOW) {</p><p> clock_show_time(hours, minutes);<br>}</p><p>Hope that helps :)</p><p>Cheers,<br>-Nico</p>
<p>I will use the crazy countdown timer but</p><p>we will help me for make the timer with 2 set points<br>one timer select by a switch 30 min and 15 min to 0</p>
<p>I used mega 2560 and it works fine :)</p>
<p>Perfect! just perfect my friend, thank you very much, the code works great with no problems, even when i used 4 common cathode displays! i've just changed the code a bit and added some npn transistors but still works great.</p>
<p>Here is mine construction</p>
<p>Awesome! Thanks for sharing the pic :)</p>
<p>Hi, I need to do a timer with a button that start every 30 mins in one push and with other button countdown selected timer; like a coin machine but I dont know how to do</p>
<p>can I use a normal 7 segments 4 digit display (like this one: <a href="http://www.hobbytronics.co.uk/4digit-7segment-wh" rel="nofollow">http://www.hobbytronics.co.uk/4digit-7segment-wh</a>)</p><p>thankyou.</p>
<p>I just found a discussion in the related clock instructable: <a href="https://www.instructables.com/id/Arduino-Clock-using-Standard-Clock-Display/2/?lang=es" rel="nofollow">https://www.instructables.com/id/Arduino-Clock-usin...</a></p><p>The display I used is Common Anode. So any 4 digit common-anode display will work as long as you connect the wires to the right segments and digits.</p>
<p>You could. The clock display I used doesn't have any smarts built-in, so as long as the connections are the same it should all work the same. The tricky thing is that some displays are common anode, and some are common cathode. I forget what this LTC display is, but the code and connections could be changed a tiny bit to make either one work. The trick is that each digit is controlled by a single IO pin.</p>
<p>Hi,</p><p>Love this! Will do pretty much what I need! Just wondering, can this do hours too?</p>
<p>Yes, it does hours. If I recall correctly it will show hours:minutes until hours is 0 and then it shows minutes:seconds. And I think when showing hours the dot flashes for every second.</p>
<p>Is there a wiring diagram?</p>
Nope, sorry. Just a wordy explanation of connections in step 2 ;)<br>If you want to create one using Fritzing or something, please share and I'll be more than happy to look it over.
Hi <br>So the red wire goes to the A4 leg and teh 10K resistor goes there too? <br>5V-&gt;wire-&gt;A4+resistor-&gt;GND?
That's correct. the resistor is a pull-down resistor. When the wire is connected, the pin sees 5v, but when the wire is not connected, we need the resistor-to-ground to make the pin see 0v. Without the resistor connecting to ground, that pin would be not-connected or &quot;floating&quot; which can cause odd results. We need a pretty decent value resistor there to make sure we don't get a straight 5v to gnd short :) <br>This tutorial might explain it better: http://www.oomlout.com/oom.php/products/ardx/circ-07 <br> <br>ps, I later learned that the Arduino has internal pull-up and pull-down resistors that can be used. So instead of those physical resistors the code could be changed to use the internal resistors.
Thank you.
can anyone help cant download this as an .ino file i am rather new to this.
You should be able to right-click and save the file that's linked at the bottom (underneath &quot;Enjoy&quot;). Or just click on it, then copy and paste all of the contents into a blank Arduino window. <br> <br>Cheers, <br>-Nico
thanks i have managed to change the file extention it now shows as a .ino file but arduino 1.0.5 doesnt like it cant open in in the arduino program. sorry this is my first every project. it the prefect thing i need but i think i kind of have no idea what i am doing
ok finally getting it to show but when i verifiy it i get crazytimer:12: error: stray '#' in program any ideas anyone <br> <br>sorry to be a pain
working like a dream now <br> <br>mate sorted problems can wait to put it in is box and use it in a game
Awesome! I'm happy to hear that. Sorry I wasn't able to help much more - it's been quite busy here.<br><br>If you're new to Arduino and would like some more easy tutorial style circuits to try out, I highly recommend this Oomlout one:<br>http://www.oomlout.com/a/products/ardx/<br>You don't have to buy the kit, it just makes it easier to get all the parts, but it's much less expensive to source the pieces separately (like on eBay, for example).<br><br>If you need help on any of your future projects, element14.com has a great forum with some very helpful people there.<br><br>Cheers,<br>-Nico
i was wondering if you would be interested in selling this product to me. if interested please reply back soon and tell me your cost.
Thanks for this, I'm using it as a countdown timer and it's working awesome!! Love it!
Yes I stopped the Bomb.... ohhhh my only usb cable
so the brains behind this all in the little Arduino? <br> <br>'cause I want to make a box that locks itself from the inside, and only opens after a preset amount of time (as seen in the city of ember), but I can't figure out how to make the timer. after seeing this, I think I'll have to go Arduino. <br>could this setup be programmed so it'll count down in hours? <br> <br>anyway, good project, looks awesome!
Hi Jakobus9, <br> <br>Yes, it's all in the Arduino. It's amazing what that little thing can do! <br> <br>Do you mean counting down hours and minutes as on a clock? Because my code already does that for when the time is over an hour (it switches to minutes:seconds when it's less than an hour). <br>If you want just hours you could just use two of the digits, or swap out the clock display with a smaller 2-digit display. You'd have to modify the code a little, but everything has been done before - you'd mostly have to chop out pieces. <br> <br>Thanks for the compliments! <br>and good luck with your project :)
I have a question running about it: <br>https://www.instructables.com/answers/Time-lock-box/ <br> <br>I'm talking about weeks and months, which I think is with arduino indeed pretty easy to do. <br>though I would like to only use an arduino as last resort... you can make robots out of this little board, it would be to tempting to pull it out of my project and try to make something cool with it.
I added some ideas to your question :)
But its always the Blue wire!

About This Instructable

38,531views

66favorites

License:

Bio: Hi There! I'm a mobile app developer (iPhone and Android) in British Columbia, Canada. I also write firmware, and enjoy dabbling with electronic circuits ... More »
More by ntewinkel:Arduino Nano with WIZ550io = Easy Internet Arduino Echo Locator Crazy Countdown Timer 
Add instructable to: