Spooky Scary Skeleton
A fun Halloween Robot
9 October 20227 minute read
By Kevin McAleer
Share this article on
Table of Contents
- Spooky Scary Skeleton Robot
- Bill of Materials
- MicroPython Code
- Rangefinder.py
- Bare Bones - a simple Skeleton program
- Assembly
- Bottom section
- Servo
- Cog
- Jaw
- The Eye Brows
- The Gasket
- Top Section
- The Range Finder
- The Skull
- The Pico
- Wiring up the Robot - plug and play
- Connect the servo
- Connecting the HC-SR04 Range Finder
- The STL files
- Skeleton
- Pumpkin
Spooky Scary Skeleton
A fun Halloween Robot
Videos
For every project I create, I often make a corresponding YouTube video. Sometimes, there might be more than one video for a single project. You can find these videos in this section.
Explore more through these this dedicated videos.
Spooky Scary Skeleton Robot
This is a rather bare bones robot for Halloween, but its loads of fun! It uses an Ultrasonic range finder to detect people in front of it to activate its scared stiff expression. The Servo moves a mechanism inside to raise the eye brows and lower the jaw.
Bill of Materials
| Part | Description | Qty | Cost |
|---|---|---|---|
| Raspberry Pi Pico | The $4 microcontroller from Raspberry Pi | 1 | Β£4.00 |
| Servo | A low cost SG90 Servo | 1 | Β£3.00 |
| Ultrasonic Range Finder | HC-SR04 3.3v version | 1 | Β£2.00 |
| M2 Bolts | Securely attach the Pico W and Ultrasonic Rangefinder using M2 Bolts | 8 | Β£0.80 |
| M3 Bolts and nuts | Securely attach the top section to the bottom | 3 | Β£0.60 |
| Female to Female Dupont cables | For attaching the Pico to the servo and Range finder | 4 | Β£1.00 |
| Male to Female Dupont cables | For attaching the Pico to the servo and Range finder | 3 | Β£1.00 |
Prices and availability may vary.
MicroPython Code
Download or clone the code here: https://www.github.com/kevinmcaleer/bare_bones
Rangefinder.py
Below is a simple MicroPython class for measuring distance with a range finder:
# Range finder
from machine import Pin
from time import sleep, sleep_us, ticks_us
class RangeFinder():
def __init__(self,trigger_pin:int = 0, echo_pin:int = 1):
self.trigger = Pin(trigger_pin, Pin.OUT)
self.echo = Pin(echo_pin, Pin.IN)
def distance(self):
""" Returns the distance in cm """
# set the signal on & off times to zero
signalon = 0
signaloff = 0
# reset the trigger
self.trigger.low()
sleep_us(2)
self.trigger.high()
sleep_us(5)
self.trigger.low()
while self.echo.value() == 0:
signaloff = ticks_us()
while self.echo.value() == 1:
signalon = ticks_us()
elapsed_microseconds = signalon - signaloff
self.duration = elapsed_microseconds
self.distance_to_object = (elapsed_microseconds * 0.343) / 2
return round(self.distance_to_object / 10 ,1)
Bare Bones - a simple Skeleton program
Here is a simple program that detects the presence of a person and then triggers the scared stiff expression:
"""
This project uses the Pimoroni MicroPython build
https://github.com/pimoroni/pimoroni-pico/releases
"""
# Scared
# October 2022
# Kevin McAleer
from servo import Servo
from range_finder import RangeFinder
from time import sleep
MAX_ANGLE = 70
MIN_ANGLE = 10
SCARED_DISTANCE = 30.0
class BareBones():
rangefinder = RangeFinder()
def __init__(self):
self.servo = Servo(16)
def scared_face(self):
""" Open the Jaw and raise the eyebrows """
self.servo.value(MAX_ANGLE)
print('I\'m scared!')
def not_scared_face(self):
""" Close the Jaw and lower the eyebrows """
self.servo.value(MIN_ANGLE)
print('I\'m not scared anymore')
def is_scared(self):
if self.rangefinder.distance() <= SCARED_DISTANCE:
return True
else:
return False
# Main Program
skeleton = BareBones()
while True:
if skeleton.is_scared():
skeleton.scared_face()
else:
skeleton.not_scared_face()
sleep(0.25)
Assembly
Bottom section
The first part to start with is the bottom section.
Servo
Screw in the servo using 2 M2 bolts. The servo spindle should be towards the middle of the robot.
Cog
- Cut the
servo hornwith a pair of wire cutters so that it fits into thecog - Push the
servo Hornonto thecog - Make sure the servo is at the minimum rotation position (turn it clockwise until it doesnβt turn any more)
- Push the
cogonto theservo spindle. - Ensure the cog can turn correctly and doesnt catch on any rough 3d printed parts
Jaw
- Slide the jaw into place under the cog - the jaw should be in the closed position
The Eye Brows
- Slide the Eyebrows into place under the cog - the eye brows should be in the closed position
The Gasket
- The gasket adds a little extra room for the cog without affecting the flat underneath of the top section
- It means we can print out other sizes if this doesnβt work correctly
Top Section
- Push the captive M3 nuts into the nut-holes on the bottom section. Use plyers to gently push them into place
- Screw the 3 M3 bolts into place
The Range Finder
- Screw the Range finder into place using the M2 bolts - they wont go all the way in, which is expected
The Skull
- Glue the skull into place but applying superglue onto the raised box section - (adult supervison required!)
- Wait for the glue to set before moving onto the next step (30 minutes for fast setting glue).
The Pico
- Flip the robot over and attach the Pico using 4 M2 bolts
Well done - youβve assembled the robot, next to wire it up
Wiring up the Robot - plug and play
Connect the servo
- Connect 3 male to femail Dupont cables from the
servoto the5v,GNDand the signal line toGPIO15 pinon the Pico - The middle wire is the
5vline - The brown wire is the
GNDline - The orange wire is the
signalline
Connecting the HC-SR04 Range Finder
- Connect 4 male to male Dupont cables from the
range finderto:
- the
VCCto the3von the Pico - the
GNDto aGNDon the Pico (there are a few to choose from) - The
TriggertoGPIO00 pinon the pico - The
EchotoGPIO01 pinon the pico
The STL files
Skeleton
There are a few parts to download and print:
top.stl- the top sectionbottom.stl- the bottom sectionskull.stl- the front skullcog.stl- the servo cogeyebrows_v2.stl- the eye browsjaw.stl- the jawgasket_v3.stl- the gasket
If you want the Pumpkin version here are the STL files youβll need (the electronics are exactly the same).
Pumpkin
top.stl- the top sectionbottom.stl- the bottom sectioncog.stl- the servo coggasket_v3.stl- the gasket (you may need x2 of these)eyebrows_v2.stl- the eye browsjaw.stl- the jawpumpkin.stl- Pumpkin faceeyemask.stl- Eye mask (goes behind the pumpkin face, best printed in Black PLA)
If you enjoy these files, please consider buying me a coffee (it took a while to design these!)
This page is awesome - Show some love!











Comments