Description
I hook the motor to a piece of paper at a point that's not the center of mass so that the motor creates a vibrating motion when it's turned on. And then I hang a wind chime on the motor so that it will sound when the motor vibrates. This can be used as a peripheral display and when there's a incoming message or alarm alert, the chime will sound. I tried multiple settings before this, including to blow wind at the wind chime or to vibrate a glass of water so that'll create interesting ripples. But neither of them worked out for me. The wind created by the motor was to small to make wind chime sound and the vibrating was too frequent to create a visible ripple.
For the demonstration purpose, I use a petentiometer to control the motor and the code is the same as the sample code.
Components:
1- Arduino Uno Microcontroller
1- Breadboard
1- 220 Ω Resistors
1- 10k Resistor
1- Wind Chime
1- USB Cable
1- Force Sensor
1 - DC Motor
1 - Diode (1N4004)
1 - Transistor (TIP120)
2 - AA 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
}
- Login to post comments