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);
pinMode(48, OUTPUT);
digitalWrite (48, HIGH);

void loop() {

if(digitalRead(switchrojo) == LOW) {
while(digitalRead(switchrojo) == LOW);
presionadorojo = 1;
if(digitalRead(switchverde) == LOW) {
while(digitalRead(switchverde) == LOW);
presionadoverde = 1;
if(digitalRead(switchazul) == LOW) {
while(digitalRead(switchazul) == LOW);
presionadoazul = 1;
if(digitalRead(switchmorado) == LOW) {
while(digitalRead(switchmorado) == LOW);
presionadomorado = 1;
if(digitalRead(switchamarillo) == LOW) {
while(digitalRead(switchamarillo) == LOW);
presionadoamarillo = 1;
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(" ");

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
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.
why are the colours in the code written in Spanish?
The author probably speaks Spanish.
Probs. Hola amigo!! Que tal? El tiempo este lloviendo aqui. Hasta luego!!!
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! :))
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'?
yes, this was what i was trying to say :)
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 is an awesome idea. I love it.
This looks pretty cool, where did you get the electronic lock?
Very creative, very useful. If I could just get some wires...
This is the beta version of the lock application for Microsoft Doors.
Check out the hardware<br/><a rel="nofollow" href="http://wiring.org.co/ioboard/index.html">http://wiring.org.co/ioboard/index.html</a><br/>software<br/><a rel="nofollow" href="http://processing.org/download/">http://processing.org/download/</a><br/>
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
this isent a set of intructions mate. just a project u did.

About This Instructable




More by caromarcucci:COLORKEY 
Add instructable to: