Project showcase
Secret Batman Bust Switch

Secret Batman Bust Switch © GPL3+

Unlock an inconspicuous chest from across the room with a secret switch!

  • 9,293 views
  • 10 comments
  • 49 respects

Components and supplies

Ard nano
Arduino Nano R3
×2
Nordic Semiconductor NRF24L01 Radio Transciever
×2
Servo Motor
×1
Press Button Switch with LED
×1
12V Solenoid
×1
5V Relay Module
×1
Panasonic eca2am101
Capacitor 100 µF
×2
Adafruit industries ada830 image 75px
4xAA battery holder
×1
Adafruit industries ada63 image 75px
9V 1A Switching Wall Power Supply
×1

Necessary tools and machines

3drag
3D Printer (generic)
70y8518 40
Drill / Driver, Cordless

Apps and online services

About this project

My purpose with this project was to become more familiar with the nRF24L01 radio transceivers as well as Fusion 360 and 3D printing. This was also my first attempt to document my building process for a video (it's a lot harder than I thought so please bear with me).

In the original Batman TV show he had a Shakespeare bust with a secret button that, when pressed, gave access to the Bat Cave. Lacking the infrastructure for that, I designed mine to simply unlock and open a box.

* If you enjoyed the video please consider checking out my channel. I've got several more projects in progress and they might not all be posted here. Thank you and let me know in the comments your thoughts and questions. :)

I designed in Fusion 360 and 3D-printed the pieces I needed for the bust and the hardware needed to actuate the box (The Batman statue I got from Thingiverse and customized it to fit my needs: https://www.thingiverse.com/thing:1912100).

The box must be plugged in and the switch on the battery pack under the bust needs to be switched on. While powered on, the bust is continuously transmitting a binary signal of the button's pressed state. When the button is pressed, the box will engage the solenoid (unlock), move servo from closed to open position, and then disengage the solenoid (lock). When the button is pressed again the procedure is preformed the same but with the servo moving from the open to the closed position.

Initially the box was listening for a single transmission to determine if the button state had changed but this wasn't reliable and the box would open or shut erratically. Too fix this I included a loop in the receiver code that would read 5 transmitted signals and determine whether they all matched (all 1 or all 0) before opening/closing the box. This drastically improved efficacy as it eliminated most extraneous signals without affecting response time.

Code

Button and Box CodeArduino
The first section is for the arduino in the bust. The second section is for the arduino in the box.
/* Secret Bust Button
 * Bust
 */
#include <SPI.h>
#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";

const int buttonPin = 9;
bool buttonState;
//bool prevButtonState = 0;

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();

  pinMode(buttonPin, INPUT);
}

void loop() {
  buttonState = digitalRead(buttonPin);
  Serial.println(buttonState);

  radio.write(&buttonState, sizeof(buttonState));
  }
  
  
  
  
  /* Secret Bust Switch Project
 * Box Code
*/

// Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>

// Create Objects
RF24 radio(7, 8); // CE, CSN
Servo servo;

// Declare Variables
const byte address[6] = "00001";
bool buttonState;
const int solenoidPin = 4 ;
const int servoPin = 3;
bool lidOpenState = false;
int pos;
int prevButtonState;

void setup() {
  Serial.begin(9600);                       // Start Serial Monitor
  radio.begin();                            
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();                   // Start Listening for radio transmission
  pinMode(solenoidPin, OUTPUT);
  digitalWrite(solenoidPin, HIGH);          // Release (Lock) Solenoid
  servo.attach(servoPin);                   
  servo.write(5);                           // Home Servo to 0 Deg (Box Closed Position)
  delay(1000);                              // Wait one second
  servo.detach();                           
}

void loop() {
if (radio.available()){
  radio.read(&buttonState, sizeof(buttonState));
  prevButtonState = buttonState;
  for (int n=0; n=5; n++){
    radio.read(&buttonState, sizeof(buttonState));
    delay(50);
    if (prevButtonState != buttonState){
      n = 0;
    }
  Serial.print("Button State:    "); Serial.println(buttonState);
  Serial.print("Lid Open State:    "); Serial.println(lidOpenState);
  if (buttonState == true && lidOpenState == false){          // If bust switch is pressed and lid is closed...
    openLid();                                                // Open lid seqence...
    lidOpenState = true;                                      // Lid is now open
  }
  if (buttonState == false && lidOpenState == true){          // If bust switch is unpressed and lid is open...
    closeLid();                                               // Close lid sequence...
    lidOpenState = false;                                     // Lid is now closed
  }
}
//delay(100);
}
}
/*
------------------------------------------------------------------------------------------------------------------------------------
                                                    Open lid sequence
------------------------------------------------------------------------------------------------------------------------------------
*/ 
void openLid(){                                               
    Serial.println("Opening");
    digitalWrite(solenoidPin, LOW);              // Engage(unlock) Solenoid
    servo.attach(servoPin);                                   
    delay(500);
    servo.write(180);
    delay(1200);
    servo.detach();
    digitalWrite(solenoidPin, HIGH);            // Solenoid is in released (locked) position
}

/*
------------------------------------------------------------------------------------------------------------------------------------
                                                    Close lid sequence
------------------------------------------------------------------------------------------------------------------------------------
*/ 
void closeLid(){                                              
    Serial.println("Closing");
    digitalWrite(solenoidPin, LOW);                             // Engage (unlock) Solenoid
    servo.attach(servoPin);
    delay(500);
    servo.write(5);
    delay(1200);
    servo.detach();
    digitalWrite(solenoidPin, HIGH);                          // Solenoid is in released (locked) position 
}

Custom parts and enclosures

Bust_Statue
batman_bust_statue_v6_gK6Vajboxv.step
Bust_Pedestal
batman_bust_pedastal_v2_HTo7Ho0Rm3.step
Bust_Pedestal_Top
batman_bust_top_v3_pXtWvR6hma.step
Gear Mechanism
gear_mech_v1_9O5XsNsXYX.step
Servo Mount
servomount1_v2_TwY5EhRXdp.step

Schematics

Bust Switch Electronics
secret_button_bust_box_FFMScjiloT.fzz
Box Electronics
secret_button_bust_box_gLGlpclU7z.fzz

Comments

Similar projects you might like

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 58,234 views
  • 122 comments
  • 188 respects

Convert Your Old Phone to a Remote Switch

Project tutorial by Vishwas Navada

  • 11,255 views
  • 5 comments
  • 39 respects

IR Remote Controlled Power Switch for Rapsberry Pi 3

Project tutorial by Vilém Kužel

  • 1,404 views
  • 1 comment
  • 7 respects

How to control your light switch from your smartphone?

Project in progress by Mahmoud Ahmed

  • 23,098 views
  • 3 comments
  • 15 respects

IoT Treat Dispenser For Pets

Project tutorial by Arduino “having11” Guy

  • 13,384 views
  • 0 comments
  • 48 respects

CNC Part Picking Machine

Project tutorial by Arduino “having11” Guy

  • 6,297 views
  • 1 comment
  • 11 respects
Add projectSign up / Login