
For my Physical Computing class we had to create a helpful (or not helpful) robot that could perform a task that one may face on a day to day basis. I chose to make an interactive piggybank! The idea was that after a sensor was motioned, the robot would lower its mouth so that a coin could be placed and then swallowed. To make this idea a reality, I took use of the Adafruit Circuit Playground, PIR sensor, a servo motor, and several 3D prints.
I found inspiration from EunChan Park. On Youtube they documented their process on making a "Paper Hungry Robot" that could eat coins when motioned by a sensor. They also implemented a sensor and servor motor.
First Steps
To begin I first had to find a piggybank model that I could adapt for this project. I chose this Cow Piggy Bank from Amazon because of its elongated shape. I knew it would be easier to fit cutouts for a sensor and the mouth if the shape was longer than the typical piggybanks that exist.

Sketches

Here is the game plan I had for my project. I wanted to cut out two sections in the front of the model to fit a PIR sensor, as well as a mouth piece that I'd 3D print. For the back I cut out a larger section, so I could have room to work, place the wires and pieces in correctly, etc.
Lastly, I planned to print out a cap for the servo motor piece, as well as a tongue that would be attached to it, so it could turn 180 degrees.
Making the Code Work


Using the CircuitPython Code for a PIR sensor from Adafruit website I was able to implement it into a modes code. Mode 1 is "motion detected" and it makes the servo motor and tongue go to an angle of 180 degrees when there is motion. Mode 0 "motion ended", makes the angle then turn to 100 degrees when there is no motion detected. This back and forth motion is what makes the coin get "swallowed" by the piggybank.
3D Printing

Using the service Onshape, a product development platform, I was able to model out my 3D prints. My professor for Physical Computing had already given us the file for the servo motor cap, so on Onshape all I had to do was scale the model to be slightly smaller for a better fit.
For the tongue print out, using a measuring tool I picked dimensions that would be appropriate in comparison to the piggybank model. This part was a bit more difficult because I had to take a lot into consideration, such as where I would place the servo motor inside the piggybank, and how far away the tongue had to be in order for it to work.
I also printed out a rectangle piece that I wanted to serve as stand inside the piggy bank, so that the servo motor could rest on it.


Assembling the Pieces


ALl the Angles

FINAL PROTOTYPE
Hope you enjoyed :)