Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe Pi 5 has a PCIe lane on a small flat connector. The Waveshare PCIe to dual M.2 HAT+ splits it with a PCIe switch so two M-key NVMe SSDs fit under the Pi. Here the two drives are combined into a software RAID 1 mirror with mdadm, so a single SSD failure loses nothing, and shared on the network with Samba. A mirror is not a backup: keep a second copy of anything precious elsewhere.
Tick anything you already have and the total updates.
PCIe switch with two M.2 M-key slots
27 W USB-C PD supply for the Pi and both SSDs
Follow the colours: red is power, dark grey is ground, blue is a signal.
Use the official 27 W supply: two SSDs need more than a phone charger gives.
setup.sh#!/bin/bash
# Run on the Pi 5 as a normal user with sudo. THIS ERASES BOTH SSDs.
set -e
sudo apt update && sudo apt install -y mdadm samba
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/nvme0n1 /dev/nvme1n1
sudo mkfs.ext4 -L nas /dev/md0
sudo mkdir -p /srv/nas && sudo mount /dev/md0 /srv/nas
sudo chown -R $USER:$USER /srv/nas
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u
echo '/dev/md0 /srv/nas ext4 defaults,nofail 0 2' | sudo tee -a /etc/fstab
sudo tee -a /etc/samba/smb.conf > /dev/null <<EOF
[nas]
path = /srv/nas
read only = no
valid users = $USER
EOF
sudo systemctl restart smbd
cat /proc/mdstat
Reseat the FFC cable and check 'dtparam=pciex1' is in config.txt. Some SSDs need the HAT's power LED on; check the HAT's switch.
mdadm syncs the two drives in the background after creation; wait for /proc/mdstat to finish.
Check the Pi's IP with 'hostname -I' and that smbd is running.
No. It protects against one drive dying, not against deleting a file or ransomware. Keep a second copy.
Yes, but keep the OS on the SD card for a NAS so the mirror holds only data.
Gigabit Ethernet limits it to about 110 MB/s, which the SSDs easily keep up with.
5 parts: Raspberry Pi 5 with 4GB RAM, Waveshare PCIe to Dual M.2 NVMe HAT+ 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 (setup.sh).
About ₹18,305 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Pi 5 PCIe and the FFC connector; Software RAID 1 with mdadm; Sharing a folder with Samba.
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.