Close
0%
0%

Banana Bomb

A prop that looks like a bomb from the movies.

Similar projects worth following
A simple countdown timer with a beeper.

  • 3 × Bananas
  • 1 × Arduino Pro Mini 3.3V
  • 1 × Blue 4 Digit 7 Segment Display
  • 1 × Buzzer
  • 1 × Button Battery Holder

  • We Do What We Must

    de∫hipu09/05/2015 at 10:16 0 comments

    Because we can. I had a 7-segment display left over from the #Talk Ranking Machine, and this really begged to be done. Yes, it's useless, silly, and potentially even dangerous if someone left it in a public place. But it was quite fun to do too.

    Both the display and the battery holder are soldered directly to the Pro Mini -- the pinout just happens to match. There is no off switch, you just have to remove the battery. The code looks like this:

    const int GND_PINS[] = {8, 12, 13, A2};
    const int VCC_PINS[] = {A1, 11, 6, 4, 3, A0, 7, 5};
    const unsigned char DIGITS[] = {
        0b00111111,
        0b00000110,
        0b01011011,
        0b01001111,
        0b01100110,
        0b01101101,
        0b01111101,
        0b00000111,
        0b01111111,
        0b01101111,
    };
    const int BEEP_PIN = 2;
    
    
    void show7seg(int number) {
        unsigned char digit;
        div_t result;
    
        for (int d = 0; d < 4; ++d) {
            result = div(number, 10);
            digit = DIGITS[result.rem % 10];
            number = result.quot;
            for (int s = 0; s < 8; ++s) {
                digitalWrite(VCC_PINS[s], digit & (1 << s));
            }
            pinMode(GND_PINS[d], OUTPUT);
            digitalWrite(GND_PINS[d], LOW);
            delay(2);
            pinMode(GND_PINS[d], INPUT);
        }
    }
    
    
    
    void setup() {
        for (int s = 0; s < 8; ++s) {
            pinMode(VCC_PINS[s], OUTPUT);
        }
        for (int d = 0; d < 4; ++d) {
            pinMode(GND_PINS[d], INPUT);
        }
        pinMode(9, OUTPUT);
        digitalWrite(9, LOW);
        pinMode(10, OUTPUT);
        digitalWrite(10, HIGH);
    }
    
    
    void loop() {
        static long int last = 0;
        static int count = 2400;
        long int now = millis();
    
        if (now - last > 500) {
            digitalWrite(10, LOW);
        }
        if (now - last > 1000) {
            count -= 1;
            if (count % 100 == 99) {
                count -= 40;
            }
            last = now;
            tone(BEEP_PIN, 1200, 25);
            digitalWrite(10, HIGH);
        }
    
        show7seg(count);
    }
    And that's pretty much it. I might actually make it a game, by adding several wires that you have to cut, that would either stop the counter or make it go faster or something...

View project log

Enjoy this project?

Share

Discussions

ActualDragon wrote 04/02/2017 at 02:27 point

XDXD i clicked on the bomb tag and was disappointed by the project amount. we need more homeade bombs

  Are you sure? yes | no

Atwas911 wrote 10/24/2015 at 12:13 point

Good.. Now have a muslim extremist activist take this to school like with the with the suitcase "clock" and they might actually think its a bomb too.

  Are you sure? yes | no

de∫hipu wrote 10/24/2015 at 12:20 point

Excuse me? What are you babbling about? What the heck is a "muslim extremist activist" and why is he at your school? And what does it have to do with any clock? Look at the date of this project and recheck your jumping to conclusions, please.

  Are you sure? yes | no

Stefan-Xp wrote 09/21/2015 at 21:05 point

Awesome project!

But most (stereotypical) Bombs have red digits, but i also like blue the better ;)

Best regards, Stefan

  Are you sure? yes | no

de∫hipu wrote 09/22/2015 at 07:13 point

I used blue LEDs, because they take higher voltage, and I was uncomfortable connecting them without any resistors, so I wanted to limit the damage, if any.

  Are you sure? yes | no

Stefan-Xp wrote 09/22/2015 at 20:20 point

Okay, good reason. I wonder if the Batteryvoltage would exceed the Forward Voltage of the LEDs ;)

  Are you sure? yes | no

de∫hipu wrote 09/22/2015 at 21:28 point

This is a 3V button battery, it has very weak current and the voltage drops immediately when you try to draw any sensible ampers. So that's much safer than, say, a 25C LiPo :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates