Raspberry Pi & Phidgets Workshop

Component Quick Reference Guide

Component Quick Reference Guide

Basic Components

LED (Light Emitting Diode)

  • Long leg (anode): Connect to GPIO through resistor
  • Short leg (cathode): Connect to Ground (GND)
  • Always use a current-limiting resistor (220Ω typical)
  • Forward voltage: ~2V for red, ~3V for blue/white

Resistors

  • 220Ω (Red-Red-Brown): Standard for LEDs
  • 10kΩ (Brown-Black-Orange): Standard for pull-ups
  • 4.7kΩ (Yellow-Violet-Red): Used for DS18B20 sensor
  • 1kΩ (Brown-Black-Red): Used in voltage dividers

Buttons & Switches

  • Connect one side to GPIO, other side to GND
  • Use internal pull-up resistor: Button(pin, pull_up=True)
  • button.wait_for_press() pauses program until pressed
  • button.when_pressed = function_name executes function on press

Breadboard Layout

  • Red/blue rails: Power distribution (+/- buses)
  • Rows (A-E, F-J) are connected horizontally
  • Center gap separates the two halves
  • Always connect GND first, then power, then signals

Sensors

PIR Motion Sensor

  • VCC: Connect to 5V (needs higher voltage)
  • GND: Connect to Ground
  • OUT/SIG: Connect to GPIO pin
  • Adjust sensitivity with on-board potentiometer
  • Needs 1 minute to calibrate after power-up
  • Detection range: ~7 meters, ~110° angle

DS18B20 Temperature Sensor

  • Red/Blue wire: 3.3V power
  • Black/Brown wire: Ground
  • Yellow wire: Data (to GPIO4)
  • Requires 4.7kΩ pull-up resistor between data and power
  • Enable 1-Wire in raspi-config
  • Accuracy: ±0.5°C from -10°C to +85°C

Photoresistor Module

  • VCC: Connect to 3.3V
  • GND: Connect to Ground
  • DO: Digital Output (HIGH in light, LOW in dark)
  • AO: Analog Output (if available)
  • Adjust threshold with on-board potentiometer
  • Use with DigitalInputDevice in gpiozero

Output Devices

Piezo Buzzer

  • Positive (+): Connect to GPIO
  • Negative (-): Connect to GND
  • No resistor needed for buzzers
  • Use buzzer.beep(on_time, off_time, n) for patterns
  • Warning pattern: 0.1, 0.1, 3 (3 short beeps)
  • Alert pattern: 0.5, 0.5, 2 (2 long beeps)

Phidget LCD

  • Connect via USB
  • Install Phidget22 library: pip3 install Phidget22
  • Backlight colors: 0=green, 1=red, 2=yellow
  • Resolution: up to 20 characters × 4 lines
  • Always close() the LCD when done

RGB LEDs

  • Common cathode: Long leg to GND
  • R, G, B pins: Each to GPIO through resistor
  • Different resistor values for each color recommended
  • Use RGBLED(red_pin, green_pin, blue_pin) in gpiozero
  • Full color mixing: rgb_led.color = (r, g, b)

Special Components

Camera Module

  • Connect ribbon cable to CSI port (blue side to Ethernet)
  • Enable camera in raspi-config
  • Use picamera2 library for Python control
  • Requires reboot after enabling
  • capture_file() for photos, start_recording() for video

Sense HAT

  • Mounts directly on all 40 GPIO pins
  • 8×8 RGB LED matrix
  • Multiple sensors built-in (temperature, humidity, etc.)
  • Use sense_hat library (or sense_emu for emulator)
  • Don't exceed 5V input

ADC0834 & Solar Panel

  • ADC0834: CS→GPIO8, CLK→GPIO11, DO→GPIO9, DI→GPIO10
  • Use spidev library (pip3 install spidev)
  • Enable SPI in raspi-config
  • Use voltage divider for solar panel: 10kΩ+1kΩ
  • Solar panel max output: 5V, read with analog pin

TIU STEM Workshop - Raspberry Pi & Phidgets

stem.tiu11.org | github.com/TIU11/pi-workshop