Introduction: Automated Gyro Wheel Toy

I had a simple gyro wheel toy and decided I wanted to automate it. Took a single servo, attached it to an axle and attached the toy to the axle. Then made a simple magnetic switch with a ball point pen spring, hooked that and the servo to and Arduino Uno. The program is very short and simple. But I have future plans to make it more interesting. Stay tuned for Version 2 and 3.

Step 1:

Arduino Code:


#include
Servo servo1;

int servangle = 0;// servo angle variable

int potPin = 2; // select the input pin for the potentiometer

int ledPin = 13; // select the pin for the LED

//Analog read pins const

int buttonPin = 2;

void setup()

{ Serial.begin(9600);

pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT

pinMode(buttonPin,INPUT);

servo1.attach(9);

delay(1000);

servo1.write(90);

delay(5000);

servo1.write(172); }

void loop() {

if (digitalRead(buttonPin) == HIGH) {

digitalWrite(ledPin,HIGH);

servo1.write(90);

delay(1200);

servo1.write(172);

digitalWrite(ledPin,LOW);

}

}


Comments

author
PRO DR MR BOB (author)2014-09-28

cool now that robot live the dream of all 10 year olds across the world for ever until a 10 year old touches it and brakes it. grate project love the idea of making it be able to make it go both ways that would be cool if if would switch off left then right automaticly!

author
JimRD (author)2014-09-17

Thank you so much. It is kind of useless at this point but I hope to make it more purposeful in the future. But I think useless machines can also make life more interesting. At the very least they show us what our lives shouldn't be like; I should put a sign on it "Don't Live Life Like This!"

author
apburner (author)2014-09-17

Wow. That is one of the coolest little arduino machines I have ever seen. Great idea and implementation. Well done.

About This Instructable

1,283views

17favorites

License:

Bio: I am an American teaching English at Shangluo University, Shaanxi. I like making machines that do interesting but fairly useless things - I call them Quixotic ... More »
More by JimRD:Pendulum CarArduino Controlled Morse Code Key and TransmitterMagnetic Levitating Globe Tear-apart and Fix
Add instructable to: