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.
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.
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
Make sure you have the following installed on your Raspberry Pi:
- Raspberry Pi OS
- Python 3
RPi.GPIOorgpiozeromodulelgpio(for advanced GPIO control)time,os,sys(standard libraries)
To install missing packages:
sudo apt update
sudo apt install python3-gpiozero> This diagram helps identify the GPIO pins used for digital I/O, ADC modules, and external components in these projects.
- Clone this repository:
git clone https://github.com/mariarodr1136/RaspberryPiTutorials.git
cd RaspberryPiLab- Open any tutorial folder, for example:
cd GPIO_Basics- Run the script with:
python3 buttonLED.py- β Raspberry Pi 4 Model B (4GB)
- β Breadboard & jumper wires
- β Breadboard power module
- β 40-Pin GPIO cable
- β T-shape extension board
- 9V battery
- β 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
- β 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
- MFRC522 RFID reader module
- Camera module
- β Ultrasonic sensor (HC-SR04)
- Thermistor
- β Photoresistor (LDR)
- MPU6050 accelerometer & gyroscope
- β Servo motor (SG90)
- β Potentiometer
- Motor (DC)
- L293D motor driver IC
- β 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 Ξ©)
- β Passive & active buzzers (2+2x)
- β Various sensors (temperature, light, etc.)
- Caps (10x 6Γ6 mm tactile caps)
Lesson18.mov
- 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!

