At home the cookies disappear relatively fast. ¿Why? Well, principally because of me and my father. That's why my mother and my sister have to hide some to eat them later. It's embarrassing, I know, but it's because we are like "Oh, I want to eat a cookie", and some time later "I will eat another", and so on, and when we realize, we have eaten more than a half of the cookies. That's why I decide to make this box, to correctly administrate them.

The interface of the box have some pushbuttons, one rgb LED and a LCD screen. Normally, the LED is blue (to show that the box is working) and the LCD display the message "x of y cookies. z have no owner", where x is the actual amount of cookies, y is the original amount of cookies and z is the number of cookies that leftover.  

Every user have one button, so when I press my button, the box check if I have any cookies left, and if I have, opens the door, turn the LED green, and in the LCD shows "You have x cookies left". After a while (5 seconds), it closes the door again. If I haven't any cookie, the LED turn red and the LCD say's "You have no cookies left :(" and the door stay closed.

When the box is empty (maybe it's not empty at all, but there's no cookies left for any of the users), the LED turns red, the LCD show's the message "The box is empty!" and the door opens.

Here's a demo:

Here I leave a zip file with the schematics and the code.

Step 1: Parts and Toools

For this project you will need:


4 Pushbuttons (Normally open)
4 10K Ohm resistors (for the buttons, more about this in the next step)
3 330 Ohm resistors (for the LED. Any value bethween 220 Ohm and 1k Ohm must work right)
1 RGB LED (common cathode)
1 10k potentiometer
1 16X2 LCD screen
1 Servo (I used the TowerPro SG92R which I had at hand. The servo you will need depends on your box)
1 Arduino (I used an UNO r3)
1 box


A working pc with the Arduino IDE
USB cable to upload the sketch
A power supply between 7 and 12 volts with relatively high amperage*

*Mine supplies 500mA, which seems to be low, because the box don't work. I had to connect it to both, my computer and the power supply
<p>What happens if you open the box but dont take a cookie</p>
<p>Unfortunately, the box thinks that you taked one, even if you didn't. That can be a problem, because you can even take two cookies and it will think you only taked one.</p><p>Maybe if you put a distance sensor inside the box it will know if someone taked something from the box.</p>
You could program it so it can see how many you took through weight
<p>This is really a neat project. I am going to use it for my middle school prototyping class. We have tons of Legos and the Arduino is our central focus. I love the incorporation of the LCD! Thanks for posting this.</p>
<p>I'm glad it helps you :)</p>
<p>Veo un chocorramo. Un colombiano m&aacute;s. xD</p>
<p>Larga vida a los chocorramos! :D</p>
<p>This is a great idea! I love the display screen that shows the amount of cookies you started with and the amount that are left :)</p>
<p>Thanks for the comment! Unfortunately, when I made the video I didn't know how to use the LCD's backlight (already corrected in the schematics), so in the video cannot be seen in action.</p>

About This Instructable




Bio: Hello! My name is Martin Buenahora. A 15 year old homeschooler. Lover of free cultures and in my way to become a Maker. My favorite ... More »
More by Zironid:Cookies adminitrator box [Electronics only] 
Add instructable to: