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
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.