Introduction: The Social Distancing Halloween Candy Robot

About: Designer who loves aviation, software, 3d modeling/printing, and electronics.

If you're looking for a fun new way to interact with this years Halloween trick-or-treaters and you're up for the challenge that this project brings, then jump right in and build your own!

This social distancing robot will 'see' when a trick-or-treater walks up, and dispenses a mini candy bar. The project utilizes an ultrasonic sensor as the robot's eyes.



  • 5-6 square feet of plywood (1/2” thick is recommended)
  • Spool of PLA, One or more colors



  • Screw driver
  • Drill
  • Saw (or CNC)
  • 3D printer
  • Soldering iron
  • Wire strippers
  • Hammer

Step 1: 3D Print Robot and Mechanics

Download all STL files and print in the colors of your choice. The largest parts require at least a 150mm cubed print volume. While your parts are printing you can prepare any of the parts form steps 2-3. Please note that you will need close to a full spool and about 30 hours of print time. I'd recommend designing a smaller robot if you do not want to put in the time and material.

I grouped parts together as follows:

Using Black PLA

  • Turn blade
  • Catch Slide
  • Hopper Funnel
  • Hopper Holder
  • Legs, Arms, and Neck

Using Grey PLA

  • Face, and Head
  • Chest Halves

Step 2: Cutout the Candy Box

We’ll first cutout the wood box. If you decide to use the included 3D print files. Be sure that the inside dimensions fo the box are 150mm x 150mm, and at least 300mm tall. I chose to use a 1/2inch thick plywood, and I wouldn't recommend going any thinner than that, it gets too hard to assemble it.

I first cut out the front and back pieces at 174mm wide on the table saw. I then cut the sides to 150mm wide. After that I cut everything to the same length at 300mm, and I cut the front piece to 312mm.

You can assemble the box using screws, nails and or glue. I opted for #15 finishing nails from Home Depot. These were fairly easy to nail in. I nailed the back piece to one of the side pieces in top and bottom corners, then nailed the other side piece in place. I used a vise to hold the starting piece. Once I had the back side nailed up. I placed the face panel on and nailed it in place. I then added 4 more nails in the middle, one per edge, and 2 per front and back.

Step 3: Wire Electronics and Load the Code

See the wiring schematic for wiring diagram (Note: that the wiring diagram does not cover the ground or power/vcc wires, and assumes you have a basic understanding of how electronics work). Download the Arduino Sketch file and flash to the logic board.

I used this site to generate some robot-y sounding audio. It was very easy to create all files separately, and it was absolutely free to download. I broke them into 4 separate files so that I can call each one at a different time in the code. Please note that you will need to make sure these are exported at 8000hz, 8bit mono. A lot of people recommend Audacity to handle the conversion of files. I used Adobe Audition.

Here is the text I came up with, but feel free to have fun with it.:


"Hello Human,

I am a Social Distancing Robot!"


"I see you are here for halloween goodies. Please come up one at a time."


"Here is your treat. Ok, who's next?"


"Be sure to stay 6 feet apart. Happy Halloween!"

FULL Disclosure: I had a hard time getting the audio to work with the steppers. From my research, they both are trying to work on the same chip timer, and require additional code/libraries to work. I'll update this Instructable as soon as I have a resolution, or if you have any tips please leave them in the comments.

Step 4: Assemble Dispenser Mechanism

We’ll first assemble the turn-style, and mount to the very bottom part of the box. This will help us to set the height of the hopper funnel so there is adequate clearance. If you mount it too closely to the turn blade, the the candies can get stuck :(

Before you install the hopper funnel, you’ll need to glue the funnel and the holder together. Please take note of the orientation so that everything lines up. Install the funnel from the top down and find the right alignment for the turn-style. Use a set of screws to mount the hopper assemble from the 2 sides of the box. You'll need to measure to get the height set correctly.

Step 5: Assemble and Mount Robot

First, glue the chest halves together using a super glue or something suitable for PLA.

Next, install the speaker, ultrasonic sensor, and the stepper motor in that order into the face first. Route the wires through the neck. Wait to install the back side of the head until after we’ve tested everything in step 5.

Route the wires through the chest, and be sure to place the head stepper motor controller into the chest cavity, as the wires will not reach all the way through the legs. Continue routing the wires down through the legs.

Assemble the head into the neck piece by pushing it into the slot. Finish gluing the arms onto the robot and glue the legs if you prefer. Mount the robot to the top of the of the box feeding the wires through a 1/2 inch hole in the top of the box. Connect the appropriate wires to the Arduino, and necessary power supply.

Connect up any remaining electronics, connect your battery power supply, and test everything to make sure everything works.

Step 6: Test Everything!

It's likely you'll have to work out a few kinks in this project as it it quite complex to put together.

Step 7: Load With Minis Candies and Enjoy

After you’ve tested everything. Load with about 10 pieces of mini's candy bars, and test again to make sure everything works. You'll have to remove the Twix from the mix since that shape is not the same as the others.

When you’re ready to pass out candy, make sure you’ve charged up your battery supply, setup and enjoy a socially safe distance and let your robot do the work!

Robots Contest

Participated in the
Robots Contest