IoT Piggy Bank Experiment

A piggy bank that counts the coins it is given, then saves and store, those coins value on the Internet.

Refer to CTC IoT Teacher Guide #7

Materials:

  • Arduino Yún
  • Jumper wires
  • 10k resistor  (The colors on it are brown , black, orange and gold)
  • Tin foil
  • Breadboard

 

Koncept

Create a smart piggy bank that can sort and count the coins it gets and send the value of each coin to an API. The API will add and store the total values.

Assembling the PDF parts

  1. Measure a piece of copper tape according to template on front piece

Bank1.jpg

  1. Mark a fold line

Bank2.jpg

  1. Peel and fold tape

Bank3.jpg

  1. Attach in place aligning fold line (note corresponding triangles)

Bank4.jpg

  1. Insert a wire through the hole on the back, punching through the copper tape

Bank5.jpg

  1. Fold the wire and insert it through the copper tape into the hole next to it

Bank6.jpg

  1. Pull the wire flat

Bank7.jpg

  1. Twist the wire and secure – make sure that the wire has a good connection to the copper tape

Bank8.jpg

  1. Gently fold back the copper tape and take the corresponding piece of wire

Bank9.jpg

  1. Bend the wire in a U shape

Bank10.jpg

  1. Push wire into the slots and fold the copper tape back – make sure that the tape does not touch the wire, but is close enough so that the coin can push it to contact when it hits it (like a trigger)

Bank11.jpg

  1. The end result should look like the following.

How it works

Coins come in different sizes. The sorting machine will use gravity to help sort the coins – as the coin rolls down the sorting slide, it will fall through the appropriately sized slots and trigger a copper tape switch.

The value is sent to the API which adds the value of that coin to the “bank” value.

  1. Construct the MDF parts and connect the sets of wires to the copper tape switches.
  2. Open the “ex_piggybank_test” from the experiments.
  3. Upload the sketch to the YúnWhen the onboard LED L13 is on, the Yún is ready.
  4. Open the Serial Monitor and test each trigger copper tape switch and check so that each switch adds the correct value.
  5. Open the “ex_piggybank” from the experiments.
  6. Make sure, that the group variable is the right number for your group.
  7. Upload the sketch to the Yún.
  8. When the onboard LED L13 is on, the Yún is ready.
  9. Start putting some coins into the slide and go to this URL: http://verkstad.cc/iot/mmx/GROUPNUMBER/index.php to see if your  probe have detected anything. Don’t forget to the change this URL to have your group number in it.
  10. Check the values on the API and see the value of all the coins that the piggy bank gets

 

Tips

  • Double check that the connections are placed correctly and secure. Use the test code to check if each copper tape switch works and has the right coin value associated with it.
  • Once the final code is uploaded and no data or incorrect data is coming through the Url, check the code to see if the proper group number is referenced.

 

Experiment further

  • Try changing the values of the coins in the final program.
  • What other types of sorters are there and how would you build one?
  • Using the same copper tape switches, what other objects and be sorted?