Lesson Plan: Week 8
In Week 8 we will do the following (please, click on the Segment links below to access the course materials):
Homework 7: Build a setup that combines the stepper motor with the potentiometer, and that uses the LCD display to show the motor RPM.
Goal: Understand how to use the stepper motor and the potentiometer as an 'analog user interface'
Set-up: Connect the potentiometer swiper (middle contact) to an analog pin. Connect the outer contacts of the pot to 5V and GND. Connect the stepper motor and the LCD display to the Arduino.
Programming: Program the Arduino that it reads out the voltage on the swiper of the potentiometer. Use this voltage reading to set the speed of the stepper motor. Calibrate the stepper motor RPM by counting the rounds per time at a given motor setting. Use this calibration value to calculate the actual RPM. Display the RPM on the LCD display including units. Make sure that the LCD display is updated periodically to show an up-to-date RPM value.
Stepper motor: Watch our stepper motor video. It will show you how to use the stepper motor driver board and how to program the motor. Make sure you use the stepper motor library (and experience the awesome power of OOP!) provided with the video and do not use the example code that was used to demonstrate the stepper functionality in the video.
Potentiometer: A potentiometer is a voltage divider that can be adjusted smoothly, i.e. the voltage at the swiper corresponds linearly (in most pots at least - there are some that give you a logarithmic dependency) with the angular position of the shaft. If voltage dividers are still a mystery, watch our EEawesome videos 7-9 at eeawesome.com.
To get credit: Come to class on the due date and present your working set-up to one of the TAs or Instructors.