Automated Gyro Wheel Toy

1,296

17

3

Posted

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);

}

}


Share

Recommendations

  • Remote Control Contest 2017

    Remote Control Contest 2017
  • Arduino Contest 2017

    Arduino Contest 2017
  • LED Contest 2017

    LED Contest 2017

We have a be nice policy.
Please be positive and constructive.

Tips

Questions & Answers

3 Comments

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!

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!"

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