Arduino Skull With Moving Mouth

Supplies needed

*Arduino module (I have an Arduino Mega 2560, but any module with PWM will work)

*Drill

*Drill bit(s)

*Paperclip

*Servo

*& type b usb

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Drill a Hole Big Enough for Your Paperclip on Whatever Side of the Jaw You Want the Servo & Paperclip to Be Mounted Onto.

Step 2: Shape Your Paperclip to Fold Onto the Servo/clip Onto & to Make the Other End Bent to Fit on the Jaw to Control the Movement.

I can't provide a picture of the servo, because it is mounted onto a box for another project.

Step 3: Wiring

Attach the signal pin of the servo to a PWM pin (for Mega 2560 it's pin 9). Attach the positive end of the servo to the INDEPENDENT power source. Attach BOTH the GND of the Arduino & GND of the power source to the servo's GND.

Step 4: Code (I Have No Credit to the Code FIY)

//www.elegoo.com

//2016.12.08

#include "Servo.h"

Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position

void setup()

{

myservo.attach(9); // attaches the servo on pin 9 to the servo object

}

void loop()

{

for (pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees // in steps of 1 degree

{

myservo.write(pos); // tell servo to go to position in variable 'pos'

delay(15); // waits 15ms for the servo to reach the position

}

for (pos = 180; pos >= 0; pos -= 1) // goes from 180 degrees to 0 degrees

{

myservo.write(pos); // tell servo to go to position in variable 'pos'

delay(15); // waits 15ms for the servo to reach the position

}

}

Halloween Contest 2019

This is an entry in the
Halloween Contest 2019

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    Discussions