Project showcase
Quadruped Pumpkin

Quadruped Pumpkin © GPL3+

Don't just have a Jack-o-Lantern sit motionless on the porch! Give it some life and limbs!

  • 500 views
  • 1 comment
  • 7 respects

Components and supplies

Necessary tools and machines

6V Power Supply
3drag
3D Printer (generic)
X-Acto Knife
Hy gluegun
Hot glue gun (generic)

About this project

Much like Frankenstein's monster, pumpkins become more interesting once electricity becomes involved.

My goal for this year's custom Halloween decoration was to create a seemingly normal pumpkin that when prompted will extend its legs and reveal that it is in fact a robot in disguise.

Short Demo Video

The robot uses 8 servo motors to actuate the legs. In its current version it can only extend and retract its legs to stand itself up and return itself to pumpkin form; in a future update I intend to add four more to give the robot the ability to walk around. Unfortunately, the adhesives used to secure the plastic skeleton to the foam leg pieces created a weaker connection than I anticipated so in the attached media files the pumpkin is propped up on a stand so the legs aren't supporting the body. Although the servos are powerful enough to stand the robot up the leg pieces would likely need additional support to endure the shear forces at the interface.

An Arduino Nano receives input from a potentiometer and outputs a signal to the servo driver. Due to the asymmetric nature of the pumpkin each servo has a unique set of angle values associated with a fully contracted and fully expanded state. These values are used with the mapping function so, as the potentiometer is rotated, each of the legs ranges from fully contracted to fully standing while constraining the motion to their predetermined range.

Code

Quadruped Pumpkin CodeArduino
The values in lines 16-19 will vary depending on the exact setup to determine what angle is closed and open
#include <Adafruit_PWMServoDriver.h>
#include <Wire.h>

Adafruit_PWMServoDriver servos = Adafruit_PWMServoDriver();
const int potPin = 0;

void setup() {
  Serial.begin(9600);
  servos.begin();
  servos.setPWMFreq(60);
  delay(10);
}

void loop() {
  int potVal = analogRead(potPin);
  moveLeg(potVal, 0, 4, 96, 54, 180, 120);   // Leg 1
  moveLeg(potVal, 1, 5, 83, 34, 180, 120);   // Leg 2
  moveLeg(potVal, 2, 6, 83, 37, 180, 120);   // Leg 3
  moveLeg(potVal, 3, 7, 95, 27, 180, 115);   // Leg 4
  Serial.println(potVal);
  delay(20);
}

//----------------------------------------------------------------------------------------//
int angle2pulse(int angle){
  int pulseLength = map(angle, 0, 180, 150, 600);
  pulseLength = constrain(pulseLength, 150, 600);
  return pulseLength;
}

void moveLeg(int potVal, uint8_t hip, uint8_t knee, int closedHipAngle, int closedKneeAngle,int expandedHipAngle,int expandedKneeAngle){
  int angle_H = map(potVal, 0, 1024, closedHipAngle, expandedHipAngle);
  int angle_K = map(potVal, 0, 1024, closedKneeAngle, expandedKneeAngle);
  servos.setPWM(hip, 0, angle2pulse(angle_H));
  servos.setPWM(knee, 0, angle2pulse(angle_K));
}

Comments

Similar projects you might like

Magic Arduino Ball

Project showcase by Ruben Zilzer

  • 2,284 views
  • 1 comment
  • 6 respects

Multi-Dashboard Display with Arduino Controller

Project showcase by Colin O'Dell

  • 28,096 views
  • 6 comments
  • 79 respects

JQR Quadruped Autonomous Robot ***UPDATE 25/May/2019***

Project in progress by aldoz

  • 18,200 views
  • 42 comments
  • 144 respects

Buddy, the 3D-Printed Arduino Social Robot

Project showcase by Slant Concepts

  • 7,910 views
  • 6 comments
  • 67 respects

Animated Pumpkin

Project showcase by Matthew Irwin

  • 3,055 views
  • 4 comments
  • 9 respects

Smart Halloween Pumpkin Lamp

Project tutorial by Luigi Francesco Cerfeda

  • 2,762 views
  • 0 comments
  • 9 respects
Add projectSign up / Login