Candy Jar - Watch Your Candies and Know When Sb Eats Them!





Introduction: Candy Jar - Watch Your Candies and Know When Sb Eats Them!

Don't eat my candies!

This is the best solution for cookie monsters! We quickly made a smart lid with sensors that watch how many candies are left in the jar, check if the jar is open or not and have a loud buzzer to scare snackers.

Step 1: ​Circuit Diagram

Connect HC-SR04 ultrasonic sensor to the hSens1 port of your CORE2. Connect ESP8266 adapter of course, to make your lid internet connected. Connect also buzzer to any hServo port - we only use it as program controlled power source. Think of how you can put everything in to the lid or print in 3D your customized lid as we did. Then attach CORE2 and microswitch to the lid, so the switch is released when jar is opened. At the and connect power supply. We used 3 rechargeable batteries and attached it with zip ties.

Step 2: Assembly

Simply connect CORE2 with 4x M3 screws and nuts to any jar's lid. We prepared our unique, 3D printed lid.

Then try to put any sensors, buzzer and battery underr the lid, as we did.

Step 3: Code

Use our open-sourced code provided here on github. If you are familiar with Husarion Cloud just import it as zip, other way follow this Husarion site to connect your CORE2 to the Cloud and program it via web browser.



    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest
    • Oil Contest

      Oil Contest

    10 Discussions


    In this
    project, i need to use the CORE2 platform, but at this moment, the platform are
    unavaible on:

    Do you know
    one way to program this project using an alternative to CORE2?

    Or, do you
    know of another site that has the CORE 2 platform available?

    sugestion is welcome!

    Thank you
    very much!

    1 reply

    It will be soon available at Crowdsupply:
    I didn't make any other working alternative, just the presented one, but I think it is possible to make on any microcontroller. Except the WebUI - I don't know, maybe on NodeMCU or WeMOS? I saw once a project with a website on WeMos ;)

    Dear PawelJ17:

    I'm interested on the development of this project, and I have been searching the components needed and I did not found the ESP8266 adapter which is compatible with CORE2 board.

    However, I have found the other components and, if not too much to ask, I would like if you can confirm it to me:

    - Ultrassonic sensor:

    Husarion CORE2 board:



    Battery holder:


    Any sugestion is welcome!

    Thank you very much!

    2 replies

    Hi, ESP8266 is delivered for free with CORE2 in a box ;) I used buzzer with generator, so it makes characterisitc beep sound (like this one: I think that kind of microswitch could work as well, but you have to develop your own way to attach it on the lid. I'll show you my solution. Bear in mind, that Core2 needs at least 6V (, I used batteries with higher voltage than normal 1.5V batteries, so I could use only 3 of them.

    That's how I attached my microswitch. I melted a part of my 3D printed lid and used a glue to attach the microswitch

    P61020-111726 (1).jpg

    Dear PawelJ17

    The app you developed is for android or iOS?

    Can you explain better how to install the app on the smartphone?

    Thank you very much

    1 reply

    This is pretty funny! XD We need one of these in our house.

    1 reply

    Show us, when you complete your jar ;)