Step-by-step guides to help you learn and create with your Raspberry Pi.
Learn how to connect and configure your Raspberry Pi for the first time.
Start TutorialStep-by-step guide to installing and configuring Raspberry Pi OS on your device.
Start TutorialGet started with Python programming on your Raspberry Pi with these simple examples.
Start TutorialLearn how to control GPIO pins on your Raspberry Pi to interact with the physical world.
Start TutorialIn this comprehensive tutorial, you'll learn how to build a complete weather station using a Raspberry Pi and various sensors. We'll cover hardware setup, software programming, and data visualization.
import Adafruit_DHT
import time
import smbus2
import bmp280
# Setup for DHT22 sensor
DHT_SENSOR = Adafruit_DHT.DHT22
DHT_PIN = 4
# Setup for BMP280 sensor
bus = smbus2.SMBus(1)
bmp280_sensor = bmp280.BMP280(i2c_dev=bus)
def read_sensors():
# Read temperature & humidity from DHT22
humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
# Read pressure from BMP280
pressure = bmp280_sensor.get_pressure()
return temperature, humidity, pressure
# Main loop
while True:
temp, humidity, pressure = read_sensors()
print(f"Temperature: {temp:.1f}°C")
print(f"Humidity: {humidity:.1f}%")
print(f"Pressure: {pressure:.2f} hPa")
# Add code for data logging or display here
time.sleep(60) # Read every minute
View Full Tutorial
Learn the basics of electronic circuits by connecting and controlling LEDs with your Pi.
Start TutorialExplore different types of sensors and how to connect them to your Raspberry Pi.
Start TutorialFollow our curated learning path to master Raspberry Pi programming and electronics.