Introduction: COLORKEY

Picture of 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?

Picture of 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?

Picture of 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

Picture of Wiring Board Connections


Step 4: Object Construction

Picture of 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!

Picture of Easy to Use!

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

Comments

davidturner666 (author)2008-01-13

I like it- Im gonna try and do one better though. Its programmed in C or C++ isnt it?

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

frodobot (author)2009-07-09

why are the colours in the code written in Spanish?

Ian01 (author)frodobot2009-07-18

The author probably speaks Spanish.

frodobot (author)Ian012009-07-19

Probs. Hola amigo!! Que tal? El tiempo este lloviendo aqui. Hasta luego!!!

Azzurro (author)2009-07-15

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! :))

Ian01 (author)Azzurro2009-07-18

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'?

Azzurro (author)Ian012009-07-18

yes, this was what i was trying to say :)

MJTH (author)2009-05-14

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

puffyfluff (author)2008-07-18

This is an awesome idea. I love it.

sleepydog (author)2008-03-30

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

master blaster (author)2008-01-08

Very creative, very useful. If I could just get some wires...

VIRON (author)2006-09-27

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

radiorental (author)2006-05-31

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

radiorental (author)2006-05-31

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?

radiorental (author)2006-05-31

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?

radiorental (author)2006-05-31

getting tired of people complaining, myself.

latobada (author)2006-05-30

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

About This Instructable

5,052views

5favorites

License:

More by caromarcucci:COLORKEY
Add instructable to: