1 / 1
Spooky Scary Skeleton Robot — image 1

Spooky Scary Skeleton Robot

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

This is a fun Halloween project you can build with an SG90 Servo, HC-SR04P range finder and a Raspberry Pi Pico

Rating
4.333 / 5
Likes
69
Downloads
161
Makes
4
Views
2,092
Reviews
3

Updated at source:

Model information

License
GNU General Public License v2.0

 

 

Build your own cute Spooky Scary Skeleton Robot for Halloween - Using a Raspberry Pi Pico/Pico W, HC-SR04 Ultrasonic Range finder, and an SG90 Servo.

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

PartDescriptionQtyCost
Raspberry Pi PicoThe $4 microcontroller from Raspberry Pi1£4.00
ServoA low cost SG90 Servo1£3.00
Ultrasonic Range FinderHC-SR04 3.3v version1£2.00
M2 BoltsSecurely attach the Pico W and Ultrasonic Rangefinder using M2 Bolts8£0.80
M3 Bolts and nutsSecurely attach the top section to the bottom3£0.60
Female to Female Dupont cablesFor attaching the Pico to the servo and Range finder4£1.00
Male to Female Dupont cablesFor attaching the Pico to the servo and Range finder3£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 Base

The first part to start with is the bottom section.

SERVO

The Servo

Screw in the servo using 2 M2 bolts. The servo spindle should be towards the middle of the robot.

COG

The Cog

  1. Cut the servo horn with a pair of wire cutters so that it fits into the cog
  2. Push the servo Horn onto the cog
  3. Make sure the servo is at the minimum rotation position (turn it clockwise until it doesn’t turn any more)
  4. Push the cog onto the servo spindle.
  5. Ensure the cog can turn correctly and doesnt catch on any rough 3d printed parts

JAW

The Jaw

  1. Slide the jaw into place under the cog - the jaw should be in the closed position

THE EYE BROWS

The Eye brows

  1. Slide the Eyebrows into place under the cog - the eye brows should be in the closed position

THE GASKET

The Gasket

  1. The gasket adds a little extra room for the cog without affecting the flat underneath of the top section
  2. It means we can print out other sizes if this doesn’t work correctly

TOP SECTION

The Top section

  1. Push the captive M3 nuts into the nut-holes on the bottom section. Use plyers to gently push them into place
  2. Screw the 3 M3 bolts into place

THE RANGE FINDER

The Range Finder

  1. Screw the Range finder into place using the M2 bolts - they wont go all the way in, which is expected

THE SKULL

The Skull

  1. Glue the skull into place but applying superglue onto the raised box section - (adult supervison required!)
  2. Wait for the glue to set before moving onto the next step (30 minutes for fast setting glue).

THE PICO

The Pico

  1. 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

Wiring Diagram

CONNECT THE SERVO

  1. Connect 3 male to femail Dupont cables from the servo to the 5v, GND and the signal line to GPIO15 pin on the Pico
  2. The middle wire is the 5v line
  3. The brown wire is the GND line
  4. The orange wire is the signal line

CONNECTING THE HC-SR04 RANGE FINDER

  1. Connect 4 male to male Dupont cables from the range finder to:
    • the VCC to the 3v on the Pico
    • the GND to a GND on the Pico (there are a few to choose from)
    • The Trigger to GPIO00 pin on the pico
    • The Echo to GPIO01 pin on the pico

THE STL FILES

SKELETON

There are a few parts to download and print:

If you want the Pumpkin version here are the STL files you’ll need (the electronics are exactly the same).

PUMPKIN

If you enjoy these files, please consider buying me a coffee (it took a while to design these!)

Tags