← Advanced Instrumentation

PHYS 351 · Advanced Instrumentation

Lab 4 · Motor control with Raspberry Pi & IRL510

PHYS 351 LAB 4
Motor Control with Raspberry Pi and IRL510

© Ran Yang, Ph.D.
SUBMISSION   Submit the completed lab report as a PDF on Gradescope.

Due: 2:00 p.m. next Monday.

Policies and Instructions
  1. Report Format: Submit a formal, typed lab report in PDF format. Handwritten lab reports will not be accepted. Hand-drawn circuit schematics are allowed only when explicitly permitted in the task instructions. Include screenshots, code, and simulation or measurement results where specified.
  2. AI Policy: The use of any AI tool, including a large language model (LLM), to write, generate, debug, or modify code or any portion of the lab report is prohibited unless the course instructor grants explicit permission in advance. A teaching assistant (TA) cannot grant permission to use AI tools.

By signing below, I acknowledge that I have read and understood the policies and instructions above and agree to follow them.

Student Name (print):  

Student Signature:       Date:  

Introduction

In this lab, you will use the Raspberry Pi’s GPIO pins for motor control. Because the Raspberry Pi has limited current-output capacity, you will use a separate power supply and an IRL510 MOSFET to control a DC motor. This experiment develops your understanding of PWM signals, motor-control circuits, and rotation-rate measurement techniques.

Tasks

  1. Setting Up the Environment and PWM Analysis:
    1. Create a dedicated folder in the terminal for your programs and screenshots. (Note: This should be standard practice for every lab session.)
    2. Connect GPIO pin 12 to the oscilloscope.
    3. Develop a Python program to generate a range of PWM signals.
    4. Analyze the range of validity for the PWM output. Determine for which frequency and duty cycle values it functions as expected.
    5. Document your findings, including oscilloscope screenshots for various PWM settings.
TASK APPROVAL Task 1 (PWM Analysis)

Course Instructor or TA Signature:  

Date and Time:  

  1. Motor Control Circuit with IRL510:
    1. Carefully review the datasheet of the IRL510 MOSFET.
    2. Identify and document the device pinout.
    3. Design and construct a circuit on the breadboard using:
      • One IRL510 chip
      • A DC motor
      • A +5 V power supply. Do not use the Raspberry Pi as the motor power source.
    4. Before powering on the motor, have the course instructor or a TA verify your circuit.
    5. If the motor fails to rotate, troubleshoot the issue independently before seeking assistance.
TASK APPROVAL Task 2 (IRL510 Motor Control)

Course Instructor or TA Signature:  

Date and Time:  

  1. Integrating Raspberry Pi Control:
    1. Disconnect the +5 V gate-voltage supply from the IRL510.
    2. Connect GPIO pin 12 to the gate pin of the IRL510.
    3. Modify your Python code to enable control of the motor’s rotation speed using PWM signals.
    4. Demonstrate variable speed control of the motor using your Raspberry Pi.
TASK APPROVAL Task 3 (Raspberry Pi Integration)

Course Instructor or TA Signature:  

Date and Time:  

  1. Motor Rotation Rate Measurement and Analysis:
    1. Design and implement a detection system to measure the motor’s rotation rate. (Hint: Consider using an LED and a photodiode for this purpose.)
    2. Create a comprehensive table displaying the relationship between duty cycle and RPM. Include at least 10 data points.
    3. Plot RPM versus duty cycle using your collected data.
    4. Derive a mathematical formula to calculate RPM from the duty cycle.
    5. Critically analyze and discuss the accuracy of your measurements, considering potential sources of error and limitations of your setup.
TASK APPROVAL Task 4 (Rotation-Rate Analysis)

Course Instructor or TA Signature:  

Date and Time:  

Closing Tasks

  1. Transfer all files, including programs, data, and documentation, from the Raspberry Pi to your laptop.
  2. Ensure you properly power off the Raspberry Pi.
  3. Review your collected data and begin drafting your lab report, ensuring all required elements are included.

Submission Reminder

  • Oscilloscope screenshots of your PWM signals and the documented range of valid frequency and duty-cycle settings.
  • The IRL510 datasheet pinout and your motor-control circuit schematic.
  • Your complete, commented Python scripts for PWM generation and motor-speed control.
  • The duty-cycle-vs-RPM table (at least 10 data points), the corresponding plot, and your derived RPM formula.
  • A discussion of the accuracy of your measurements and potential sources of error.
  • A discussion of any challenges encountered and how you overcame them.

← All course materials