Overview

Why roam around with a boring pumpkin bucket when you can lay eggs in warm human intestines collect delicious candy with a robotic Xenomorph head?

This robotic candy bucket shoots out a small receptacle to retrieve candy and bring it back into the bucket.

Some 3D printing is required to create the linear actuator. Two servo motors controlled by a Circuit Playground Express, coded with MakeCode, power this project. 

Parts

Xenomorph candy bucket!

This is a licensed product produced and sold by Super7. As of this writing it can be purchased for $20 online or at retail stores…check the web site…but if supplies dry up in the future, you’ll need to hunt on eBay, or maybe get crafty and make something yourself.

Circuit Playground Express

PRODUCT ID: 3333
Circuit Playground Express is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and...
$24.95
IN STOCK

USB cable - USB A to Micro-B

PRODUCT ID: 592
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or...
$2.95
IN STOCK

3 x AAA Battery Holder with On/Off Switch and 2-Pin JST

PRODUCT ID: 727
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects. We spec'd these out because the box is slim, and 3 AAA's add up to about...
$1.95
IN STOCK

Alkaline AAA batteries - 3 pack

PRODUCT ID: 3520
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAA's. This is a...
$1.50
IN STOCK

JST-PH Battery Extension Cable - 500mm

PRODUCT ID: 1131
By popular demand, we now have a handy extension cord for all of our JST-terminated battery packs (such as our LiIon/LiPoly and 3xAAA holders). One end has a JST-PH socket, and the...
OUT OF STOCK

Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

PRODUCT ID: 3448
When working with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These...
OUT OF STOCK

Sub-micro Servo - SG51R

PRODUCT ID: 2201
This is just about the cutest, tiniest little micro servo we could find, even smaller than the 9 gram micro servos we love so much.  It can rotate approximately 180 degrees (90 in...
$5.95
IN STOCK

Continuous Rotation Servo

PRODUCT ID: 154
This servo rotates fully forward or backwards instead of moving to a position. You can use any servo code, hardware or library to control these servos. Good for making simple moving...
$11.95
IN STOCK

Servo Extension Cable - 30cm / 12" long -

PRODUCT ID: 972
Stretch out your servo connections with this flexible servo extension cord. It has a 3 pin shrouded "male" connection to plug your servo into and then, 30cm later, a 3 pin...
$1.95
IN STOCK

Materials

For this project you will need:

Read on to learn how to create your own!

Circuit Diagram

Connect your large continuous servo motor to the Circuit Playground Express by connecting the servo's red (or orange) wire to Vout, the yellow wire to A1, and the brown (or black) wire to GND

Connect the sub-micro servo to Vout and GND pads on Circuit Playground Express and the data (yellow) line to A2.

3D Printing

The 3D files for the linear actuator used in this project can be downloaded by clicking the button below.

This design for this project is based off of the Large Linear Servo Actuator published by potentprintables.

Bracket

Slimmed down and with some mounting holes added to the base.

Once the supports are removed, your bracket should look like this.

Some sandpaper may be useful to smooth out the slot where the extender arm will fit.

Extender arm

Revised to extend to 215mm.

The extender arm should be printed with high infill to give it strength. If your slicer allows, printing with a negative dimensional adjustment (-0.02mm or -0.04mm) will help it slide smoothly in the bracket.

Drive Gear

Install the circular servo motor attachment inside the drive gear.

A little bit of super glue or E6000 glue works well for this.

Once smoothed and assembled, your linear servo actuator assembly should look like this.

MakeCode

Getting Familiar with MakeCode

This project runs a simple Microsoft MakeCode sketch to control the helmet, and is easy to play with if you want to make changes.

Microsoft MakeCode for Adafruit is a web-based code editor that provides a block editor, similar to Scratch or Code.org, and also a JavaScript editor for more advanced users.

If you've never used the Circuit Playground Express with MakeCode before, this guide is a good place to start.

The Code

The code is shown below. For browser viewing, you may need to enable content. For example, in Chrome, click "Show Embedded Content" as the material is fed not from Adafruit but from Microsoft's MakeCode site.

To download the code, click the download link at the bottom of the window. To edit the code in MakeCode, click the box with arrow icon in the upper right corner of the window.

How to Upload Code

To upload code to Circuit Playground Express, follow these instructions:

1) Connect your Circuit Playground Express to your computer using a micro USB cable and press the small reset button in the center of the board. All the LEDs will flash red briefly, then turn green. Your computer should now show a removable drive called CPLAYBOOT. 

2) Click the Download button in the code window below to download the .UF2 file to your computer.

3) Now drag and drop the .UF2 file onto the CPLAYBOOT drive in your computer's file explorer or finder.

Once the file is dragged onto CPLAYBOOT the drive will automatically eject itself (your computer may give you a "failed to eject drive correctly" error, you can ignore this). The code is now on your Circuit Playground Express and ready to run!

Note: If you get a drive named CIRCUITPY, no worries! Press the reset button twice to get a flash drive named CPLAYBOOT. The project will not run if copied onto the CIRCUITPY drive as it is for CircuitPython.

Adjust Your Motor

Adjusting a continuous rotation servo so that it stays completely still when inactive can be accomplished by adjusting the potentiometer hidden inside the motor.

Take a small screwdriver and SLOWLY turn the potentiometer screw clockwise, then counter-clockwise, observing how this affects the direction of the motor until you find the spot where it stands still

Troubleshooting

Problem: My motor doesn't move!

Solution: Make sure that your Circuit Playground Express is connected to a power source (anywhere between 3V-5V is safe). If you're using a AAAx3 battery pack, check that the switch on the battery pack is set to "ON". If you are using the LiPo battery, be sure it is fully charged using the charger in the Featured Products.

 

Problem: My Circuit Playground Express doesn't show up as CPLAYBOOT

Solutions:

  1. Be sure you have a Circuit Playground Express.  The Circuit Playground Classic will not work with MakeCode.
  2. If you get a drive named CIRCUITPY instead, press the reset button twice in succession to get to CPLAYBOOT.
  3. Some USB cables are "charge-only" and won't pass data. Try using a different USB cable and try using a different USB port on your computer.  
  4. With the Circuit Playground Express plugged into your computer with a micro USB cable, click the small reset button in the center of the board. The lights should all turn green. If they don't, try double-clicking the reset button.

If things still aren't working, head over to the Intro to Circuit Playground Express guide for more suggestions.

More MakeCode!

If you enjoy MakeCode and want to continue exploring you can check out lots more MakeCode projects on the Adafruit Learn System.

Want to Get Back to CircuitPython?

If you ever need to convert your Circuit Playground Express back to CircuitPython mode, you can do so by downloading the appropriate .UF2 file from CircuitPython.org and dragging it over onto your CPLAYBOOT drive. See this guide page for the step-by-step instructions.

Xenomorph Modification

Access Port

Start by using a pencil to trace the outline of the square you'll cut in the front of the bucket.

Use a sharp hobby knife to *carefully* puncture the plastic and cut out a section large enough for the candy receptacle to fit through. 

Check that everything will align correctly.

If you don't have an X-acto knife, the 3D printed handle used here can be found on Thingiverse and pairs well with standard utility knife blades to make an excellent hobby knife.

Candy Receptacle

Cut off the end of a cardboard tube, about 1" tall. A paper towel tube works great for this purpose.

Trace outline of the tube on a piece of thin cardboard. Cut around this circle. 

Glue this circular piece of cardboard to the end of the tube.

Servo-Ready

Now it's time to attach the tube to our micro servo motor. This will enable the receptacle to flip upside down inside the bucket, depositing its candy inside.

Glue servo arm to the edge of the cardboard tube using plenty of hot glue.

Xenomorph Makeup

Using spray paint or a paint brush, paint the candy receptacle silver.

Add the outline of teeth with a dark permanent marker, matching the teeth on the bucket as closely as you can.

Once you're satisfied with the look, press the candy receptacle firmly onto the servo horn, and use some electrical tape (or black paint) to cover up the servo motor.

Install Linear Actuator

Use double-sided tape to secure the linear actuator system inside the bucket, or use the holes provided in the linear actuator base to use two bolts to hold it firmly in place.

Cable management is important! Use tape or twist-ties to keep all your wires tidy. Black electrical tape works well, and also looks great.

Alien Drool

As a final touch, you can use hot glue around the mouth to add some attractive-looking Xenomorph spittle. 

This guide was first published on Sep 27, 2019. It was last updated on Sep 27, 2019.