Sunday, September 19, 2010

Four Dollar Gyroscope Video

Here is a video of the low-cost gyro connected to my Arduino.

I need to change the gray-scale wheel to a transparent sheet, to put the motor in reverse when the tilt is the other way, and probably need to dampen the swinging that may take place. All in due time. See previous blog entry for details.
http://www.youtube.com/watch?v=DV1WhzCjSl8

Four-Dollar Gyroscope

I got an Arduino and after tinkering a bit, I thought that I would make a Segway-type balancing thing. My first thought was to use a WiiMote, but I found out that it only had accelerometers and no gyro. Not wanting to spend $100 on a gyro shield, I thought up a low-cost version using a $4 slotted optical switch (in my case, a OBP804), a weighted wheel (which will always be weighted-side down, thanks to gravity), and a grey-scale color-wheel attached to the weighted wheel.
The gray-scale wheel was supposed to be printed on transparency (clear) paper, but I did not have it available. However, the results are spectacular! Reading the analog output, I get 3 with black, 70 at white, and linear readings throughout the gray-scale! I am sure the resolution will be much better if printed on clear plastic and resolution will be improved if a larger gray-scale range is used. (I photo-shopped three gray lines of incrementing darkness).
The optical switch has a NPN phototransistor built-in (the ones with the photodiodes probably won't work) and an infrared LED. Make sure you use a resistor on the LED, as I blew my first one (making this an $8 gyro). I will try to get the video online shortly.

 [Wiring info: I used an OPB804. The dot is on pin3! I connected pin1 to Vcc, pin2 to a resistor (I use 500 ohms to be safe), and then to ground. Pin3 I connect to Vcc via an LED (as an indicator). Pin 4 goes to my Arduino's Analog In and also to a resistor (3000 ohms) to ground. ]