An arduino controlled box, that stop me from eating to many sweets...
This article is Work-In-Progress
This article will be in english because it is supposed to sort of be the documentation for the box.
A few weeks ago, I got the idea for a box
The box is supposed to be sort of user friendly. You navigate the menu using two buttons, up, down, and both for enter. On the first boot you may need to calibrate the scale using a known 500g weight and set the RTC to the current time. After that you can set the maximum limit per day and a few other things like turning on and off the buzzer. Then you fill up the box with your favorite sweets, run the tare option, and you are ready to go.
Now that everything is set up, you can use it as normal. Just take out some sweets whenever you want to, but be warned, if you take more than the maximum allowed per day, the box will scream at you until you either put enough back, or close the lid. If you closed the lid after taking out too much, it will lock the lid with its servo and won't open until the next day when it resets.
It's not really secure. There are many ways to trick it and thats OK. It's not supposed to be super secure, just enough of an annoyance that you reconsider taking something out.
The biggest part of the device is the pink (blue was out at the store so i went with pink. its a nice color too) plastic container wich contains all your sweets while preventing them from drying out or getting too wet.
The device is powerd by a male USB A plug wich is way to short. The current status is shown on the dual-color LED that is hotglued onto the side of the pink container.
Green means you are good,
The Device knows if the lid is open via the Digital Hall Effect Sensor (glowing red in the picture)
Everything is controlled via the HD44780 powered display in the front, wich sits a bit too upright to be readable from far above but i could not get it angled more due to limited space, and the two little buttons next to it.
The arduino is kind of squshed in at the front together with a display and an RTC. The RTC keeps the time wich allows the device to automatically reset on 4 a clock AM.
The loadcell is what takes the weight measurements. It works by having for resistors wich form a Wheatstone-Bridge, but thoseresistors change resistance based on microscopic streching that occurs from the weight deforming the metal bar juuust a little bit.
The slightly varying voltage then gets read in by the HX711 load cell amplifier chip and Read out by the arduino.
The annoying sound maker. A random small speaker connected via a volume lowering resistor to an ""amplifier"" made of a single NPN transistor with an added diode for voltage spike protection.
Finally: The janky hinge that I made by gluing down one of the lid flaps with hotglue.
The circut is pretty simple. All sensors etc. just get connected directly to the Arduino without any port expanders or so.
You can view and download the code over at github: github.com/HACKER-3000/sweets_box/
The Menu is pretty easy to use (I think). You have two buttons: up(BTN1) and down(BTN2). To enter a menu, confirm a setting, etc, you just press both at the same time.
Took 10g/100g
Weight: 200.3g
The default screen shows how much you have taken, how much you can at most take per day, and how much is in the box total.
20:34:58
20.02.2023
The clock is a slightly buggy clock.