← All course materialsLecture 08 · ADC, SPI & remote accessReading notes →

Lecture 08: SPI, the MCP3008 ADC, and Remote Access

1 / 25
PHYS 351 · Lecture 0801

Lecture 08

SPI, the MCP3008 ADC, and Remote Access

Part 1 · three protocols · Part 2 · SPI on the wire · Part 3 · inside an ADC · Part 4 · program it · Part 5 · SSH and VNC · Part 6 · the final project

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0802

Part 1 · Three ways to talk to a chip

Three panels compare serial protocols. UART: the Pi's TX goes to the device's RX and back on a second wire, with no clock, so both ends must agree on the baud rate. I2C: the Pi and two chips at addresses 0x18 and 0x19 share two pulled-up wires, SDA and SCL, and each byte has an ACK or NAK bit. SPI: the Pi and one chip are joined by four wires, SCLK, MOSI and chip select from the Pi and MISO back; drivers are push-pull, the chip is picked by its own select wire, and there is no acknowledgment.

UART: no clock wire, so both ends agree on the speed. I²C: the MCP9808 and LIS3DH in Labs 6–7. Today, SPI: a data wire each way, a clock, and a chip select.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0803

Part 2 · SPI: four wires, and the Pi runs the clock

The Raspberry Pi as SPI controller and the MCP3008 as peripheral. SCLK from BCM 11 to CLK carries one bit per tick; MOSI from BCM 10 to DIN carries the request; MISO from DOUT back to BCM 9 carries the answer; chip select from BCM 8 (CE0) to the chip's CS/SHDN pin, active low, tells the chip to listen.

MOSI = controller out, peripheral in; MISO the reverse. Newer names: COPI/CIPO or SDO/SDI. The MCP3008 datasheet calls them DIN and DOUT.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0804

Where SPI lives on the Pi header

Raspberry Pi 40-pin header map distinguishing physical pin positions from BCM GPIO numbers and marking 3.3 V, 5 V, ground, I²C, UART, and SPI connections. Power pins are not GPIO inputs.
SignalBCMPin
MOSI1019
MISO921
SCLK1123
CE0824
CE1726
$ sudo raspi-config   # Interfaces → SPI
$ ls /dev/spidev*
/dev/spidev0.0  /dev/spidev0.1
© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0805

Chip select: one wire per chip, not an address

One Pi with three SPI chips. SCLK, MOSI and MISO are shared by all three. Each chip has its own select line: CE0, CE1 and an ordinary GPIO. CE0 is low, so the MCP3008 is talking; the other two chips have their select high and have released MISO to high impedance.

Only the chip whose CS‾\overline{\mathrm{CS}} is low listens and drives MISO; the rest let go. On the MCP3008, CS‾\overline{\mathrm{CS}} high also ends the conversion (datasheet §3.7).

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0806

Inside: two shift registers joined in a ring

Two 8-bit shift registers joined in a ring. The Pi's register holds 1100 1010 and the MCP3008's holds 0110 1100. MOSI carries the Pi's most significant bit out into the chip's least significant end; MISO carries the chip's most significant bit out into the Pi's least significant end. Each clock tick moves every bit one place.

Each side holds one byte.

Every SCLK tick, both registers shift one place.

The bit that falls off one end lands in the other chip.

A send is always a receive.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0807

Tick by tick: the two bytes trade places

The two shift registers after each of eight clock ticks, with the Pi's original bits shaded slate and the chip's shaded rose. At each tick one slate bit leaves the Pi and enters the chip while one rose bit enters the Pi. After tick 8 the Pi holds 0110 1100 and the chip holds 1100 1010: the bytes have traded places.

Follow a color: the Pi's slate bits march into the chip, the chip's rose bits march into the Pi. Eight ticks, one full byte each way.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0808

One byte on the wire, both directions at once

Timing of one SPI byte in mode 0. Chip select goes low, SCLK makes eight pulses, and on the same eight ticks MOSI carries the Pi's byte 0xCA (1100 1010) while MISO carries the chip's byte 0x6C (0110 1100). Both sides read at each rising edge and change their data on the falling edge.

Eight clocks move one byte each way. A command can span several bytes (the MCP3008 also wants a start bit), and the clock must stay within the chip's timing limits, pauses included.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0809

To read, you must write

The call spi.xfer2([0x01, 0x80, 0x00]) sends three bytes and receives three: 0x01 (start bit) returns an unknown byte, 0x80 (channel 0, single-ended) returns 0x?2 holding the null bit and B9 B8, and the dummy byte 0x00 returns 0x6C holding B7 to B0. Each byte takes 8 ticks in both directions.

The chip can only answer while the Pi clocks, and the Pi only clocks while it sends. Send three bytes, get three back. xfer2 holds CS‾\overline{\mathrm{CS}} low across all three, which the MCP3008 needs.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0810

Four clock modes: idle level and reading edge

The four SPI clock modes drawn against one row of data bits D7 to D0. Mode 0 (CPOL 0, CPHA 0) idles low and reads on the rising edge; mode 1 (CPOL 0, CPHA 1) idles low and reads on the falling edge; mode 2 (CPOL 1, CPHA 0) idles high and reads on the falling edge; mode 3 (CPOL 1, CPHA 1) idles high and reads on the rising edge. In every mode the reading edge falls in the middle of each data bit.

CPOL = the clock's idle level. CPHA = read on the first edge (0) or the second (1). Data is set up on the other edge, half a clock earlier.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0811

The MCP3008 reads on the rising edge: mode 0

MCP3008 datasheet Figure 1-1, serial interface timing: chip select falls at least t_SUCS before the first rising clock edge; DIN must be valid t_SU before and t_HD after each rising edge; DOUT leaves high impedance with a null bit, then MSB out, each changing t_DO after a falling clock edge, and returns to high impedance t_DIS after chip select rises, which must stay high for t_CSH.

Datasheet Fig. 1-1: DIN is latched on the rising edge (tSU=tHDt_{SU} = t_{HD} = 50 ns); DOUT changes after the falling edge. Modes 0,0 and 1,1 only. In code: spi.mode = 0b00.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0812

SPI and I²C side by side

I²CSPI
Wires24
Chip picked byaddressselect wire
Line drivendown onlyup and down
Pi clock100 kHz1 MHz here
Directionone at a timeboth at once
ReceiptACKnone
Illustration of a 1 MHz square wave on two kinds of line. Top, SPI push-pull: the driver pulls the line up and down, so both edges are sharp. Bottom, I2C open drain: the line falls fast but rises along an RC curve with time constant 1.5 kilohms times an illustrative 100 pF, 150 ns, barely reaching 3.3 V before the next fall.

No ACK: an unplugged chip still "reads" a number, with no error. Test with a known voltage.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0813

Part 3 · A GPIO pin sees 0 or 1; an ADC sees a number

The same slowly varying voltage between about 0.3 and 3.1 V read two ways over 10 seconds. A GPIO input reports only 0 or 1, switching at an illustrative threshold of 1.65 V. The MCP3008 reports a count from 0 to 1023 that follows the voltage in steps of 3.2 mV.

The MCP9808 had its ADC inside. The MCP3008 is the ADC alone: eight analog inputs in, numbers out over SPI.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0814

Ten bits: 1024 steps of 3.22 mV

Ten-bit ADC transfer function with a 3.3 V reference. Full scale, output code against input voltage from 0 to 3.3 V looks like a straight line from 0 to 1023. Zoomed to 1.985 to 2.013 V, it is a staircase of steps 1 LSB = 3.22 mV wide; 2.000 V gives code 620.
LSB=VREF1024\text{LSB} = \frac{V_{\text{REF}}}{1024}code=⌊1024 VinVREF⌋\text{code} = \left\lfloor \frac{1024\,V_{\text{in}}}{V_{\text{REF}}} \right\rfloor

2.00 V → 620.6 → 620

Back: 620 × 3.3 / 1024 = 1.998 V

This is the ideal chip: it rounds down, and VREF or more reads 1023. A real chip adds small offset, gain and linearity errors, so expect a count or two of difference.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0815

Inside the MCP3008

MCP3008 datasheet functional block diagram: inputs CH0 to CH7 pass through an input channel multiplexer to a sample and hold; a comparator compares the held voltage with a DAC driven from VREF under a 10-bit successive-approximation register; control logic driven by CS/SHDN, DIN and CLK moves the result into a shift register that drives DOUT.
Datasheet, block diagram

Sample and hold: freezes Vin.

DAC: a trial voltage from VREF.

Comparator: Vin ≥ trial?

SAR: keeps each answer bit.

Shift register: out on DOUT.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0816

Successive approximation: a binary search

Successive approximation of 2.00 V with a 3.3 V reference. Over ten clocks the DAC tries codes 512, 768, 640, 576, 608, 624, 616, 620, 622 and 621; each trial at or below 2.00 V keeps its bit and each above drops it. The kept bits B9 to B0 read 1001101100, which is 620. A zoomed panel shows the last six trials within a few millivolts of 2.00 V.

Try half scale (512), keep the bit if Vin is at or above it, then try the next bit down. One bit per clock; each leaves on DOUT as soon as it is decided.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0817

Sample and hold: charge 20 pF in 1.5 clocks

MCP3008 datasheet Figure 4-1, analog input model: a signal source with source impedance drives the channel pad, which has 7 pF pin capacitance, clamp diodes to VDD and VSS, and about 1 nA leakage; a sampling switch with 1 kilohm resistance connects it to the 20 pF sample capacitor.

2.5 kΩ pot + 1 kΩ switch: τ\tau = 3.5 kΩ × 20 pF = 70 ns.

Settle to ½ LSB: 7.6 τ7.6\,\tau = 0.53 µs, inside 1.5 µs at 1 MHz.

Datasheet Fig. 4-1. Too slow is bad too: the charge leaks, so finish within 1.2 ms (§6.2).

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0818

Wire it: MCP3008 to the Pi

Wiring the MCP3008 to the Pi header, pins 17 to 26. VDD (pin 16) and VREF (pin 15) go to the 3.3 V rail from header pin 17; AGND (14) and DGND (9) go to the ground rail from header pin 25. CLK (13) goes to SCLK pin 23, DOUT (12) to MISO pin 21, DIN (11) to MOSI pin 19, and chip select (10) to CE0 pin 24. A 10 kilohm potentiometer across the rails feeds its wiper to CH0 (pin 1).

Power off first.

Notch: pins 1, 16.

VDD, VREF: 3.3 V, never 5 V.

1 µF VDD–GND at the chip (§6.4).

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0819

Part 4 · The datasheet's three-byte conversation

MCP3008 datasheet Figure 6-1, SPI communication in 8-bit segments, mode 0,0: over 24 clocks the MCU transmits 0000 0001 (start bit), then SGL/DIFF D2 D1 D0 and four don't-care bits, then eight don't-care bits. It receives eight unknown bits, then five unknown bits, the null bit 0, B9 and B8, then B7 to B0. Data leaves the converter on falling edges and the MCU latches it on rising edges.

Datasheet Fig. 6-1: seven leading zeros, then the start bit, so the 10-bit answer ends exactly on clock 24.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0820

Build the request, decode the reply

The three bytes of one MCP3008 reading, bit by bit. The Pi sends 0000 0001 (the start bit), then 1 D2 D1 D0 followed by don't-care bits, which is 1000 0000 for channel 0, then a dummy byte. The chip returns unknown bits, then five unknown bits, a null 0 and B9 B8 = 10, then B7 to B0 = 0110 1100. Notes explain that (8 + ch) << 4 builds the channel byte, and that ((r[1] & 3) << 8) + r[2] gives 512 + 108 = 620, which is 1.998 V.

The same three bytes for any channel; only ch changes. The ? bits are MISO while the chip has not yet driven it: mask them off.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0821

read_adc(), from the provided ADC3008_SPI.py

import spidev

spi = spidev.SpiDev()
spi.open(0, 0)              # /dev/spidev0.0
spi.max_speed_hz = 1000000  # 1 MHz
spi.mode = 0b00             # mode 0

def read_adc(channel):
    if channel < 0 or channel > 7:
        raise IndexError('channel 0-7')
    request = [0x01, (8 + channel) << 4, 0x00]
    data = spi.xfer2(request)   # 3 back
    return ((data[1] & 3) << 8) + data[2]

Example only. Do not copy this code as it is: read it, learn from it, then write your own.

1 MHz: below the 1.35 MHz allowed even at 2.7 V.

Skip max_speed_hz and the Pi may clock far too fast.

Task 2: count → v_volt.

© Ran Yang, Ph.D.Example code only: learn from it, then write your ownAdvanced Instrumentation
PHYS 351 · Lecture 0822

How fast can you sample? Nyquist and aliasing

Sampling at 1000 samples per second: a 100 Hz sine wave is resolved, while samples of a 900 Hz sine wave appear to follow a 100 Hz wave. Sample points alone cannot distinguish these frequencies.

Measure, don't assume:

fs≈N−1tN−t1f_s \approx \frac{N-1}{t_N - t_1}

Faithful only below fs/2f_s/2.

SPI alone: 24 clocks at 1 MHz = 24 µs. Python adds far more.

Lab 8 Task 7 (extra credit): watch the scope and your plot together as you raise the generator frequency.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0823

Part 5 · SSH: the Pi's terminal on your laptop

SSH: a laptop terminal logged in to the Raspberry Pi over the same network on port 22, encrypted. Keystrokes go to the Pi and text output comes back; the terminal shows the ADC program printing counts 620 and 621 with voltages 1.998 and 2.001 V. The program runs on the Pi, whose pins stay on the bench.
pi$     sudo raspi-config                      # Interfaces → SSH, once
pi$     hostname -I                            # the Pi's address
laptop$ ssh <user>@<pi-ip>                     # log in; run scripts
laptop$ scp <user>@<pi-ip>:~/lab8/data.csv .   # copy data home
© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0824

VNC: the Pi's whole desktop in a window

VNC: a laptop shows the whole Raspberry Pi desktop in a viewer window, including a live plot. Screen pixels travel from the Pi to the laptop and mouse and keyboard events go back, over the same network on port 5900.

Enable VNC in raspi-config, install a VNC viewer on the laptop, connect to the Pi's address. VNC for windows (live plots); SSH for the rest.

© Ran Yang, Ph.D.Advanced Instrumentation
PHYS 351 · Lecture 0825

Part 6 · The final project

Final-project timeline over eight weeks. Week 1: proposal and initial BOM, order parts. Weeks 2 to 5: build, wire and code, and film every week. Week 6: test with customers and finish. Week 7: the Expo, with the team video, a technical presentation and a live demo. Week 8: the final report. A weekly report is due at the start of weeks 3 to 7, and a peer evaluation at the start of weeks 2 to 7.

Teams of three or four. A proposal in week 1, weekly reports, the Expo in week 7, the final report in week 8. Open Final project in the course menu for the full brief.

© Ran Yang, Ph.D.Advanced Instrumentation

Use ← → to move, Home / End to jump, and F for fullscreen.

Figure descriptions

Slide 2 · Part 1 · Three ways to talk to a chip

Three panels compare serial protocols. UART: the Pi's TX goes to the device's RX and back on a second wire, with no clock, so both ends must agree on the baud rate. I2C: the Pi and two chips at addresses 0x18 and 0x19 share two pulled-up wires, SDA and SCL, and each byte has an ACK or NAK bit. SPI: the Pi and one chip are joined by four wires, SCLK, MOSI and chip select from the Pi and MISO back; drivers are push-pull, the chip is picked by its own select wire, and there is no acknowledgment.

Slide 3 · Part 2 · SPI: four wires, and the Pi runs the clock

The Raspberry Pi as SPI controller and the MCP3008 as peripheral. SCLK from BCM 11 to CLK carries one bit per tick; MOSI from BCM 10 to DIN carries the request; MISO from DOUT back to BCM 9 carries the answer; chip select from BCM 8 (CE0) to the chip's CS/SHDN pin, active low, tells the chip to listen.

Slide 4 · Where SPI lives on the Pi header

Raspberry Pi 40-pin header map distinguishing physical pin positions from BCM GPIO numbers and marking 3.3 V, 5 V, ground, I²C, UART, and SPI connections. Power pins are not GPIO inputs.

Slide 5 · Chip select: one wire per chip, not an address

One Pi with three SPI chips. SCLK, MOSI and MISO are shared by all three. Each chip has its own select line: CE0, CE1 and an ordinary GPIO. CE0 is low, so the MCP3008 is talking; the other two chips have their select high and have released MISO to high impedance.

Slide 6 · Inside: two shift registers joined in a ring

Two 8-bit shift registers joined in a ring. The Pi's register holds 1100 1010 and the MCP3008's holds 0110 1100. MOSI carries the Pi's most significant bit out into the chip's least significant end; MISO carries the chip's most significant bit out into the Pi's least significant end. Each clock tick moves every bit one place.

Slide 7 · Tick by tick: the two bytes trade places

The two shift registers after each of eight clock ticks, with the Pi's original bits shaded slate and the chip's shaded rose. At each tick one slate bit leaves the Pi and enters the chip while one rose bit enters the Pi. After tick 8 the Pi holds 0110 1100 and the chip holds 1100 1010: the bytes have traded places.

Slide 8 · One byte on the wire, both directions at once

Timing of one SPI byte in mode 0. Chip select goes low, SCLK makes eight pulses, and on the same eight ticks MOSI carries the Pi's byte 0xCA (1100 1010) while MISO carries the chip's byte 0x6C (0110 1100). Both sides read at each rising edge and change their data on the falling edge.

Slide 9 · To read, you must write

The call spi.xfer2([0x01, 0x80, 0x00]) sends three bytes and receives three: 0x01 (start bit) returns an unknown byte, 0x80 (channel 0, single-ended) returns 0x?2 holding the null bit and B9 B8, and the dummy byte 0x00 returns 0x6C holding B7 to B0. Each byte takes 8 ticks in both directions.

Slide 10 · Four clock modes: idle level and reading edge

The four SPI clock modes drawn against one row of data bits D7 to D0. Mode 0 (CPOL 0, CPHA 0) idles low and reads on the rising edge; mode 1 (CPOL 0, CPHA 1) idles low and reads on the falling edge; mode 2 (CPOL 1, CPHA 0) idles high and reads on the falling edge; mode 3 (CPOL 1, CPHA 1) idles high and reads on the rising edge. In every mode the reading edge falls in the middle of each data bit.

Slide 11 · The MCP3008 reads on the rising edge: mode 0

MCP3008 datasheet Figure 1-1, serial interface timing: chip select falls at least t_SUCS before the first rising clock edge; DIN must be valid t_SU before and t_HD after each rising edge; DOUT leaves high impedance with a null bit, then MSB out, each changing t_DO after a falling clock edge, and returns to high impedance t_DIS after chip select rises, which must stay high for t_CSH.

Slide 12 · SPI and I²C side by side

Illustration of a 1 MHz square wave on two kinds of line. Top, SPI push-pull: the driver pulls the line up and down, so both edges are sharp. Bottom, I2C open drain: the line falls fast but rises along an RC curve with time constant 1.5 kilohms times an illustrative 100 pF, 150 ns, barely reaching 3.3 V before the next fall.

Slide 13 · Part 3 · A GPIO pin sees 0 or 1; an ADC sees a number

The same slowly varying voltage between about 0.3 and 3.1 V read two ways over 10 seconds. A GPIO input reports only 0 or 1, switching at an illustrative threshold of 1.65 V. The MCP3008 reports a count from 0 to 1023 that follows the voltage in steps of 3.2 mV.

Slide 14 · Ten bits: 1024 steps of 3.22 mV

Ten-bit ADC transfer function with a 3.3 V reference. Full scale, output code against input voltage from 0 to 3.3 V looks like a straight line from 0 to 1023. Zoomed to 1.985 to 2.013 V, it is a staircase of steps 1 LSB = 3.22 mV wide; 2.000 V gives code 620.

Slide 15 · Inside the MCP3008

MCP3008 datasheet functional block diagram: inputs CH0 to CH7 pass through an input channel multiplexer to a sample and hold; a comparator compares the held voltage with a DAC driven from VREF under a 10-bit successive-approximation register; control logic driven by CS/SHDN, DIN and CLK moves the result into a shift register that drives DOUT.

Slide 16 · Successive approximation: a binary search

Successive approximation of 2.00 V with a 3.3 V reference. Over ten clocks the DAC tries codes 512, 768, 640, 576, 608, 624, 616, 620, 622 and 621; each trial at or below 2.00 V keeps its bit and each above drops it. The kept bits B9 to B0 read 1001101100, which is 620. A zoomed panel shows the last six trials within a few millivolts of 2.00 V.

Slide 17 · Sample and hold: charge 20 pF in 1.5 clocks

MCP3008 datasheet Figure 4-1, analog input model: a signal source with source impedance drives the channel pad, which has 7 pF pin capacitance, clamp diodes to VDD and VSS, and about 1 nA leakage; a sampling switch with 1 kilohm resistance connects it to the 20 pF sample capacitor.

Slide 18 · Wire it: MCP3008 to the Pi

Wiring the MCP3008 to the Pi header, pins 17 to 26. VDD (pin 16) and VREF (pin 15) go to the 3.3 V rail from header pin 17; AGND (14) and DGND (9) go to the ground rail from header pin 25. CLK (13) goes to SCLK pin 23, DOUT (12) to MISO pin 21, DIN (11) to MOSI pin 19, and chip select (10) to CE0 pin 24. A 10 kilohm potentiometer across the rails feeds its wiper to CH0 (pin 1).

Slide 19 · Part 4 · The datasheet's three-byte conversation

MCP3008 datasheet Figure 6-1, SPI communication in 8-bit segments, mode 0,0: over 24 clocks the MCU transmits 0000 0001 (start bit), then SGL/DIFF D2 D1 D0 and four don't-care bits, then eight don't-care bits. It receives eight unknown bits, then five unknown bits, the null bit 0, B9 and B8, then B7 to B0. Data leaves the converter on falling edges and the MCU latches it on rising edges.

Slide 20 · Build the request, decode the reply

The three bytes of one MCP3008 reading, bit by bit. The Pi sends 0000 0001 (the start bit), then 1 D2 D1 D0 followed by don't-care bits, which is 1000 0000 for channel 0, then a dummy byte. The chip returns unknown bits, then five unknown bits, a null 0 and B9 B8 = 10, then B7 to B0 = 0110 1100. Notes explain that (8 + ch) << 4 builds the channel byte, and that ((r[1] & 3) << 8) + r[2] gives 512 + 108 = 620, which is 1.998 V.

Slide 22 · How fast can you sample? Nyquist and aliasing

Sampling at 1000 samples per second: a 100 Hz sine wave is resolved, while samples of a 900 Hz sine wave appear to follow a 100 Hz wave. Sample points alone cannot distinguish these frequencies.

Slide 23 · Part 5 · SSH: the Pi's terminal on your laptop

SSH: a laptop terminal logged in to the Raspberry Pi over the same network on port 22, encrypted. Keystrokes go to the Pi and text output comes back; the terminal shows the ADC program printing counts 620 and 621 with voltages 1.998 and 2.001 V. The program runs on the Pi, whose pins stay on the bench.

Slide 24 · VNC: the Pi's whole desktop in a window

VNC: a laptop shows the whole Raspberry Pi desktop in a viewer window, including a live plot. Screen pixels travel from the Pi to the laptop and mouse and keyboard events go back, over the same network on port 5900.

Slide 25 · Part 6 · The final project

Final-project timeline over eight weeks. Week 1: proposal and initial BOM, order parts. Weeks 2 to 5: build, wire and code, and film every week. Week 6: test with customers and finish. Week 7: the Expo, with the team video, a technical presentation and a live demo. Week 8: the final report. A weekly report is due at the start of weeks 3 to 7, and a peer evaluation at the start of weeks 2 to 7.