Safe / Vault Cracker

Simulating the feeling of opening the vault using your feelings <3

COMPONENTS AND SUPPLIES

Rotary Encoder

1

220 Ohm Resistor

4

LED

4

ABOUT THIS PROJECT

It is more like a game. You need turn the dial to find the sweet spot. the three LED is a signal that: RED = You need to turn it more, YELLOW = You are close, GREEN = You are on the unlocking spot. Once you are on GREEN light, you can press the button (rotary encoder button/switch) and proceed to find the next unlock spot. If you got the unlocking spot right. The BLUE light will turn on. If you got on the wrong spot. All lights will blink for a second, meaning you need to start again. You need to find the unlock spot 4 times to win. You can change the “int scoreCounter” value to adjust how many times you need to get the unlock spot to win.

SCHEMATICS

COMMENTS

Comments (5)

  • Austin Eckman Reply

    Nice work!

    April 26, 2021 at 1:02 pm
  • Garry W Tidler Reply

    I had to hook up the Negative rail to ground on power supply.

    June 11, 2021 at 8:23 pm
    • Belrey Dahonog Reply

      That should be done, I can’t replace the schematics as of the moment. Updates are still done on the website. Glad you figured that out.

      June 12, 2021 at 8:37 am
  • daniel Reply

    Arduino: 1.8.15 (Windows 10), Board: “Arduino Uno”

    sketch_jun11a:53:23: error: stray ‘\342’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:53:24: error: stray ‘\200’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:53:25: error: stray ‘\234’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:53:64: error: stray ‘\342’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:53:65: error: stray ‘\200’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:53:66: error: stray ‘\235’ in program

    Serial.println(“Congratulations! You unlocked the safe”);

    ^

    sketch_jun11a:69:15: error: stray ‘\342’ in program

    counter –;

    ^

    sketch_jun11a:69:16: error: stray ‘\200’ in program

    counter –;

    ^

    sketch_jun11a:69:17: error: stray ‘\223’ in program

    counter –;

    ^

    C:\Users\Daniel\Documents\Arduino\sketch_jun11a\sketch_jun11a.ino: In function ‘void loop()’:

    sketch_jun11a:47:5: error: ‘GetScore’ was not declared in this scope

    GetScore(counter);

    ^~~~~~~~

    sketch_jun11a:49:5: error: ‘CalculateDiff’ was not declared in this scope

    CalculateDiff(counter);

    ^~~~~~~~~~~~~

    sketch_jun11a:53:26: error: ‘Congratulations’ was not declared in this scope

    Serial.println(“Congratulations! You unlocked the safe”);

    ^~~~~~~~~~~~~~~

    sketch_jun11a:76:23: error: expected ‘)’ before numeric constant

    else if (counter 10 || Diff Preferences.

    June 16, 2021 at 4:01 pm
    • Belrey Dahonog Reply

      Hi Daniel, are you having trouble running the program? drop me an email at [email protected] so I can help you

      June 25, 2021 at 2:25 am

Leave a Reply to Austin Eckman Cancel reply

Your email address will not be published. Required fields are marked *

#define CLK 6 #define DT 7 #define SW 5 #define BLUE 11 #define GREEN 10 #define YELLOW 9 #define RED 8 int counter = 0; int aState; int aLastState; int randNumber; int scoreCounter = 4; int scoreHolder = 0; void setup() { pinMode (CLK,INPUT); pinMode (DT,INPUT); pinMode (SW,INPUT); pinMode (BLUE,OUTPUT); pinMode (GREEN,OUTPUT); pinMode (YELLOW,OUTPUT); pinMode (RED,OUTPUT); Serial.begin (9600); // Reads the initial state of the outputA aLastState = digitalRead(CLK); randomSeed(analogRead(A0)); randNumber = random(100); Serial.println(randNumber); digitalWrite(BLUE, LOW); digitalWrite(GREEN, LOW); digitalWrite(YELLOW, LOW); digitalWrite(RED, HIGH); } void loop() { if (digitalRead(SW) == LOW) { GetScore(counter); randNumber = random(100); CalculateDiff(counter); if (scoreHolder == scoreCounter) { Serial.println(“Congratulations! You unlocked the safe”); scoreHolder = 0; } } aState = digitalRead(CLK); // Reads the “current” state of the outputA // If the previous and the current state of the outputA are different, that means a Pulse has occured if (aState != aLastState) { // If the outputB state is different to the outputA state, that means the encoder is rotating clockwise if (digitalRead(DT) != aState) { counter ++; } else { counter –; } if (counter > 100) { counter = 0; } else if (counter 10 || Diff < -10) { digitalWrite(YELLOW, LOW); digitalWrite(GREEN, LOW); digitalWrite(RED, HIGH); } if (Diff == 0) { digitalWrite(GREEN, HIGH); digitalWrite(RED, LOW); digitalWrite(YELLOW, LOW); } return Diff; } void GetScore(int counterValue) { if (CalculateDiff(counterValue) == 0) { digitalWrite(BLUE, HIGH); digitalWrite(GREEN, LOW); delay (500); digitalWrite(BLUE, LOW); scoreHolder = scoreHolder + 1; Serial.print("Score:"); Serial.println(scoreHolder); } else { digitalWrite(BLUE, HIGH); digitalWrite(GREEN, HIGH); digitalWrite(YELLOW, HIGH); digitalWrite(RED, HIGH); delay (500); digitalWrite(BLUE, LOW); digitalWrite(GREEN, LOW); digitalWrite(YELLOW, LOW); digitalWrite(RED, LOW); scoreHolder = 0; Serial.print("Score:"); Serial.println(scoreHolder); } }
PROJECT AUTHOR
Leave a comment
TEAM MEMBERS
Belrey

Everything

TABLE OF CONTENTS
Leave a comment
Share on whatsapp
Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on pinterest
Share on email

SIMILAR PROJECTS YOU MIGHT LIKE

I cascaded four SN74HC595 shift registers to control 32 LEDs on 4 registers using 3 wires. I am adding a I2C 20×4 LCD screen to display the register and led values. I might add a standard 16×2 LCD screen to show up it is done.
A simple light meter. It’s not calibrated to any meaningful scale, but the digital readout shows a higher number the brighter is the light falling on the photoresistor.