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
-
Measure a piece of copper tape according to template on front piece
-
Mark a fold line
-
Peel and fold tape
-
Attach in place aligning fold line (note corresponding triangles)
-
Insert a wire through the hole on the back, punching through the copper tape
-
Fold the wire and insert it through the copper tape into the hole next to it
-
Pull the wire flat
-
Twist the wire and secure – make sure that the wire has a good connection to the copper tape
-
Gently fold back the copper tape and take the corresponding piece of wire
-
Bend the wire in a U shape
-
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)
-
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.
- Construct the MDF parts and connect the sets of wires to the copper tape switches.
- Open the “ex_piggybank_test” from the experiments.
- Upload the sketch to the YúnWhen the onboard LED L13 is on, the Yún is ready.
- Open the Serial Monitor and test each trigger copper tape switch and check so that each switch adds the correct value.
- Open the “ex_piggybank” from the experiments.
- Make sure, that the group variable is the right number for your group.
- Upload the sketch to the Yún.
- When the onboard LED L13 is on, the Yún is ready.
- 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.
- 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?