[NOT FINAL] Lab #8: Motor Speed Control

Motor speed control with PWM

The motors in your Launchpad Sidekick kits require more than 3V to operate. Thus, you will need to hook into a 5V supply in order to drive them. The test point to the right of the USB connector on your g2553 Launchpads provides a 5V source. Use an N-channel mosfet to control the motor, driving the gate with PWM.

Task 1: Wire up your motor to your launchpad:

  1. Connect the two inputs of the motor to your breadboard. Tape/glue a circle of cardboard to the drive pin of the motor so that you can see the motor rotating.
  2. The N-channel MOSFET transistor will act as a switch on the “low-end” of the motor. Thus, you should connect the Drain of the transistor to one wire of the motor, and +5V to the other wire. The Source of the transistor should be connected to ground, and the Gate should be connected to a PWM drive pin of the MSP430.
  3. Use PWM to drive the motor at different speeds.

Showing information via an LCD display

The product page for the LCD display is here. You will also find two data sheets - the primary one and one with more detail about the character maps.

Task 2: Display a message on the LCD display.

  1. Wire up the LCD display either in 4 pin or 8 pin mode.
  2. Display the message “000 RPM”.
  3. Write a function to send out an arbitrary RPM message.

Measuring rotation speed using a Hall-effect sensor

The product page for the hall-effect sensor is here. Datasheet.

Task 3: Integrate the Hall sensor.

  1. Add the Hall sensor to your breadboard with the input connected to a MSP430 pin.
  2. Implement a magnetic switch where bringing a magnet close to the sensor turns off/on the LED. (This will help you understand the effect of magnet distance and orientation.)

Final device

Now, put it all together. Add the magnet to the carboard being driven by the motor. Count the sensed magnetic switches and use this to set the PWM level to achieve a particular level of RPMs. Film a video where the motor runs at 10 RPM for 30 s and then 30 RPM for 30 s. Turn in your video and code!