Skip to content

A curated collection of Raspberry Pi hardware experiments, including GPIO interfacing, sensor integration, ADC applications, and prototype projects. Demonstrates practical hardware programming with Python and hands-on embedded systems development.

Notifications You must be signed in to change notification settings

mariarodr1136/RaspberryPiLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Raspberry Pi Hardware Experiments 🧠

Welcome to my Raspberry Pi hardware experiments repository!

This hands-on collection of Raspberry Pi hardware projects is designed to teach hardware interfacing, sensor integration, and embedded systems programming, featuring experiments and mini-projects with a wide range of components, including ultrasonic sensors, PIR motion detectors, servo motors, ADC modules, LCD displays, RFID readers, buzzers, and more. Each project demonstrates how software and hardware interact to create real-world applications such as environmental monitoring, home automation, IoT systems, and robotic control, making this repository ideal for anyone looking to build practical skills in electronics, signal processing, and real-time data acquisition while developing a strong foundation in Raspberry Pi embedded engineering.


Python Raspberry Pi GPIO Sensors ADC0834 Electronics Breadboard Python3 VS Code Git GitHub Linux GPIOZero Matplotlib SensorsKit


IMG_4517


πŸ› οΈ Hardware & Kit Details

Hardware Platform:

  • Raspberry Pi 4 Model B

Learning Kit:

  • SunFounder Raphael Ultimate Starter Kit
    • Provides a wide variety of sensors, actuators, displays, and components for hardware experimentation
    • Comes with detailed example code and guides to facilitate hands-on learning
    • Ideal for prototyping embedded systems and electronics projects

All experiments in this repository are built using components from this kit, ensuring reproducibility for users with the same hardware.


IMG_5222

IMG_5488


πŸ“‚ Repository Structure

RaspberryPiLab/
β”‚
β”œβ”€β”€ GPIO_Basics/
β”‚   β”œβ”€β”€ buttonLED.py              # Basic button-controlled LED
β”‚   β”œβ”€β”€ intPullUp.py              # Input with internal pull-up resistor
β”‚   β”œβ”€β”€ binCount.py               # Sequential LED blinking example
β”‚   β”œβ”€β”€ myDim.py                  # PWM LED dimmer using buttons
β”‚   β”œβ”€β”€ myRGBbutton.py            # RGB LED controlled by multiple buttons
β”‚   β”œβ”€β”€ passive-beep.py           # Demonstrates PWM control of a passive buzzer
β”‚   β”œβ”€β”€ active-beep.py            # Demonstrates digital on/off control of an active buzzer
β”‚   β”œβ”€β”€ keypad.py                 # Reads one specific row/column pair
β”‚   β”œβ”€β”€ keypad2.py                # Scans entire keypad matrix and prints key pressed
β”‚   β”œβ”€β”€ kpLib.py                  # Keypad class library (full row/column scan + multi-key input)
β”‚   β”œβ”€β”€ kp-read.py                # Demonstration program using the keypad class
β”‚   └── README.md                 # Documentation for all GPIO_Basics scripts
β”‚
β”œβ”€β”€ Sensors/
β”‚   β”œβ”€β”€ echoLocation.py           # Ultrasonic distance sensor (HC-SR04)
β”‚   β”œβ”€β”€ tiltTest.py               # Tilt sensor reading
β”‚   β”œβ”€β”€ sos.py                    # Calculates the speed of sound (MPH) using ultrasonic sensor timing
β”‚   β”œβ”€β”€ pir-motion.py             # Detects motion using a PIR (Passive Infrared) sensor
β”‚   β”œβ”€β”€ lcdDisplay.py             # Displays text on an LCD1602 via I2C
β”‚   β”œβ”€β”€ LCD1602.py                # Low-level library for controlling LCD1602
β”‚   β”œβ”€β”€ tempLCD.py                # Reads DHT11 sensor and displays temperature/humidity on LCD
β”‚   β”œβ”€β”€ tempHumidity.py           # Reads DHT11 sensor and prints temperature/humidity to terminal
β”‚   β”œβ”€β”€ tempBuzzerAlarm.py        # Monitors temperature and humidity, displays on LCD, and triggers buzzer alerts
β”‚   β”œβ”€β”€ lcd-kp.py                 # simple keypad+LCD helper script
β”‚   └── README.md                 # Documentation for all Sensor scripts
β”‚
β”œβ”€β”€ ADC_Examples/
β”‚   β”œβ”€β”€ anIn.py                   # Basic analog input using ADC0834
β”‚   β”œβ”€β”€ photon-detect.py          # Reads LDR light intensity via ADC0834
β”‚   β”œβ”€β”€ joyStick.py               # Joystick X/Y reading via ADC0834
β”‚   β”œβ”€β”€ potServo.py               # Potentiometer controlling a servo motor
β”‚   β”œβ”€β”€ RGBmix.py                 # RGB LED color mixing via analog inputs
β”‚   └── README.md                 # Documentation for all ADC_Examples scripts
β”‚
β”œβ”€β”€ Projects/
β”‚   β”œβ”€β”€ motion-dark-alarm.py      # Motion and light detection alarm with buzzer alert
β”‚   └── kpLib-thread-al.py        # Keypad + LCD password alarm system with PIR motion detection
β”‚   └── README.md                 # Documentation for all Projects scripts
β”‚
└──SunFounder_Example_Projects/
    β”œβ”€β”€ lesson7.py                # Switch – Slide switch controlling 2 LEDs
    β”œβ”€β”€ lesson8.py                # Relay – Relay toggling LED via GPIO
    β”œβ”€β”€ lesson13.py               # Piano – Button-triggered buzzer notes
    β”œβ”€β”€ lesson18.py               # Shift – 74HC595 shift-reg LED patterns
    β”œβ”€β”€ lesson20.py               # Traffic Light – Traffic light + 7-seg countdown
    └── README.md                 # Documentation for all SunFounder projects scripts

Lesson20.mov

βš™οΈ Requirements

Make sure you have the following installed on your Raspberry Pi:

  • Raspberry Pi OS
  • Python 3
  • RPi.GPIO or gpiozero module
  • lgpio (for advanced GPIO control)
  • time, os, sys (standard libraries)

To install missing packages:

sudo apt update
sudo apt install python3-gpiozero

πŸ”§ Understanding the Raspberry Pi GPIO Pinout

Screenshot 2025-10-29 at 4 56 40 PM

> This diagram helps identify the GPIO pins used for digital I/O, ADC modules, and external components in these projects.

πŸš€ How to Run

  1. Clone this repository:
git clone https://github.com/mariarodr1136/RaspberryPiTutorials.git
cd RaspberryPiLab
  1. Open any tutorial folder, for example:
cd GPIO_Basics
  1. Run the script with:
python3 buttonLED.py

IMG_5223


πŸ› οΈ Hardware Used

Core Components

  • βœ… Raspberry Pi 4 Model B (4GB)
  • βœ… Breadboard & jumper wires
  • βœ… Breadboard power module
  • βœ… 40-Pin GPIO cable
  • βœ… T-shape extension board
  • 9V battery

Input & Control Devices

  • βœ… Push button
  • βœ… Slide switch
  • βœ… Micro switch
  • βœ… Keypad
  • Rotary encoder
  • βœ… Joystick module
  • βœ… Tilt switch sensor
  • Touch sensor
  • Obstacle avoidance sensor
  • Reed switch (speed sensor)
  • βœ… PIR motion sensor
  • βœ… DHT-11 temperature & humidity sensor

Output Devices

  • βœ… LEDs (Red, Green, Blue)
  • βœ… RGB LED
  • LED bar graph
  • βœ… 7-segment display (single)
  • 4-digit 7-segment display
  • Dot matrix display
  • βœ… 12C LCD 1602 display
  • Speaker
  • Audio amplifier module
  • Fan
  • Relay module

Communication & Identification

  • MFRC522 RFID reader module
  • Camera module

Sensors

  • βœ… Ultrasonic sensor (HC-SR04)
  • Thermistor
  • βœ… Photoresistor (LDR)
  • MPU6050 accelerometer & gyroscope

Motors & Drivers

  • βœ… Servo motor (SG90)
  • βœ… Potentiometer
  • Motor (DC)
  • L293D motor driver IC

Integrated Circuits & Components

  • βœ… ADC0834 chip
  • βœ… 2x 74HC595 shift registers
  • βœ… Transistors (5x 8550 PNP / 5x S8050 NPN)
  • Diodes (IN4007, Zener)
  • Capacitors: 5x 10 ΞΌF, (10+10)x 104/103 pF
  • βœ… Resistors (assorted, includes 220 Ξ©)

Miscellaneous

  • βœ… Passive & active buzzers (2+2x)
  • βœ… Various sensors (temperature, light, etc.)
  • Caps (10x 6Γ—6 mm tactile caps)

Lesson18.mov

πŸ“˜ Learning Objectives

  • Understand GPIO pin control
  • Learn how to interface sensors and actuators
  • Practice Python for embedded systems
  • Build confidence in troubleshooting hardware and software integration

⭐ If you find this repository useful, consider starring it!

About

A curated collection of Raspberry Pi hardware experiments, including GPIO interfacing, sensor integration, ADC applications, and prototype projects. Demonstrates practical hardware programming with Python and hands-on embedded systems development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages