0% found this document useful (0 votes)
2 views12 pages

Module 4 Raspberry Pi

The document provides a detailed description of the Raspberry Pi components, including USB ports, Ethernet, HDMI, power input, audio jack, and GPIO pins. It also includes information on various pin categories, such as power, ground, GPIO, SPI, I2C, and UART communication pins. Additionally, the document presents Python code examples for LED blinking using both GPIO Zero and RPi.GPIO libraries.

Uploaded by

D sweta Suman
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views12 pages

Module 4 Raspberry Pi

The document provides a detailed description of the Raspberry Pi components, including USB ports, Ethernet, HDMI, power input, audio jack, and GPIO pins. It also includes information on various pin categories, such as power, ground, GPIO, SPI, I2C, and UART communication pins. Additionally, the document presents Python code examples for LED blinking using both GPIO Zero and RPi.GPIO libraries.

Uploaded by

D sweta Suman
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RASPBERRY -PI

Components Description
1. USB 2.0 Ports 2. USB 3.0 Ports (blue)
Used to connect: High-speed USB for:
•Keyboard •External SSD
•Mouse •High-speed storage
•USB pendrive •Webcams
•Sensors via USB
3. Ethernet Port (RJ45) •7. GPIO Pins (40 pins)
For wired internet connection (1000 Mbps) •LED
4. Micro HDMI Ports •Sensors
•Motors
Used to connect monitors (supports dual display)
•IoT projects include
5. USB-C Power Port
Input power: 5V, 3A
•Power pins (3.3V, 5V)
6. Audio/Video 3.5 mm Jack •Ground pins
For audio output + composite video •Digital I/O pins
•I2C, SPI, UART
8. Camera Connector (CSI)
Used to connect Raspberry Pi Camera Module
9. Display Connector (DSI)
Used to connect official Raspberry Pi touchscreen display
10. Broadcom CPU/GPU
Quad-core ARM Cortex-A72 processor
11. RAM Chip
Comes in 2GB, 4GB, or 8GB versions
12. MicroSD Card Slot
Acts as the storage of operating system
RASPBERRY -PI GPIO PIN
Pin Categories
[Link] Pins
3.3V Pins: Provide 3.3-volt power (Pin 1, Pin 17)
5V Pins: Provide 5-volt power (Pin 2, Pin 4)
2. Ground Pins (GND)
Ground pins are connected to Raspberry Pi ground.
Pins: 6, 9, 14, 20, 25, 30, 34, 39
3. GPIO Pins (Programmable Pins) These are the main pins used for
general purpose use.
GPIO4 (Pin 7) , GPIO17 (Pin 11), GPIO18 (Pin 12) , GPIO27 (Pin 13)

4. SPI Communication Pins
Used for devices like ADCs, displays, sensors.
•MOSI (GPIO10) – Pin 19
•MISO (GPIO9) – Pin 21
•SCLK (GPIO11) – Pin 23
•CE0 (GPIO8) – Pin 24
•CE1 (GPIO7) – Pin 26
5. I2C Communication Pins
Used for sensors like accelerometers, OLED displays.
•SDA1 (GPIO2) – Pin 3
•SCL1 (GPIO3) – Pin 5
6. UART Serial Communication
Used for serial data communication (GPS, GSM modules, etc.)
•TXD0 (GPIO14) – Pin 8
•RXD0 (GPIO15) – Pin 10
LED Blinking Using Raspberry Pi (Python Code + Circuit)
Components Required Python Code for LED Blinking (Using GPIO Zero)
•Raspberry Pi (any model) from gpiozero import LED
•LED (any color) from time import sleep
•330Ω resistor (recommended)
led = LED(17) # GPIO pin 17
•Breadboard
•Jumper wires while True:
[Link]() # LED ON
Circuit connection sleep(1)
• Connect GPIO17 (Pin 11) to LED [Link]() # LED OFF
positive leg sleep(1)
• Connect LED negative leg to a
resistor
• Connect resistor to GND (Pin 6)
Python Code for LED Blinking (Using [Link])
import [Link] as GPIO
import time

[Link]([Link])
[Link](17, [Link])

while True:
[Link](17, [Link]) # LED ON
[Link](1)
[Link](17, [Link]) # LED OFF
[Link](1)
Python Code for LED Blinking along with buzzer

using GPIO Zero [Link] Library


from gpiozero import LED, Buzzer
import [Link] as GPIO
from time import sleep
import time
[Link]([Link])
led = LED(17) # LED on GPIO17
[Link](17, [Link])
buzzer = Buzzer(18) # Buzzer on GPIO18
[Link](18, [Link])
while True:
whileTrue:
[Link]()
[Link](17, [Link]) # LED ON
[Link]()
[Link](18, [Link]) # Buzzer ON
sleep(1) # ON for 1 sec
[Link](1)
[Link]()
[Link](17, [Link]) # LED OFF
[Link]()
[Link](18, [Link]) # Buzzer OFF
sleep(1) # OFF for 1 sec
[Link](1)

You might also like