Nashboss100
Published © GPL3+

Arduino Airsoft Time Bomb with Button, Speaker and 3 LEDs

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

IntermediateShowcase (no instructions)8,323
Arduino Airsoft Time Bomb with Button, Speaker and 3 LEDs

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Button
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
Blue LED
×1
Buzzer
Buzzer
×1
SparkFun Solder-able Breadboard - Mini
SparkFun Solder-able Breadboard - Mini
×1
USB-A to B Cable
USB-A to B Cable
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Resistor 221 ohm
Resistor 221 ohm
×1

Story

Read more

Schematics

Bomb wires

Just follow how to plug the things in and copy the image. (The risistors are 220.)

Bomb wires in picture format

Use 220 resistors.

Code

Bomb code

BatchFile
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);
      
}

Credits

Nashboss100

Nashboss100

1 project • 5 followers

Comments