Description
I started this project by wanting to create a moving cat toy for my kitten, Juno. She’s home by herself most of the day and gets quite bored. This would be a way to keep her entertained, as well as healthy. I failed to see the flaws in my plan, however: 1. cats are afraid of loud noises, and 2. they’re more interested in playing with wires than the toy.
Juno, ruining her chances of a new toy
I changed direction and decided to create a toy for myself from my childhood: a pinwheel. I’m quite a fan of origami, so I welcomed the exercise. I created the pinwheel from a large piece of orange construction paper (a tribute to the Giants who just lost the series), used a ceramic straw to form a sturdy base, and two LEDs on either side to create a fun, multi-colored spiral effect. I also added a piece of cork to keep the pinwheel from flying off the motor. Finally, the potentiometer controls how quickly the pinwheel spins.
Components:
- 1 Arduino
- 1 Breadboard
- 1 Resistor (1kΩ)
- 1 potentiometer
- 1 DC motor
- 1 Transistor
- 1 Diode
- Several jumper cables
- Tape
- 1 Ceramic straw
- 1 Piece of cork from a wine bottle
- 1 Piece of orange construction paper (and 1 paper cut)
- 2 LED lights
- 2 Cell batteries
Code
/* * one pot fades one motor * modified version of AnalogInput * by DojoDave <http://www.0j0.org> * http://www.arduino.cc/en/Tutorial/AnalogInput * Modified again by dave */ int potPin = 0; // select the input pin for the potentiometer int motorPin = 9; // select the pin for the Motor int val = 0; // variable to store the value coming from the sensor void setup() { Serial.begin(9600); } void loop() { val = analogRead(potPin); // read the value from the sensor, between 0 - 1024 Serial.println(val); analogWrite(motorPin, val/4); // analogWrite can be between 0-255 }