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.

  • 1,522 views
  • 18 comments
  • 10 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 Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,737 views
  • 42 comments
  • 238 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,521 views
  • 95 comments
  • 671 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,333 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 196,001 views
  • 154 comments
  • 1,363 respects
Add projectSign up / Login