Introduction: DIY Candy Dispenser Machine Using REKA:BIT With Micro:bit

About: Hello there, I'm Abdulrahman Ahamed, a mechatronic engineer at Universiti Malaysia Pahang. I love making cool projects using different types of microcontrollers!

Let’s learn how to make a candy machine using REKA-BIT, where it can automatically drop candies when we place our hand under the cone! 🍭✨

Step 1: Components and Tools

Electrical Components Required:

• 1x REKA:BIT board with micro:bit v2

• 1x Servo Motor

• 1x Ultrasonic Sensor

• 1x Grove to female header cable

• 1x 4xAA battery holder

Tools Required:

• Cardboard

• Hot Glue Gun

• Scissor

• Cellophane Tape

• Aluminum Foil

All listed components can be found on Cytron Technologies' website!

Step 2: USE CARDBOARD TO MAKE THE CANDY MACHINE

Bring cardboard and cut it according to the dimensions that appear in the picture above.

After that, start to attach the cardboard parts as shown in the pictures above using a hot glue gun.

  1. Attach the sides on the base of the box
  2. Attach the yellow part on the front side
  3. Use cellophane tape to attach the back part to the box on the left side only (so we always be able to open the box from the backsid)
  4. Use cellophane tape to attach the top part on the box from one side only (so we can refill the candy from the top)
  5. Finally, the box should look like picture number 5.

Note: I've covered the cardboard with white paper, and placed the "Candy Template" on the front side of the cardboard.
You can also print and use the same template, download the pdf file below:

Step 3: MAKE THE CONE & ATTACH THE COMPONENTS

  1. Cut another piece of cardboard into this flat cone shape
  2. Cover the cardboard with aluminum foil (to store the candy safely)
  3. Attach the parts together, and add another piece of cardboard at the top to cover the candy
  4. Take another piece of cardboard and attach it to the servo motor as shown in figure 4
  5. Place REKA:BIT on the front side using (cable ties, or hot glue)
  6. Attach the other components on the backside as shown in figure 6
  7. Finally, the candy box should look like figure number 7

Step 4: CONNECTION

  • Connect the servo motor to the S1 port
  • Connect the ultrasonic sensor to the first Grove port
  • Power up the REKA:BIT using batter holder jack

Step 5: CODE

Now, connect your REKA:BIT to your device and open MakeCode editor to start programming.

  • Add REKA:BIT extension and follow the code block in the picture above
  • After completing the code block, download it and compile it over REKA:BIT

You can also view and edit the code by clicking here!

Step 6: WELL DONE!

Now all what you have to do is filling the upper cone with some candy, and placing your hand under the lower cone to enjoy it!

Don't forget to show your friends your awesome machine and share the candy with them!

Have a good day, Maker :)

If you enjoyed this tutorial, you may also like the other Instructables I made: