← Advanced Instrumentation

PHYS 351 · Advanced Instrumentation

Lab 8 · ADC with SPI & remote access

PHYS 351 LAB 8
ADC with SPI and Remote Access

© 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

This week, we continue to explore different sensors communicating with a Raspberry Pi via serial protocols. While I2C is a popular serial protocol due to its simplicity, we will investigate another synchronized serial protocol called SPI (Serial Peripheral Interface) with an analog-to-digital converter chip, the MCP3008. Throughout the lab, capture screenshots, pictures, and videos as necessary and include them in your report. Remember to annotate your Python scripts with descriptive comments.

Tasks

  1. Initial Setup and Configuration
    1. Connect your Raspberry Pi to the internet.
    2. Create a new directory for this lab using terminal commands.
    3. Update and upgrade the operating system.
    4. Enable SPI in the Raspberry Pi settings.
    5. Download ADC3008_SPI.py to your newly created directory.
  2. ADC Implementation
    1. Connect the MCP3008 ADC correctly to the Raspberry Pi.
    2. Write code to read the output as a voltage (v_volt).
    3. Demonstrate your program to the course instructor or a TA.
  3. Voltage Testing and Calibration
    1. Build a circuit that can output various voltages from 0 V to 3.3 V.
    2. Connect the circuit output to a digital multimeter (DMM).
    3. Verify that your Python code output matches the DMM readings, with proper error handling.
    4. Document the testing process and results.
TASK APPROVAL Tasks 1–3 (ADC Setup and Calibration)

Course Instructor or TA Signature:  

Date and Time:  

  1. Code Enhancement and Data Analysis
    1. Modify your code to output v_frac (0 to 1023) based on input voltage, for at least 20 data points.
    2. Create and plot the v_volt vs. v_frac relationship.
    3. Include analysis of the linearity and accuracy of the measurements.
  2. Waveform Analysis
    1. Use a function generator to create a sine wave input.
    2. Connect the signal to both the ADC and an oscilloscope.
    3. Modify your code to plot voltage vs. time, matching the oscilloscope trace.
    4. Determine the maximum frequency capabilities of the setup.
    5. Analyze and document the frequency limitations.
TASK APPROVAL Tasks 4–5 (Data and Waveform Analysis)

Course Instructor or TA Signature:  

Date and Time:  

  1. SSH Remote Control
    1. Find and document your Raspberry Pi’s IP address.
    2. Enable remote control in the settings.
    3. Establish an SSH connection from your laptop.
    4. Demonstrate remote operation of your voltage measurement program.
  2. VNC Remote Desktop
    1. Configure a VNC server on the Raspberry Pi.
    2. Install a VNC viewer on your laptop.
    3. Demonstrate remote desktop access.
    4. Run and display the temperature sensor program remotely.
TASK APPROVAL Tasks 6–7 (Remote Access)

Course Instructor or TA Signature:  

Date and Time:  

Submission Reminder

  • Complete circuit diagrams and connections for the MCP3008 ADC setup.
  • An explanation of the functionality of ADC3008_SPI.py.
  • Your modified Python scripts with clear comments explaining the functionality.
  • Plots and analysis of voltage measurements and waveform data.
  • Documentation of frequency limitation testing and results.
  • Screenshots demonstrating successful remote access implementations.
  • A discussion of any challenges encountered and their solutions.
  • (Optional) A link to a video demonstrating the remote control capabilities.

← All course materials