Save for Your Own Royal Wedding (of Sorts) with the Gentleman Maker’s Savings Incentivizer

May 10, 2018 by Robin Mitchell

In this project, we'll use a Raspberry Pi to create a responsive piggy bank that belittles you when you slack on your savings!

In this episode of the Gentleman Maker, we'll use a Raspberry Pi to create a responsive piggy bank that belittles you when you slack on your savings.

For some, the tail end of spring means barbecues, beer, and holidays! But for Prince Harry and Meghan Markle, it means a grandiose royal wedding that is sure to cost more than a few pounds. Whether you’re saving for your next cookout, planning a royal wedding viewing party, or collecting coins for your own engagement, the Savings Incentivizer can help!

After all, not all of us are good at restraint on our own. 



Of course, a normal piggy bank could suffice, but I am both British and an engineer, so I thought, “Why not make a piggy bank with snark?”

Meet the Savings Incentivizer! I don’t just want to save money—I want to be encouraged to save money. So, my system will not only record how much I save, but it will also make me feel bad if I am not saving enough.

Try it out on your own and customize your recorded messages. My method is to make the comments less aggressive as you save more money.

The Savings Incentivizer BOM

Ready to build your own Savings Incentivizer? You'll need the following materials.

The Schematic

Coin detection is done using an IR beam, which is blocked when a coin passes through. This IR beam is cast onto an IR photodiode and, when a coin passes through the beam, the IR photodiode briefly becomes conductive. When this happens, the voltage across R1 increases and this voltage pulse is fed into a comparator. The potentiometer is adjusted so that, when a coin cuts the IR beam, the output of the comparator goes low.

The op-amp used in this circuit is the LM358 and is powered by the 3.3V line. Since the maximum output of the LM358 is approximately VCC – 1.5V, the maximum voltage output we can expect is ~1.8V. While this may seem low, it is, in fact, large enough to be considered in 3.3V logic.



Check out the full Scheme-It schematic here.

The Coin Housing

The coins are counted using an electronic circuit. Several slots are cut into a panel of wood, which has an IR circuit installed into each slot. When coins pass their respective IR detector circuit, an electrical pulse is sent to the Raspberry Pi using the GPIO pins.

With this process in place, we can determine which coin has been fed into the system, and then its value can be added to the total already stored.


The Program

The Python program is rather simple and only uses eSpeak for text to speech and GPIO for access to GPIO pins. When the code starts, it sets up all the GPIO pins, as well as all needed variables.

When the main program loop runs, the GPIOs are constantly scanned to detect changes. When a change is detected, the appropriate coin value is added to the total amount. With the total now adjusted, a small routine is executed, which will play a message depending on the total saved.


Once you're armed with your own Savings Incentivizer, you'll never wonder how poor you are again!

Looking for more British debauchery? Check out the rest of the Gentleman Maker series.

  • N
    neochem July 25, 2018

    The link to Savings Incentivizer Code contains an (1) an image and (2) an HTML file that is a scaled-down version of the main page for this project.  No code file is included.  Simple enough to work around but the link is misleading by its title.

    Like. Reply
    • Justin Kirkham July 25, 2018
      Hi, neochem! The download link should now lead to the correct Python code. Thanks for letting us know about the problem!
      Like. Reply