Exam Overview — Connected Objects (420-6P3)
Exam Structure
Part 1: Practical (reTerminal)
Bring your reTerminal (required)
Open-book: course notes, your laptop, internet all allowed
Teacher will ask you to connect 1–3 devices to your reTerminal
Tasks: take measurements → record to file → upload
Starter code will be provided on exam morning (generic sensor code for Digital/Analog/Serial + file recording)
Part 2: Theory (written on paper)
Open-book
Written answers on a sheet of paper provided
Topics covered:
Bash / Linux
Python
Electronics (protocols + basic circuitry)
Web / IoT Protocols
Questions will be relevant to the practical part
Part 1 Workflow — Sensor Code Patterns
Digital sensor (GPIO Zero)
from gpiozero import Button
button = Button( 2 )
print (button.is_pressed) # True/False
Analog sensor (Grove Hat ADC)
Use AHT20 or similar I2C sensor via smbus2 or adafruit library
Grove Hat provides 4 ADC channels (12-bit, 0–4095)
See Serial Protocols for I2C Python code
Serial sensor (pySerial)
import serial
with serial.Serial( '/dev/serial0' , 9600 ) as ser:
line = ser.readline()
print (line)
Record measurements to a file
import json, time
with open ( 'measurements.json' , 'a' ) as f:
record = { 'timestamp' : time.time(), 'value' : reading}
f.write(json.dumps(record) + ' \n ' )
Upload (typical pattern)
# rsync to a remote host
rsync measurements.json user@host:/path/
# or copy to mounted Windows filesystem from WSL
cp measurements.json /mnt/c/Users/ < yo u > /Desktop/
Quick Navigation — Theory Topics
Area Wiki page Electronics (Ohm’s Law, resistors) Electronics and Circuitry Signals, ADC, sampling Signals and ADC Serial protocols (SPI/I2C/PWM/Serial) Serial Protocols MQTT, HTTP, pub/sub MQTT and IoT Protocols GPIO, reTerminal hardware, built-in sensors GPIO and reTerminal Python (argparse, venv, logging, pytest) Python Essentials Async Python (asyncio) Async Python Linux & Bash commands (5 fingers, pipes) Linux and Bash Commands Bash scripting (variables, if, chmod) Bash Scripting IoT system architecture (5 components) IoT System Architecture Azure D2C, Device Twins Azure IoT Overview
Formula Use V = IR Ohm’s Law — voltage, current, resistance I = V / R Find current given voltage and resistance R = V / I Find resistor value Vr = Vsource − Vled Kirchhoff’s Voltage Law (series circuit) fs = 1 / T Sampling frequency from sampling period values = 2^n Number of distinct values for n-bit ADC bitrate = fs × bits Bits per second for sampled signal
Key GPIO Electrical Limits (reTerminal)
Max current per GPIO pin: 16 mA
GPIO voltage: 3.3 V (not 5 V tolerant!)
Max current from 3.3 V / 5 V power pins: 2 A
Sensor Types on the Exam
Type Protocol Python lib Port Digital GPIO high/low gpiozeroGPIO pin number Analog ADC via I2C (Grove Hat) smbus2 / adafruitI2C bus Temperature/Humidity I2C (AHT20) adafruit-circuitpython-ahtx0I2C Serial UART async pySerial/dev/serial0Built-in light Read file open() / cat/sys/bus/iio/devices/iio:device0/in_illuminance_inputBuilt-in LED Write file echo / tee/sys/class/leds/usr_led0/brightness