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.

Comments

author
Zé CarlosD (author)2017-04-20

Dear
PawelJ17:

In this
project, i need to use the CORE2 platform, but at this moment, the platform are
unavaible on: https://husarion.com/

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?

Any
sugestion is welcome!

Thank you
very much!

author
PawełJ17 (author)Zé CarlosD2017-05-30

It will be soon available at Crowdsupply: https://www.crowdsupply.com/husarion/core2
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 ;)

author
Zé CarlosD (author)2016-10-19

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: http://www.ebay.co.uk/itm/Ultrasonic-Distance-Mea...

Husarion CORE2 board: https://store.husarion.com/eu/home/8-husarion-cor...

Buzzer: http://www.ebay.co.uk/itm/95DB-Continuo-Alarma-DC...

Microswitch: http://www.ebay.co.uk/itm/5x-Switch-Microswitch-M...

Battery holder: http://www.ebay.co.uk/itm/1-2-3-4-6-8-x-AA-AAA-23...

Batteries: http://www.ebay.co.uk/itm/4-X-BATTERIES-MAXELL-1-...

Any sugestion is welcome!

Thank you very much!

author
PawełJ17 (author)Zé CarlosD2016-10-19

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: https://goo.gl/8rkOZv) 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 (https://docs.husarion.com/hardware/core2_1_0_0/index.html), I used batteries with higher voltage than normal 1.5V batteries, so I could use only 3 of them.

author
PawełJ17 (author)PawełJ172016-10-20

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
author
Zé CarlosD (author)2016-09-28

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

author
PawełJ17 (author)Zé CarlosD2016-09-28

This User Interface is running through website only, thanks to Husarion Cloud, here is link: https://cloud.husarion.com/

You can find more information here: https://docs.husarion.com/howtostart/core2_1_0_0/i...

author
Joseph jo (author)2016-09-28

It is cool

author
Swansong (author)2016-09-26

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

author
PawełJ17 (author)Swansong2016-09-26

Show us, when you complete your jar ;)

About This Instructable

697views

14favorites

License:

More by PawełJ17:SpyBot - Internet-controlled robot with videostreamingOpen Sesame - DIY door opening IoTRoller blind controlled via web browser with CORE2 and RPi
Add instructable to: