Halloween Candy Machine

by Seeed Studio in Circuits > Arduino

3097 Views, 16 Favorites, 0 Comments

Halloween Candy Machine

472456137618592314.jpg
封面新.jpg
万圣节糖果机

The Halloween is coming! And candy is an integral part of Halloween.

So these day we have made an automatic candy machine for Halloween. You could get a candy just with your stored fingerprint! Is it funny and cool? Let's make it with us!

Hardware Preparation

xvHcMuFAKkrxCzbNBxppguJS.jpg
MfR1h4ll95DogM0enI6IGUKP.jpg
Print Sensor.jpg
Grove - PIR Motion Sensor.jpg
GroveButtonP.jpg
EMAX Servo.jpg
toleddisplay12864.jpg
minibread2.jpg
new75pcs1.JPG

Wiring

candy_machine_wiring.jpg

I connect Grove-OLED Display 0.96" to I2C_2, Grove - Button(P) to GPIO_50, Grove - PIR Motion Sensor to A0, Grove - Fingerprint Sensor to UART1 and servo to P8_13 pin on the Grove Base Cape for Beaglebone as the picture above.

Please note that servo need to work with an extra 5V power(as BBGW can't provide enough current). And it means that the extra power needs to connect its GND to BBGW. The bread board is for this.

Software Work

git clone <a href="https://github.com/jerryyip/candy_machine.git"> https://github.com/jerryyip/candy_machine.git</a>
  • Test it
python candy_machine.py
  • How to use?

When the pir sensor detects someone nearby, the fingerprint sensor will start to blink one time per second, then you could place your finger on it . If you have stored your fingerprint before, the servo will work and give you a candy. And if you don't, you can't get anything.

So how to store a fingerprint? Press the button for about 2-6 senconds, then the fingerprint sensor will start to blink 2.5 times per second, much more fast the before. Then you could place your finger---move your finger---place the same finger again on the fingerprint sensor according to the guide in the OLED to store your fingerprint.

Shell Materials Preparation

920917277485262555.jpg

Structure part:

  • M3*60 Pillar —— 6 PCS
  • M3*35+6 Pillar —— 4 PCS
  • M3*20 Pillar —— 2 PCS
  • M3*10+6 Pillar —— 2 PCS
  • M3*5+6 Pillar —— 3 PCS
  • M2*10 Pillar —— 3 PCS
  • M3*8 Screws —— 23 PCS
  • M2*8 Screws —— 3 PCS
  • M3 Nut —— 7 PCS
  • M3*10 Nylon rivet —— 1 PCS
  • Double-sided adhesive tape
  • Screws Driver

Laser Cut the Wood

糖果机.png
18406708495872180.jpg

In this part, we need to make an box as the picture below shows, you can download the drawings here.

Then we need to cut the the board using laser cutting. I guess you don’t have a laser cutting at home, you can find some in the hacker space near from you easily. If there's no hacker space nearby, you can try the Laser Cutting Service supply by Seeed.

Here's we use 3mm wood~

Downloads

Assemble and Install the Wheel

642040837146608970.jpg
768112885922217698.jpg
683272290933170229.jpg
98751150082107016.jpg
  1. These round parts glued together, with a square board inserted in the middle of the square hole to determine the location, convenient to other parts aligned, attention the parts has hole are on both sides. (Image 1,2)
  2. Install the plastic parts used to connect servos, here we need to use self-tapping screws, we have to use more power to fix these. (Image 3)
  3. We can find a candy put it to the wheel, check whether it is working properly (Image 4)

Installation Candy Warehouse

601421947301252855.jpg
728148339580675280.jpg

This part is easy, just use pillars fix 5 woods. Nothing special to note~

Install Hardware on the Wood

168488970247120091.jpg
347717603788410120.jpg
  1. Fix 6 M3*60 pillars on the wood.
  2. Use M3*5+6 pillars fix BBGW on the wood.
  3. Use stickers fix breadboard, battery, grove - IR sensor and fingerprint reader.
  4. Use M2*10 pillars fix grove - OLED
  5. Fix servos and wheel on the wood.
  6. Install wood cover

Install Candy Warehouse

875025238855631336.jpg
38892715995727303.jpg

Put candy warehouse on the box we just made. then we can put the candy and test.

PS: If the candy size doesn't match the wheel, we have to adjust the wheel size~