COLORKEY

Published

Introduction: COLORKEY

it wont be easy for them to find your secrets. Keep your secrets safe with colorkey just push three colors and the box would be open

Step 1: Where the Idea Come From?

rememeber when you where a child and you got all those magic secrets hidden from others. COLORKEY give children the easiest and funniest way to keep your secrets hidden.

Step 2: How Does COLORKEY Work?

In order to make the object functional, I used Wiring to achieve the object programming.
Each color is a pulse switch that is connected to wiring. When 3 of the 6 switches are activated; automatically wiring activates an electric lock.

Here is the code for COLORKEY:

int switchrojo = 0;
int switchverde = 1;
int switchmorado = 2;
int switchazul = 3;
int switchamarillo = 4;
int switchnaranja = 5;
int cerradura = 8;
int presionadorojo=0;
int presionadoverde=0;
int presionadomorado=0;
int presionadoazul=0;
int presionadoamarillo=0;
int presionadonaranja=0;
int times_pressed = 0;
long start_time = 0;

void setup()
{
pinMode(switchrojo, INPUT);
pinMode(switchverde, INPUT);
pinMode(switchmorado, INPUT);
pinMode(switchazul, INPUT);
pinMode(switchamarillo, INPUT);
pinMode(switchnaranja, INPUT);
pinMode(cerradura, OUTPUT);
Serial.begin(9600);
pinMode(48, OUTPUT);
digitalWrite (48, HIGH);
}

void loop() {

if(digitalRead(switchrojo) == LOW) {
while(digitalRead(switchrojo) == LOW);
presionadorojo = 1;
times_pressed++;
}
if(digitalRead(switchverde) == LOW) {
while(digitalRead(switchverde) == LOW);
presionadoverde = 1;
times_pressed++;
}
if(digitalRead(switchazul) == LOW) {
while(digitalRead(switchazul) == LOW);
presionadoazul = 1;
times_pressed++;
}
if(digitalRead(switchmorado) == LOW) {
while(digitalRead(switchmorado) == LOW);
presionadomorado = 1;
times_pressed++;
}
if(digitalRead(switchamarillo) == LOW) {
while(digitalRead(switchamarillo) == LOW);
presionadoamarillo = 1;
times_pressed++;
}
if(digitalRead(switchnaranja) == LOW) {
while(digitalRead(switchnaranja) == LOW);
presionadonaranja = 1;
}
if(millis() - start_time > 5000) {
times_pressed = 0;
presionadorojo = 0;
presionadoverde = 0;
presionadoazul = 0;
presionadomorado = 0;
presionadoamarillo = 0;
presionadonaranja = 0;
start_time = millis();
}
if(times_pressed >= 3) {

if((presionadorojo == 0) &&
(presionadoverde == 1) &&
(presionadomorado == 0) &&
(presionadoazul == 1) &&
(presionadoamarillo == 0) &&
(presionadonaranja == 1))
{
digitalWrite (cerradura, HIGH);
delay (5000);
digitalWrite (cerradura, LOW);
times_pressed = 0;
presionadorojo = 0;
presionadoverde = 0;
presionadoazul = 0;
presionadomorado = 0;
presionadoamarillo = 0;
presionadonaranja = 0;
start_time = millis();
}
}
Serial.print(presionadorojo, DEC);
Serial.print(" ");
Serial.print(presionadoverde, DEC);
Serial.print(" ");
Serial.print(presionadoazul, DEC);
Serial.print(" ");
Serial.print(presionadomorado, DEC);
Serial.print(" ");
Serial.print(presionadoamarillo, DEC);
Serial.print(" ");
Serial.println(presionadonaranja, DEC);

Serial.print(times_pressed, DEC);
Serial.print(" ");
delay(100);
}

Step 3: Wiring Board Connections


Step 4: Object Construction

In order to test COLORKEY I made a prototype in cartonboard, just to see if it really worked! The final object is made of wood.

Step 5: Easy to Use!

Just push your color key (3 colors) and the box will be open

Share

    Recommendations

    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    19 Discussions

    No, It is written in the Processing/Wiring Language. It is much simpler and easy to use, while still being powerful.

    this is very easy to open... get some dust, blow it on the box. then shake the dust off, and then you can see, which colors are touched most often. then you only have to push the 3 buttons in different combinations. (there is only 6, so its not a big deal..) Anyway, don't take this as a compliment, this is a nice idea, and really fun! :))

    2 replies

    It seems to be intended as a toy for children, so extreme security is not very important. Do you mean 'don't take this as an insult'?

    OMG YOU TOOK MY IDEA! I HAD THIS EXACT IDEA! arr welll, i wouldnt of gotten around to building it anyway haha. Nice job :)

    This looks pretty cool, where did you get the electronic lock?

    0
    user
    VIRON

    11 years ago

    This is the beta version of the lock application for Microsoft Doors.

    Marcu, can you give more details on the 'wiring' I'm very interested in this for an interactive game I'm working on - many thanks

    one could ask the same question, what is the point in posting so many negative comments on instructables if you dont do any project work yourself?

    one could ask the same question, what is the point in posting so many nagative comments on instructables if you dont do any project work yourself?

    getting tired of people complaining, myself.

    this isent a set of intructions mate. just a project u did.