Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe Raspberry Pi AI HAT+ puts a Hailo-8L neural accelerator on the Pi 5's PCIe lane. Raspberry Pi's own rpicam-apps include Hailo post-processing files, so a YOLOv8 detector runs with one command. The Python script uses Raspberry Pi's picamera2 Hailo example model to count 'person' detections each frame and logs the peak count per minute. Everything runs on the Pi: no video leaves the room.
Tell people in the area that a counting camera is in use, and point it only at your own premises.
Tick anything you already have and the total updates.
IMX219 8 MP camera with Pi 5 cable
Follow the colours: red is power, dark grey is ground, blue is a signal.
Official 27 W supply.
count.py# Run from picamera2/examples/hailo, next to detect.py, which provides the model path used here.
from picamera2 import Picamera2
from picamera2.devices import Hailo
from datetime import datetime
import time
MODEL = "/usr/share/hailo-models/yolov8s_h8l.hef"
with Hailo(MODEL) as hailo:
h, w = hailo.get_input_shape()[:2]
cam = Picamera2()
cam.configure(cam.create_preview_configuration(lores={"size": (w, h), "format": "RGB888"}))
cam.start()
peak, minute = 0, int(time.time() // 60)
while True:
frame = cam.capture_array("lores")
results = hailo.run(frame) # one list of detections per class (COCO order)
people = len(results[0]) # class 0 = person
peak = max(peak, people)
now = int(time.time() // 60)
if now != minute:
print(f"{datetime.now():%H:%M} peak people: {peak}")
with open("people.csv", "a") as f:
f.write(f"{datetime.now():%Y-%m-%d %H:%M},{peak}\n")
peak, minute = 0, now
Reseat the FFC cable and run 'sudo rpi-eeprom-update' to get the latest bootloader, then reboot.
List /usr/share/hailo-models/ and use the yolov8s file for the Hailo-8L that is there.
Average over a few frames, or raise the score threshold so weak boxes are ignored.
No, it only counts. Nothing is saved except the CSV of counts.
No, the AI HAT+ needs the Pi 5's PCIe connector.
Yes, use the COCO class index for car (2) instead of person (0).
6 parts: Raspberry Pi 5 with 4GB RAM, Raspberry Pi AI HAT+ with Hailo 8L (13 TOPS), Sony IMX219 8MP 77° FOV Camera Module for Raspberry Pi 5, Official Raspberry Pi 5 Active Cooler, Official 27W USB-C PD Power Supply for Raspberry Pi 5 – IN Plug and Official Raspberry Pi 32GB A2 Class Micro SD Card. On this page you can tick the parts you already have and add only the rest to your cart.
It is a advanced project and takes about 3 hours. The build on this page has 7 steps.
No. This page has the complete, tested code (count.py).
About ₹25,594 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Installing the Hailo runtime on a Pi 5; Running YOLO detection with rpicam-apps; Counting detections in Python.
Tell people in the area that a counting camera is in use, and point it only at your own premises.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.