Complex dummy bomb

Hi guys (and of course girls)

I'm completely new in the world of Arduino, especially the coding.
I do understand some coding from my past experience with HTML, CSS and a bit of java.

For my first project I want to build a more complex dummy bomb for airsoft/milsim purposes.

The housing will be a standard case

My device will have the following components:

  • an Arduino Uno rev 3

  • a red 8 digit LED segment bar that will countdown the time in hh:mm:ss and when under 60 min it will be mm:ss:ssss

  • a white (or green) 4 digit LED segment bar that shows the (de)activation code

  • a matrix 3x4 keypad for entering the code and countdown time

  • a key switch that is hooked up with the battery and Arduino Uno to turn the bomb on.

  • 7 wires in different colors, where 2 of the 7 will deactivate the bomb and the other 5 will add a penalty point

  • 5 red LED's that visualize the penalty points

  • a buzzer and a red LED that will beep/ blink on certain commands

  • a button with integrated red LED to arm the bomb

  • a sensor that detonate the bomb when you try to move it

  • some smoke machine fluid and a very hot transistor to generate smoke when the timer is under 1 min (optional)

  • a switch that will activate the timer when you open the case (optional)

I'm not 100% sure what kind of components i need to build this, that's why I need you guys

For the coding I'll list the scenario:

ARMING

  • open the case and put the key in the switch, turn right, this turns on the power
  • enter a 4 digit code you want
  • enter the countdown time you want in hh:mm:ss
  • the red button lights up. Press the red button to arm the bomb

Now the bomb is active and counting. You can disarm the bomb by entering the code or cut the correct 2 wires.
The bomb will explode after the timer sets to 00:00:00, if you reach 5 penalty points or if you move the case.
Penalty points are given when you enter a wrong code or cut the wrong wire. After each penalty point the timer goes faster.
While the bomb is active the red led and buzzer beeps every minute, when under 1 minute it will beep twice per second and when under 10 seconds it will beep 5 times per second.
when the timer gets under 1 min, the heat transistor starts heating up the smoke machine fluid and the device starts smoking (optional)

DISARMING

  • enter the correct code, the buzzer and red LED beeps 1 time
  • the timer shows the remaining time and the correct code

OR

  • cut the correct 2 wires
  • the timer shows the remaining time and the correct code

I think I explained everything. If any of you guys want to advice me or help me out, that will be great.
Building the device is not a problem. Getting the code right is something else :smiley:

Kind regards
Levi

coding, like anything, is just getting started and then making it work better and better.

get a starter kit that has a keypad.

dave-in-nj:
coding, like anything, is just getting started and then making it work better and better.

get a starter kit that has a keypad.

I bought myself this to start with

Hi guys

I'm back for a little update

Today I unpacked my starter kit and started practicing.

Here is the link of my result

I hope you like it :smiley:

I need some help now

I want to set the time for my timer using 2 push buttons.

One button will add 5 minutes for each press.
The other button will add 1 hour for each press.

This time should also be visible on the LCD. After a push on my start on my "buttonPin", should it continue my code.

Here is my code:

  //Arduino Complex Bomb
   //Applied_Milsim
   //Version 3.0
   
    #include <LiquidCrystal.h>
    LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
    int redLedPin= 13;
    int greenLedPin= 8;
    int buzzerPin = 6;
    int buttonPin= 7;
    int s=0; //set the seconds
    int m=5; //set the minutes
    int h=4; //set the hours
    int buttonState= 0;
    int startCountdown= 0;
    
    void setup() {
    pinMode(buttonPin, INPUT);
    pinMode(redLedPin, OUTPUT);
    pinMode(greenLedPin, OUTPUT);
    pinMode(buzzerPin, OUTPUT);
    lcd.begin(16, 2);
    Serial.begin(9600);
    }
    
    
    void loop() {
      
      if(startCountdown == 1) { //wait until you pressed the button to start
           digitalWrite(greenLedPin,LOW); // LED is OFF during countdown
           //Start timer
           countdown();
      }
      else {    
             buttonState = digitalRead(buttonPin);
             if(buttonState == LOW){ //Device has to wait for the button to be pressed
                lcd.setCursor(0,0);
                lcd.print("PRESS BUTTON TO");
                lcd.setCursor(0,1);
                lcd.print("ACTIVATE BOMB");
                digitalWrite(greenLedPin, HIGH);  
           }
            else {
                  // you pressed button, timer starts
                  startCountdown ++;
                  lcd.clear();   
                 }
           }
      }

    void countdown(){
  
  static unsigned long lastTick = 0; // set up a local variable to hold the last time we decremented one second
// (static variables are initialized once and keep their values between function calls)
 
// decrement one second every 1000 milliseconds
  if (s > 0) {
      if (millis() - lastTick >= 1000) {
          lastTick = millis();
          s--;
          serialOutput();
      }
  }
 
 // decrement one minute every 60 seconds
  if (m > 0) {
      if (s <= 0) {
          m--;
          s = 60; // reset seconds to 60
      }
  }
 
// decrement one hour every 60 minutes
  if (h > 0) {
      if (m <= 0) {
          h--;
          m = 60; // reset minutes to 60
      }
  }
  
  /*buttonStateMin = digitalRead(buttonAddMin);
     if(buttonStateMin == HIGH) {
       m ++;
     }
        buttonStateHour = digitalRead(buttonAddHour);
     if(buttonStateHour == HIGH) {
          h ++;
      }*/
 
} //close countdown();

void serialOutput() {
  digitalWrite(redLedPin, HIGH);
  delay(25);
  digitalWrite(redLedPin, LOW);
  lcd.setCursor(5,0);
  lcd.print("ARMED:");
//Print time on 2nd line
  lcd.setCursor(0,1);
  delay(100);
  //lcd.print("TIME LEFT");
  if(h >= 10) {
    lcd.setCursor(4,1);
    } else {
    lcd.setCursor(4,1);
    lcd.print("0");
    }
  lcd.print(h); // the hour, sent to the screen in decimal format
  lcd.print(":"); // a colon between the hour and the minute
    if(m >= 10) {
    lcd.setCursor(7,1);
    } else {
    lcd.setCursor(7,1);
    lcd.print("0");
    }
  lcd.print(m); // the minute, sent to the screen in decimal format
  lcd.print(":"); // a colon between the minute and the second
    if(s >= 10) {
    lcd.setCursor(10,1);
    } else {
    lcd.setCursor(10,1);
    lcd.print("0");
    }
  lcd.print(s); // the second, sent to the screen in decimal format
  
  //Red LED blinks faster when time seconds get under 60
   if(s <= 60 && m == 0 && h ==0) {
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(redLedPin, HIGH);
    delay(150);
    digitalWrite(redLedPin, LOW);
    digitalWrite(buzzerPin, LOW);
   }
   //Red LED blinks more faster when time seconds get under 10
   if(s <= 10 && m == 0 && h ==0) {
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(redLedPin, HIGH);
    delay(50);
    digitalWrite(redLedPin, LOW);
    digitalWrite(buzzerPin, LOW);
    delay(50);
    digitalWrite(redLedPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    delay(50);
    digitalWrite(redLedPin, LOW);
    digitalWrite(buzzerPin, LOW);
   }
     
//termination condition
  if (s == 0 && m == 0 && h == 0) {
      lcd.setCursor(0,0);
      lcd.clear();
      lcd.print(" BOMB EXPLODED!");
      for(int duration = 0; duration < 50000; duration ++){
    digitalWrite(redLedPin,HIGH);
    digitalWrite(buzzerPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(buzzerPin, LOW);
    delayMicroseconds(500);
    }
  }
}//close serialOutput();

Can someone help me out please?

Why do you need a "bomb" ?

It always worries me when someone wants help for a fake project that can very easily be turned into an active device.

Weedpharma

It's a movie prop or Halloween costume. No actual bomber would build a device with an easily-cuttable "red wire" and buttons to push.

How do we know we aren't actually helping you make a bomb? :fearful:

MorganS:
It's a movie prop or Halloween costume. No actual bomber would build a device with an easily-cuttable "red wire" and buttons to push.

All bombs have countdown timers and red wires! Otherwise how do we know what they are! :wink:

Weedpharma

I understand your reaction. But if it was for a "live bomb", I already have enough to make it work :smiley:

No guys, seriously. This is for my friend who organizes Milsim events (Military Simulations). Also, of you take a look to my nickname and profile pic, you can see that I play Milsim / Airsoft.

So please don't question my motives and help me instead :smiley:

Kind regards

Levi, aka not a terrorist :stuck_out_tongue:

Applied_Milsim:
This is for my friend

:wink:

Hi-

IMHO.. I'm not sure the Arduino Uno will have enough pins to control everything you want to control..

Let's try and break it down:

  • a red 8 digit LED segment bar that will countdown the time in hh:mm:ss and when under 60 min it will be mm:ss:ssss

  • a white (or green) 4 digit LED segment bar that shows the (de)activation code

** I suggest maybe using a MAX7219/7221 chips for these.. (I think that will take 3-5 pins.. cant recall off hand)

  • a matrix 3x4 keypad for entering the code and countdown time

** Not sure how many pins this takes off hand? But they are cheaply purchased off ebay for a few bucks (USD)

  • a key switch that is hooked up with the battery and Arduino Uno to turn the bomb on.

** Is only for POWER (and not to have any effect on the bomb's behavior... this is a simple power 'switch') - no pins needed, connects to power line.

  • 7 wires in different colors, where 2 of the 7 will deactivate the bomb and the other 5 will add a penalty point

** These will take up 7 more pins (yikes!)
(not sure how I would wire it up though... if wire/pin is connected to GND (or V+).. then removing it might just make the pin 'float' (ie: float = not a true hi or low value state)

  • 5 red LED's that visualize the penalty points
    ** Another 5 pins here too... seems to me you are looking at getting a MEGA or something other board with more I/O's (pins) available

  • a buzzer and a red LED that will beep/ blink on certain commands

** Another two pins.. but explain "Certain Commands"??

  • a button with integrated red LED to arm the bomb

** Another pin.. so this is different then turning the bomb on? (key switch thing above?)

  • a sensor that detonate the bomb when you try to move it
    ** Could use an accelerometer.. but that might require more pins.. and overkill?
    A simple clash sensor might work .. requires only 1 pin.. but you dont have control over sensitivity or anything. (think nail with spring around.. shakes/moves hard enough to make contact.. it'll fire whatever code you set.

  • some smoke machine fluid and a very hot transistor to generate smoke when the timer is under 1 min (optional)
    ** Now your talking about controlling a 3rd party piece of hardware.. you'll need specs?

Probably a way to power it.. and then use the Arduino to flip/trip/trigger a relay to 'do what it does'...

  • a switch that will activate the timer when you open the case (optional)
    ** A simple contact/roller-lever switch on the bow would work... but isnt the timer already counting down?

I'm pretty sure you are out of pins.. :slight_smile:

And we havent even gotten to how you plan on setting things up:

IE: - enter the countdown time you want in hh:mm:ss

How do you plan on doing the above? more buttons/switches? (more pins/resistors..etc)

You say building the thing isnt a problem? I think it'll be problematic with just an Arduino Uno thats for sure.

Could always use as '1284P. 32 IO lines, I have boards available in several form factors:
http://www.crossroadsfencing.com/BobuinoRev17/

Thank you xl97 for the reply

I'm not sure if I'm going to use all of the features I listed above.

At this moment, I managed to :

  • Power it on
  • A LCD that shows you the countdown
  • Start with 5 minutes and have a button to add 1 min and a button to add 1 hour
  • A Start button to start the countdown
  • During the countdown the red LED blinks once every second, under 60 sec it blinks twice and under 10 sec it blinks three times.
  • 1 wire you can cut to defuse to the device
  • 1 wire you can cut to detonate to the device
  • when the bomb gets to 0 or detonate wire has been cut -> Red LED goes on and speaker buzzers

That sums it up a little bit

I do not yet have a keypad, so I can't start on the "code". Also I don't have enough pins anymore.

I was thinking of buying an L2C LCD to clear up some pins and don't use led segments bar.
Would that help?

Thanks for the Advice

If you use a MAX7221 chip instead.. it will probably be the same amount of lines/pins.. and you can daisy chain then without the need for other pins (ie: you can have as 7-segment displays as you want)

I used two here:

they used the same pins from the Arduino.. even though I used two chips... (one for 7-segment ammo count and 1 for the ammo/bare graph on the 'magazine')

nice space saver that gives you control over many LEDS

And you can also use those Maxim LED drivers to drive the columns of your matrix keyboard, with appropriate resistors. Then you only need 4 input pins on the rows to decode the matrix.

Hi, did you end this proyect? I'm very interested.

Regards