The idea comes from my own problem of having problems finishing a physical book (eBook too actually but that’s another story). I thought, perhaps, if I incentivise myself with some candies, I’d finish a book or two.
What does this do?
This project consists of two parts. The first one being a bookmark, while the other one is a candy box. The idea is to make a bookmark that’s placed in between pages that I plan to reach/read. When I reach the page (where the bookmark is placed at), a candy will get dispensed.
The bookmark and the candy box would communicate via wifi. The idea is wherever you are in the world (okay maybe more like, when you’re bookmark and the candy box are in the same city), you can still trigger the candy box (and get candies cos candies are awesome) as long as you’re connected to the wifi. So an example of this would be you would be able to read a book on a subway (so long as you’re connected to the net) and find some candies when you’re home.
What are the materials?
I used two MKR1000, one for the bookmark and the other one for the candy dispenser.
For the bookmark, I used two copper strips hooked up to a MKR1000. They act like a button that activates the candy box. I used pull-up to activate the candy box on the other side.
As for the candy box, I laser-cut a candy box with ramps (FTW!) in it. There will be a gate controlled by a servo that’ll open when you reach the page you’ve placed your bookmark in. When the gate opens, candies will roll out.
The candy box and the bookmark will be connected through wifi via IFTTT’s Maker Webhooks, a project that lets my two MKR1000 talk to each other
The assembly process itself was rather straightforward, except for the constant adjustments, e.g. adjusting the position of the gate, adjusting the delay time, adjusting the position of cables, etc.
Software for the software part, it is rather straightforward except for the part where I was to connect my MKR1000 to IFTTT. This process didn’t feel as intuitive to me and the documentations online didn’t quite feel that helpful either, but after a *while* of tinkering, *good* things started to happen, so that’s great. I tried my best not to jump into making a bookmark that triggers the candy box right away. I tried to start small with turning on an LED with a push of a button (connected via the wifi). From there, when things worked fine, I swapped the LED with servo. I ran into issues incorporating the servo into the equation, but it went fine after a while. Afterwards, I then modified the code of the button to make it trigger the servo with pull-up resistance.
Although the whole process took quite a while, I’m glad that I did it all in small steps as opposed to diving into connecting a servo with a pull up button right away. That helped a lot in identifying issues (and fixing them).
For the bookmark, I combined the code from Marco Schwartz’s IoT Cookbook and Arduino’s Pull Up. As for the candy dispenser, I combined the code from the same book and Arduino’s Mini Servo. For the Mini Servo, I did some modifications with the delay (thanks to Angelica for suggesting how much the delay should be!) and the angle that the servo should move.
Hardware I was wrong when I thought that the software part of this project would’ve taken more time than the hardware part. For the hardware part, there are two components I had to take into account: the bookmark and the candy box.
The bookmark. Initially, I was set on using touch/pressure sensor to trigger my candy box. However, Scott suggested that I swapped the sensors for copper strips because copper strips could get the system running with little to no force/pressure. This would be more suitable because a bookmark that’s placed in between pages won’t usually receive that much force/pressure.
The-initially-dispenser-turned-candy-box Initially I wanted to make a candy dispenser that looks like an actual dispenser (sigh). However, after hours of tinkering with 3D modelling software, I figured that I had been spending too much time on it and should probably opt for something simpler, thus the candy box. I laser cut MDF boards and assembled them by using wood glue. For the front part, I use an acrylic board.
The Result The result is this bookmark that triggers candy dispenser when they two sides of the bookmark aren’t touching.
What I Wish I Could’ve Done Differently
Size of the bookmark I’d love to have a bookmark that’s not as big as the one I designed. I’d love it to be a lot smaller and thinner, and possibly, not wired to a power bank. I imagined it would need a bit more research and thinner-battery hunting.
The dispenser If I had more time, I’d love to work more on the dispenser and make it look like an actual dispenser. I guess there isn’t exactly any problem with this candy box, but I personally would’ve liked to see a better-looking candy box.
Weight sensor I think it would’ve been more fun to have the weight sensor and the notification system, too. I’ve actually made the whole notification system working (using Temboo and Google Mail), but I never got around adding the weight sensor so I had to forgo the idea.