Project showcase
Arduino Airsoft Time Bomb with Button, Speaker and 3 LEDs

Arduino Airsoft Time Bomb with Button, Speaker and 3 LEDs © GPL3+

You activate the bomb by plugging it and hold button to defuse.

  • 2,742 views
  • 18 comments
  • 11 respects

Components and supplies

About this project

We wanted to play airsoft with the game of Defuse the Bomb, a bit like CS:GO.

I didn't have a number pad so I chose a button, and there were no button scripts out there, so I had to make my own.

With the help of my brother for a fw questions on how to script arduino since this was my first time, I got the script done, with many problems I had to fix.

ALSO PLEASE NOTICE: Plug 220c resistors for each LED. The rest will be fine.

Code

Bomb codeBatchFile
Just paste this code into your arduino, and then plug the things in as shown in the diagram.
#define red 13
#define Speaker 12
#define blue 8
#define Green 7

float times;
float delays = 1000;
float delays2 = 500;


void setup() {
  Serial.begin(9600);
  pinMode(red, OUTPUT);
  pinMode(Speaker, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(Green, OUTPUT);
  pinMode(2, INPUT_PULLUP);
  myfunction();

}



void myfunction() {

  delays2 = delays2/2.0;
  
  digitalWrite(Green, HIGH);
  tone(Speaker, 2000, delays2);
  delay(delays2);
  digitalWrite(Green, LOW);
  delay(delays2);
  digitalWrite(Green, HIGH);
  tone(Speaker, 2000, delays2);
  delay(delays2);
  digitalWrite(Green, LOW);
  delay(delays2);
  digitalWrite(Green, HIGH);
  tone(Speaker, 2000, delays2);
  delay(delays2);
  digitalWrite(Green, LOW);
  delay(delays2);
  digitalWrite(Green, HIGH);
  tone(Speaker, 2000, delays2);
  delay(delays2);
  digitalWrite(Green, LOW);
  delay(delays2);

}


void loop() {
    Serial.println(digitalRead(2));
  delays = delays/1.03;
 
  if (times < 1200){
    times += 1;
    tone(Speaker, 4000, delays);
    digitalWrite(red, HIGH);
    delay(delays);                     
    digitalWrite(red, LOW);
    digitalWrite(Speaker, LOW);   
    delay(delays); 
  }
   
     if (times == 1200){
   tone(Speaker, 500, 3000);
   digitalWrite(blue, HIGH);
   delay(19999999);
     
    }
  
      
  if (digitalRead(2) == LOW){
      times = 1230;
      digitalWrite(red, HIGH);
      delay(1000);
      digitalWrite(red, LOW);
      delay(1000);
      digitalWrite(blue, HIGH);
      delay(1000);
      digitalWrite(blue, LOW);
      defuse();

 
  } 
 

}


   

      
void defuse() {

       
      digitalWrite(Green, HIGH);
      tone(Speaker, 2000, 100);
      delay(100);
      digitalWrite(Green, LOW);
      digitalWrite(blue, HIGH);
      tone(Speaker, 1000, 100);
      delay(100);
      digitalWrite(blue, LOW);
      digitalWrite(red, HIGH);
      tone(Speaker, 2000, 100);
      delay(100);
      digitalWrite(red, LOW);
      delay(100);
      digitalWrite(Green, HIGH);
      delay(1999999);
      
}

Schematics

Bomb wires
Just follow how to plug the things in and copy the image. (The risistors are 220.)
bomb_xSrBS0qksN.fzz
Bomb wires in picture format
Use 220 resistors.
Screenshot (11) qgfww3h5rz

Comments

Similar projects you might like

Arduino Arisoft Time Bomb Game

Project showcase by Danny van den Brande

  • 14,744 views
  • 21 comments
  • 41 respects

DHT11 Sensor with LEDs and a Piezo Speaker

Project tutorial by Tech with Matthew

  • 6,180 views
  • 3 comments
  • 19 respects

You've Been Using a Button Wrong this Whole Time

Project tutorial by SMM2

  • 2,731 views
  • 1 comment
  • 3 respects

PIR Automated Intelligent Zebra Crossing

Project showcase by Adersh B

  • 2,266 views
  • 1 comment
  • 5 respects

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by Heathen_Hacks-v2

  • 1,412 views
  • 2 comments
  • 8 respects

The TrafficLight

Project showcase by Advaith Jagathesan

  • 12,843 views
  • 1 comment
  • 20 respects
Add projectSign up / Login