Color Recognition Lock

Color Recognition Lock

Hi, this is Wayne again with a topic “Color Recognition Lock”.
This week, i’m going to show you how to make a color activated lock box. This lock only opens when you hold a certain color up to the sensor. The first step in this build is to make a color sensor. The most basic kind of color sensor uses three different color leds to shine on an object one at a time. A photoresistor then measures the intensity of the reflected light for each color.

These values can be used to determine what color that object is. For example, blue objects will reflect more blue light and absorb more red and green light. So, to make a color sensor, you just need to mount the leds and a photo resistor to a small circuit board. In this case, i’m using a single three color led to help conserve space. I also added the necessary series resistors to the board so that i could connect it directly to the arduino to block out any outside light. I wrapped a small piece of cardstock around the board and taped it in place.

Color Recognition Lock

This made a basic light shield now just connect the wires from the sensor to the arduino. Next, we need to set up the box and the locking mechanism to form the lock. I mounted two eye screws to the inside of the front panel of the box and i attached a third eye screw to the lid. When the box is closed, the three holes line up in this position. You can insert a pin through the eye holes and the box will be locked shut to move the pin in and out. I used a small servo motor.

Color Recognition Lock

I attached a steel wire to the arm of the servo and lined it up with the holes on the eye screws. I added a few wooden spacers to mount it at the right height. Next, i cut a hole in the bottom of the box for the color sensor. Then i positioned the sensor over the hole and used hot glue to hold it in place.

Color Recognition Lock

I mounted the rest of the parts to the inside of the box with hot glue as well. Now, whenever you hold up the appropriate color to the sensor, the box will unlock to change the color key, just go into the arduino code and change the lock code values to ensure that the battery never runs out. While the box is locked, you can add a simple power switch. You can also route the battery connector outside the box so that you can easily replace a dead battery.

Well, that’s how to make a color activated, lock box thanks for watching and check back next week for more diy hacks and how to’s .