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.
Preparation Tasks
-
Setting Up Raspberry Pi:
- Turn on the Raspberry Pi computer.
- Confirm that you can see the Raspberry Pi OS desktop.
-
Preparing Your Workspace:
- Open the terminal on the Raspberry Pi.
- Check the installed Python version.
- Create a new directory named “
YourFirstName_python” inside/home/pi/Documents.
Basic LED Operations
-
Blinking a Single LED:
- Open VS Code and create a new
.pyfile in the directory you created. - Write code to turn on one LED and save the file.
- Construct the circuit based on your code.
- Before running the code, show the circuit and code to the course instructor or a TA for approval.
- Open VS Code and create a new
-
Alternating Between Two LEDs:
- Duplicate the
.pyfile from the previous task. - Modify the code to alternate between turning on a blue LED and a green LED every 2 seconds.
- Build the circuit and verify its timing using an oscilloscope.
- Record the highest frequency achieved and check for timing jitter at higher frequencies.
- Save oscilloscope screenshots to a USB drive and then to your computer.
- Duplicate the
Course Instructor or TA Signature:
Date and Time:
Advanced LED Operations
-
Sequential LED Lighting:
- Save your current program as a new copy.
- Modify the code to illuminate three LEDs sequentially. Use a new color, red, for the third LED.
- Build the circuit and test your code.
-
RGB LED Flashing:
- Write a program that makes an RGB LED flash its three colors in sequence at a visible rate.
- Build the circuit and demonstrate its operation to the course instructor or a TA.
-
LED Brightness Control with PWM:
- Write a program that changes an LED’s brightness using pulse-width modulation (PWM).
- Modify the duty cycle and frequency, and use an oscilloscope to monitor the output waveform.
- Report the waveform period and on-time in your lab report, and explain how PWM works.
- Evaluate whether this method provides better timing compared to previous tasks.
Course Instructor or TA Signature:
Date and Time:
-
RGB LED Breathing Effect:
- Write a program that makes an RGB LED “breathe” through all three colors using a pattern of your own design.
- Build the circuit and demonstrate its operation to the course instructor or a TA.
Course Instructor or TA Signature:
Date and Time:
Clean-Up and Data Transfer
-
Save and Remove Work:
- Copy the directory you created in the first task, including all files, to your own computer.
- Delete this directory from the Raspberry Pi.
Course Instructor or TA Signature:
Date and Time:
Note: Always save your new programs as a new copy for each task.
Submission Reminder
- Complete, commented Python scripts for each task.
- Oscilloscope screenshots demonstrating the LED timing (Task 4) and the PWM waveform (Task 7).
- The recorded maximum frequency and any timing jitter you observed.
- An explanation of how PWM works and a comparison of its timing performance to the earlier tasks.
- 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 8: your breathing-effect script, a description of your pattern, and a photo or short video of it running.
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.