Mandy Meindersma
Published © CC BY

Remy the Rat

Who doesn't want to dress up as Alfredo Linguini for halloween? With a fully functioning Remy the Rat on their head!!

BeginnerFull instructions provided6 hours9
Remy the Rat

Things used in this project

Hardware components

Espressif ESP32 Development Board - Developer Edition
Espressif ESP32 Development Board - Developer Edition
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×2
4xAA battery holder
4xAA battery holder
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
heat gun + shrink wrap

Story

Read more

Schematics

Simple Circuit Diagram with two servos

This is actually my first circuit diagram I have made!

Code

Moving arms up and down randomly

Arduino
#include <ESP32Servo.h>
Servo rightServo, leftServo;

// credit to @shebuildsrobots for the initial idea and code!

void setup() {
  pinMode(A0, OUTPUT);
  pinMode(A2, OUTPUT);
  leftServo.attach(A0);
  rightServo.attach(A2);
}

void loop() {
  // Adjust the random params within the range for each servo. 
  // We move to a random location near the bottom of the servo's range,
  // wait a random amount of time, the move to a random location near the 
  // top of the servo's range.
  rightServo.write(random(5, 20));
  delay(random(850, 1150));
  leftServo.write(random(5, 20));
  delay(random(850, 1150));
  rightServo.write(random(150, 160));
  delay(random(850, 1150));
  leftServo.write(random(150, 170));
  delay(random(850, 1150));

  // I screwed in the arms of the servos differently and also the servos are
  // rotated I think? so if I set the arms to:
  // left - 0 - vertically up
  // right - 0 verticaly down
  // left - 180 - vertically down
  // right - 180 - vertically up
}

Credits

Mandy Meindersma
3 projects • 0 followers
Software Engineer by day, Hardware engineer by night! I love Iot, robotics, arduino, fashioneering, and anything else I can get my hands on!
Thanks to SheBuildsRobots.

Comments