Instructables

Arduino Ticking Time Bomb

Picture of Arduino Ticking Time Bomb
While fooling around with my arduino, I was inspired to make a ticking time bomb like one in movies and cartoons. When a switch is flipped, it counts down from ten on a LED display, beeps at an increasing pace, and lights an electrical igniter or incandescent light when it reaches zero.

This device is intended for theatrical and entertainment purposes only! Do NOT use this for evil.
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

You will need:

-A two digit LED display
-8 220 ohm resistors
-1 68 ohm resistor
-1 100 ohm resistor
-2N3906 transistor
-TIP31 transistor
-20 male pin headers(optional)
-SPDT toggle switch
-Bolts & nuts/banana jacks/binding posts(you decide, I'll discuss this later)
-A tone buzzer
-A low voltage electrical igniter(optional)
-Perf board
-5 x 2.5 x 2 project box(optional)
-An Arduino
-Power supply for Arduino
-22 gauge hookup wire

The total cost comes to around $8 or $13, depending on whether or not you use the project box.

Also, this design is only capable of lighting a very low power electrical igniter or light. If you want anything that uses more power, you will have to use an external power supply.

Step 2: Testing

Picture of Testing
If you have ordered the LED display that I did, it should have the same pinout. C1 is the common anode pin for the left digit, and C2 is the common anode pin for the right digit. When positive is connected to pin C1 and negative to pin 1, LED 1 on the LED display would light up. You should make sure that each pin lights the correct LED before proceeding. When testing the device, remember that this display is designed to use 2.2 volts. I used a two AA batteries and a 68 ohm resistor for testing.
69fordf1003 months ago
I'm new to this so I definitely would.
seraine (author)  69fordf1002 months ago

Hi,

Sorry it took me so long, I accidentally missed your reply. This code reads a momentary switch, counts down from five by blinking a led, and then turns on a green light and a solenoid for a second, and then resets. It is only the loop portion, so the setup and beginning will still need to be changed.

If you have a basic knowledge of Arduino, or an hour of time to learn, you should be able to fill in the rest. Otherwise, just reply and I should be able to help you out.













void loop( ) {

digitalWrite(countdownLED, LOW);
switchState = digitalRead(switchPin);

if (switchState == HIGH) {

for (int i = 0; i < 6; i++) {

digitalWrite(countdownLed, HIGH);
delay(500);
digitalWrite(countdownLed, LOW);
delay(500);

}
digitalWrite(greenLed, HIGH);
digitalWrite(solenoid, HIGH);
delay(1000);
digitalWrite(greenLed, LOW);
digitalWrite(solenoid, LOW);
} else {
delay(10);
digitalWrite(greenLed, LOW);

digitalWrite(solenoid, LOW);

}

}
69fordf1003 months ago
I love this design and need a little help tweaking it. I have a pinewood derby track setup and I'm wanting to use a solenoid to start the race. Here's what I was thinking. Momentary switch to start timer, at 0 green led and solenoid would start race and hold for a short time and reset automatically till momentary is hit again to start next race. Is this possible with your design? Thanks
seraine (author)  69fordf1003 months ago
Yeah, it is certainly possible. Would you need any help writing the code?
11mh4 months ago
Cool project! I am in the process to make one of these, too.

Once the timer is counted down to 0, the time bomb starts over again after a couple of seconds. I wonder how you could make the time looping stop, so that the timer does not start off from itself again. It would be awesome if the timer runs once when the time bomb is switched on.

I am thankful for any hints!

seraine (author)  11mh4 months ago
The easiest way would be to change this line of code at the end of the loop, "delay(9000);", in to this:

if (1==1) { delay(10000); }

This will delay forever, and you will need to unplug the arduino in order to break the delay, unless you add some code. Of course, this will leave the display on and displaying 0. If you want to shut it off, you should turn off all leds and then delay forever. To turn all leds off, use this code:

digitalWrite(light, HIGH);
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(oneLed, HIGH);
digitalWrite(beep, HIGH);
11mh seraine4 months ago
Thanks seraine!

What would be the hard way? I mean, is there a way to stop the infinite delay (for instance this... if (1==1) { delay(10000); } ... ) by using a >switch< ? I would love to have it running the timer over again every time I turn it on with the switch.


seraine (author)  11mh4 months ago
It should actually be pretty simple. All you should have to do is replace the infinity delay with this code:

if (switchState == HIGH) { switchState = digitalRead(switchPin); }

This line of code should work.
Billytgoat6 months ago
Anyway I could get you to make one of these for me. I have all the stuff but I am new at all of this. If not do you have more pictures or video on hooking up the arduino to the right places. Thanks. Sanders87@hotmail.com
seraine (author)  Billytgoat6 months ago
Instead of making a step by step video of the connections, I recommend that you learn to read schematics. It is a skill that you will frequently require when working with electronics, and you really should learn to do it. Without this skill, you will be severely limited in what you can construct. There are many guides on learning to read schematics, such as this one: https://learn.sparkfun.com/tutorials/how-to-read-a-schematic/overview If there are any If there are any specific connections you are confused about, feel free to ask. However, I will not give a complete, step by step guide to every connection that must be made.
HelmutHound10 months ago
2 questions: 1 what happens if you press the button a second time? 2 any way you could tie in a keypad that would allow an input to deactivate the countdown, and activate a second circuit to play a .midi or .wav file and throw confetti in the air? lol
I am not good with circuitry, but your instructible is very informative and looks very cool!
seraine (author)  HelmutHound10 months ago
The program ignores all input while it is doing the action (beeping, changing numbers). The program begins taking input again nine seconds after the sequence finishes. To tie in a keypad, you would have to attach to your Arduino to a keypad as other Instructables have shown, and change a lot of the code. Right now, the code delays for 10-500 milliseconds while running, based on how fast it is beeping. While it is delaying, it cannot accept input, and the code would have to change to check for input about every ten milliseconds.

Throwing confetti or playing a .midi file would be much easier. In the very last number change, when the light/electronic igniter is lit, you would just have to send a signal to your confetti thrower. The hard part would be making a confetti thrower. As far as changing code/wiring goes, you would only need to add two wires and about four lines of code.
shaddoty10 months ago
Airsoft battle
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!