Description
For this mini project, I made a small installation where people can control the rotational speed of dancing wires and see the change in the form of the dancing wires as the speed changes.
Components
- Arduino Uno
- Wires
- 1 Potentiometer
- 1 DC motor
- Batteries
- 1 Resistor
- 1 Diode
- 1 Transistor
- Tape
Code
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 }
Images
The whole connected device:
The wires dancing at different radiuses, when the rotational speed of the DC motor changes: