Lab 7: Output — DC Motors

Description

Circuit Wiring (left) and Circuit Diagram (Right) from Lab 7
Transistor (from Lab 6)
Diode and Circuit Symbol (Source: ElectricalTechnology.org)

Components Used

  • Arduino Uno
  • Breadboard
  • Lots of Circuit Wires that can be cut
  • Wire cutters
  • 1 Red-colored circuit wire (for 5-volt connection)
  • 1 Black-colored circuit wire (for ground)
  • 1K ohm Resistor
  • Diode (marked 1N4004)
  • Transistor (marked TIP120)
  • Battery pack and batteries that fit the pack (this lab uses 2 AA batteries with a pack for them)
  • DC Motor
  • Corkscrew
  • Some form of input from a previous lab (this lab uses a Potentiometer)
  • Dare Wheel
  • Duct tape
  • Paper Clip
  • Tooth Pick

Code

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

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);
}

Images

Circuit with DC Motor and Potentiometer
The wheel used for the Dare Wheel (Source: SpinTheWheel.app)

Videos

DC Motor in action
Spin the Dare Wheel if you dare

--

--

--

Hello! I’m a 5th Year Masters in EECS! I’m interested in Software Engineering, Machine Learning, and HCI. Also interested in CS Education and Tech Ethics!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Swiggy Group Order

How to make design and front-end friends

Abstract

My Sales Process

UX: the responsibility

Interstate, a look back

UXD Week-1 Reflection…..

Design for Others: Fox Theater App for Spelman College

Re-thinking design thinking part II: What is wrong with the design thinking process

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Oscar Chan

Oscar Chan

Hello! I’m a 5th Year Masters in EECS! I’m interested in Software Engineering, Machine Learning, and HCI. Also interested in CS Education and Tech Ethics!

More from Medium

Vegaswap Relaunch Timelines ⌛

BiFARMS automatically maximizes user rewards from liquidity pools

13 Best Backlink Checker SEO Tools of 2021 — Reviewed

Axelar — future for cryptotransaction freedom