← About PHYS 351

PHYS 351 · Advanced Instrumentation

Lab 4 · Motor control with Raspberry Pi & IRL510

Submission Submit the completed lab report as a PDF on Gradescope.

Due: 2:00 p.m. on the next Wednesday or Thursday.

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 diagrams will not be accepted; draw every schematic with software (see Software at the end of this manual). 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:

All tasks in this lab are required.

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 measurements of the motor’s rotation rate.

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 approvalTask 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 approvalTask 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 approvalTask 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 approvalTask 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.
  • An error analysis for every task where it applies: the uncertainty of each measured or calculated value, its main sources of error, and a comparison with the expected, simulated, or datasheet value.
  • A discussion of any challenges encountered and how you overcame them.
  • Task 4: the schematic of your rotation-rate detector, the duty-cycle-vs-RPM table (at least 10 data points), the corresponding plot, your derived RPM formula, and a discussion of the accuracy of your measurements and potential sources of error.
Software for drawing and simulation

Draw every circuit diagram with software; hand-drawn circuit diagrams will not be accepted. We recommend the free draw.io; the course’s Drawing Circuit Diagrams page shows how to set it up. If a component has no symbol of its own, use the closest one and label it clearly.

Where a task asks for a simulation: the web version of Multisim is no longer available. If you have a Windows computer, you can install the offline (desktop) version of Multisim; ask a TA for the serial number to install it. Otherwise, feel free to use any SPICE-based simulation tool, such as LTspice or ngspice.

← All course materials