Due: 2:00 p.m. on the next Wednesday or Thursday.
- 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.
- 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
-
Setting Up the Environment and PWM Analysis:
- Create a dedicated folder in the terminal for your programs and screenshots. (Note: This should be standard practice for every lab session.)
- Connect GPIO pin 12 to the oscilloscope.
- Develop a Python program to generate a range of PWM signals.
- Analyze the range of validity for the PWM output. Determine for which frequency and duty cycle values it functions as expected.
- Document your findings, including oscilloscope screenshots for various PWM settings.
Course Instructor or TA Signature:
Date and Time:
-
Motor Control Circuit with IRL510:
- Carefully review the datasheet of the IRL510 MOSFET.
- Identify and document the device pinout.
- 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.
- Before powering on the motor, have the course instructor or a TA verify your circuit.
- If the motor fails to rotate, troubleshoot the issue independently before seeking assistance.
Course Instructor or TA Signature:
Date and Time:
-
Integrating Raspberry Pi Control:
- Disconnect the +5 V gate-voltage supply from the IRL510.
- Connect GPIO pin 12 to the gate pin of the IRL510.
- Modify your Python code to enable control of the motor’s rotation speed using PWM signals.
- Demonstrate variable speed control of the motor using your Raspberry Pi.
Course Instructor or TA Signature:
Date and Time:
-
Motor Rotation Rate Measurement and Analysis:
- Design and implement a detection system to measure the motor’s rotation rate. (Hint: Consider using an LED and a photodiode for this purpose.)
- Create a comprehensive table displaying the relationship between duty cycle and RPM. Include at least 10 data points.
- Plot RPM versus duty cycle using your collected data.
- Derive a mathematical formula to calculate RPM from the duty cycle.
- Critically analyze and discuss the accuracy of your measurements, considering potential sources of error and limitations of your setup.
Course Instructor or TA Signature:
Date and Time:
Closing Tasks
- Transfer all files, including programs, data, and documentation, from the Raspberry Pi to your laptop.
- Ensure you properly power off the Raspberry Pi.
- 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.
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.