Smalls
Published

Breathing Mechanism for Animatronic Puppets & Companion Bots

Simulate realistic breathing inside your puppet or animatronic companion bot.

IntermediateFull instructions provided4 hours659
Breathing Mechanism for Animatronic Puppets & Companion Bots

Things used in this project

Hardware components

MG90S Servo
×1
Arduino UNO
Arduino UNO
×1
M1.2 x 4mm Screws
×2
M2 x 10mm Screws
×4
6 x 15 mm 2.3lb Springs
×8
24 guage craft wire
×1
Jumper wires (generic)
Jumper wires (generic)
×1
hot glue
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Breathing Mechanism Enclosre

I printed with 4 shells and at 20% infill.

Schematics

3D Print Files

Code

Servo Neutral

Arduino
Set servos to the neutral 90 degree position, attach servo to pin 9.
#include <Servo.h>

//Created by Smalls on January 1 2024

Servo right; //create servo object to control a servo
Servo left; //create servo object to control a servo
Servo center; //create servo object to control a servo
// twelve servo objects can be created on most boards
     
void setup() {
  right.attach(9); //attaches the servo on pin 9 to the servo object
  left.attach(10); //attaches the servo on pin 9 to the servo object
  center.attach(11); //attaches the servo on pin 9 to the servo object
}

void loop() {
  right.write(90); //resets servo to neutral position
  left.write(90); //resets servo to neutral position
  center.write(90); //resets servo to neutral position
  }            

Servo Easing Breathing

Arduino
Mimics breathing motion.
#include <ServoEasing.hpp> //makes sure to install in the same root library directory as servo.h is located in
#include <Servo.h>

//original code by Smalls 2024
//servoeasing library download link: https://www.arduino.cc/reference/en/libraries/servoeasing/
//servoeasing library documentation: https://github.com/ArminJo/ServoEasing 

ServoEasing breathe; //use this instead of Servo to define your object

void setup() {
  breathe.attach(2); //attaches the servo on pin 9 to the servo object  
  writeAllServos(90); //sets all servos to neutral middle position at boot
}

void loop() {
  breathe.attach(2); //attaches the servo on pin 9 to the servo object  
  breathe.setEasingType(EASE_QUARTIC_IN); //types of easing can be found at https://easings.net/ 
  breathe.easeTo(165, 45); //angle moved to and blocking aka time for arrival to the angle, lower the blocking number the slower the servo moves
  breathe.easeTo(90, 45); //sets servo back to neutral position
  breathe.detach(); //allows servo to rest and not hold a position if pressue is on it, preventing servo overheating 
}

Credits

Smalls

Smalls

6 projects • 27 followers
Making stuff, breaking stuff, and learning everything I can. IG & TT: @smallswonderworks

Comments