DC motors and Potentiometer (Arduino)

Albert Hodo
1 min readOct 20, 2022

Albert Hodo. Tangibe User Interface, Fall 2022

Prompt:Explore motion as an output, in a form of a display or tactile feedback. Use your DC motor to create a vibration or rotational motion (e.g., pinwheels, dancing wires, etc.)

Components Used

  1. Bread Board
  2. Arduino Uno
  3. Jump Wires
  4. 1 10K Resister
  5. 1 Transistor
  6. 1 Capacitor
  7. Batteries and Battery Pack

Process

I attached a folded paper with 2 pointed edges to the DC motor to act create a fan and used the potentiometer to control the speed on the fan.

Code

/* DC Motor with potentiometer control
* Theory and Practice of Tangible User Interfaces
* Fall 2022
*/

int motorPin = 9;
int potPin = A0;
int potVal = 0;
int motorCtrlVal = 0;
void setup() {
pinMode(potPin, INPUT);
pinMode(motorPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
potVal = analogRead(potPin);
Serial.print("potVal: ");Serial.println(potVal);
motorCtrlVal = map(potVal, 0, 1024, 0, 255);
Serial.print("motorCtrlVal: ");Serial.println(motorCtrlVal);
analogWrite(motorPin, motorCtrlVal);
}

Demo

Demo with Off-center Material

--

--

Albert Hodo

I’m a first year MDes student at UC Berkeley. A master’s jointly run by the College of Engineering and Environmental Design. I love outer space and tangible UI.