Hardware / Build 01
Raspberry Pi 5 NAS.
Radxa Penta HAT.
Four SATA drives.
I built my NAS around a Raspberry Pi 5, a Radxa Penta SATA HAT and four 2.5-inch hard drives in a 3D-printed enclosure.
This is the NAS I use to develop PaNasMs. The build below covers the board stack, cooling, OLED and power switch.
- Board
- Pi 5 · 8 GB
- Storage
- 4 × 1 TB HDD
- Array
- Linux RAID 6, encrypted
The parts
What is inside
| Part | This build |
|---|---|
| Computer | Raspberry Pi 5 with 8 GB RAM. |
| Storage board | Radxa Penta SATA HAT, linked to the Pi's PCIe connector by an FPC cable. |
| Data drives | Four Western Digital WD10JFCX 1 TB, 2.5-inch SATA HDDs. |
| System drive | microSD, separate from the data array. I have not recorded the card model and capacity here. |
| Status display | Four-pin 128×64 I²C OLED, flex marking NFP1315-51A; tested with the SSD1306-compatible configuration at 3.3 V. Identification and wiring. |
| CPU cooling | Raspberry Pi 5 Active Cooler, separate from the disk-bay fan. |
| Power | 12 V supply to the HAT, which also powers the Pi. My purchase record lists Mean Well GST90A12-P1M (12 V, 6.67 A); I still need to confirm the label on the installed supply. |
| Enclosure | Printed tower with lower I/O openings, a vertical drive bay and a ventilated top cover. |
| Operating system | Raspberry Pi OS 13 with PaNasMs installed on top. Linux mdadm manages the RAID 6 array, which is encrypted with LUKS and unlocked at startup with a key on the system microSD. |
Four 1 TB drives in RAID 6 provide roughly 2 TB (about 1.8 TiB) before filesystem overhead. The array can survive two drive failures. RAID is not a backup.
The HAT offers four internal SATA connections and an additional eSATA connection. I use the four internal positions in my enclosure. See Radxa's hardware documentation for the board and its revision-specific pin allocation.
From boards to enclosure
The assembly


The Pi sits below the SATA HAT; the drives stand above it. I doubled the gap between the boards from 18 mm to 36 mm by stacking two 18 mm standoffs and two ordinary 2×20 GPIO header sockets. This gives the Pi's Active Cooler more room to draw air and makes space for more case vents. In my build, the increased spacing substantially reduced heat transfer from the Raspberry Pi processor to the drives: while the drives are asleep, their temperatures are now approximately 10 °C lower than with the boards packed closely together. This is an observation from everyday use rather than a controlled benchmark.
Support the drives, leave the vents open and avoid sharp bends in the PCIe ribbon. Check the standoffs, connectors and wiring before closing the cover.
Case files are not ready for download: I still need to check the print set, fasteners and third-party model licences. I have not fit-tested the 60 mm fan in every cover revision.
From hardware to a working NAS
Install the operating system and PaNasMs
I run Raspberry Pi OS 13 (64-bit) on a microSD card, with PaNasMs installed on top. PaNasMs is a browser-based management panel, not a bootable NAS image. The four SATA drives are separate from the system card.
- Assemble the Pi, SATA HAT, drives and cooling, then check the power supply, board revision and wiring against Radxa's Raspberry Pi 5 instructions.
- Install Raspberry Pi OS 13 (64-bit) on the system card, create an administrator account and boot the Pi. Follow Radxa's PCIe setup: add
dtparam=pciex1to/boot/firmware/config.txtand reboot. Then confirm that Linux detects the intended drives before configuring storage. - Follow the PaNasMs installation guide on the Pi. The installer adds the panel to the existing OS; it does not format data drives or create a RAID array.
- Use PaNasMs to inspect the disks and configure storage for your own needs. Check disk identifiers and keep a separate backup before any formatting or array changes; my encrypted RAID 6 layout is an example, not a requirement.
The install guide also covers supported Linux versions, first sign-in and updates. Disk cooling and the optional OLED display need the matching physical wiring and settings described below.
Disk-bay cooling
Two ways to control the fan
The CPU cooler and the disk-bay fan are independent. PaNasMs controls the disk-bay fan from disk temperatures and supports both arrangements below: external PWM for the two-wire fan and built-in PWM for the four-wire fan. They use different electrical signals and need different settings. I started with the two-wire fan and now use the four-wire Noctua in built-in PWM mode.
Two-wire fan + MOSFET
A 5010 or 5015 fan powered at 5 V or 12 V. GPIO27 controls an external switch in the fan's ground lead.
Wiring and limitations ↓ Current arrangement · built-in PWMFour-wire PWM fan
Noctua NF-A6x15 PWM, 12 V. Continuous power, a separate 25 kHz speed-control wire and RPM feedback.
Wire colours and pin map ↓Option 1 · Two-wire fan and external PWM switch
I initially used an Arduino-compatible MOSFET module labelled “535”. A two-wire 5010 (50 × 50 × 10 mm) or 5015 (50 × 50 × 15 mm) is the intended form factor. Match its rated voltage to the supply and verify mounting clearance; I have not fit-tested the deeper 5015.
The module switches the negative lead. GPIO27 is a 3.3 V control signal only; it never supplies the motor. “535” is not a complete electrical specification: check your module's terminal labels, ratings and 3.3 V input compatibility.
Connect directly to the GPIO solder joints
| Connection | 5 V fan | 12 V fan |
|---|---|---|
| Module VIN+ | Physical pin 2: +5 V | Confirmed +12 V on the large HAT power connector. Leave pin 2 disconnected. |
| Module VIN− | Physical pin 6: GND | GND on the HAT power connector |
| Module control GND | Physical pin 6; common with supply negative | |
| Module TRIG/PWM | Physical pin 13: GPIO27 | |
| Fan positive / negative | Module OUT+ / OUT− respectively | |

Alternative: use the small 2×5 connector
On this connector, pin 4 is +5 V, pin 9 is GND and pin 8 is the PWM route. These are its own connector numbers, not 40-pin GPIO numbers. For a 12 V fan, take power from the large power connector instead of pin 4.
The older Radxa schematic routes pin 8 through R563 to physical pin 13, with an alternative route via R573 to pin 33. Current generic documentation calls it PWM_33. Verify which route is populated on your revision; do not assume every HAT connects it to GPIO27. Radxa schematic.

Never join OUT− directly to ground: that bypasses the switch. Never feed a 5 V fan with 12 V, even at a low duty cycle. The 40-pin header has no 12 V rail.
What external PWM does, and what it does not
In external PWM mode the controller uses approximately 40 Hz software PWM on GPIO27 and the hottest active disk's temperature. The UI percentage is requested duty, not measured RPM: a two-wire fan has no tachometer feedback.
My previous fan crackled at low duty; the noise stopped when I tested a higher PWM frequency. Check that your fan starts reliably at the selected duty. I have not tested a replacement 12 V fan in this arrangement.
Option 2 · Noctua with native four-wire PWM
I now use the Noctua NF-A6x15 PWM, 12 V, 60 × 60 × 15 mm. It uses continuous power and a separate control input. I no longer use the old MOSFET module. Check mounting clearance for the 60 mm fan before fitting it to the cover.
| Fan wire | Function | Connect to |
|---|---|---|
| Black · contact 1 | Ground | HAT power connector GND; second contact from top in the illustration |
| Yellow · contact 2 | Continuous +12 V | Top contact of the illustrated HAT power connector, marked 12V |
| Green · contact 3 | Tachometer output | Physical pin 18 / GPIO24, input with internal pull-up to 3.3 V |
| Blue · contact 4 | PWM input | Physical pin 12 / GPIO18, hardware PWM at 25 kHz |

Noctua's PWM input accepts 3.3 V logic. The target is 25 kHz (40,000 ns period), with a specified 21–28 kHz range. Its tachometer is open-collector and produces two pulses per revolution. See Noctua's PWM specification and fan specifications.
Keep yellow and black continuously powered; do not reuse the old GPIO27 low-frequency supply switching. Physical pin 6 is a ground reference. The fan does not use physical pin 1; the optional OLED below uses it for 3.3 V. Never pull the tach signal up to 5 V or 12 V. Verify RPM reliability with the internal pull-up.
On Pi 5, select the RP1 hardware PWM function for GPIO18 and check pin ownership and overlays first. Do not copy a Pi 4 PWM channel number or assume a fixed pwmchip index. Removing the PWM signal normally gives full speed; a signal stuck low is a different failure and needs explicit handling. Before I added the power switch, the supply remained on after OS shutdown.
Optional status display
My OLED screen
I use an unbranded monochrome 128×64 I²C OLED module with NFP1315-51A printed on its flexible cable. The blue PCB is approximately 30 × 30 mm and has four contacts labelled VCC, GND, SCL and SDA. This marking identifies the module I tested; I do not have a manufacturer name or retail part number.
My display works at 3.3 V, responds at 0x3C and displays the full 128×64 image using the SSD1306-compatible configuration with zero column offset. I have not independently identified the controller IC. Do not assume that a similar-looking module uses the same controller or pin order: a two-column offset shifted the right edge off my screen, while the zero-offset setting showed the complete test frame.
Solder to the HAT's 40-pin header joints
I soldered the wires directly to the joints of the HAT's 40-pin header that mates with the Raspberry Pi. These are physical header numbers, not the separate 2×5 connector's numbers. GPIO2 and GPIO3 below use BCM numbering.
| OLED contact | Physical header pin | Signal |
|---|---|---|
| VCC | 1 | 3.3 V from the Raspberry Pi header |
| GND | 6 | Ground |
| SCL | 5 | GPIO3 · I²C clock |
| SDA | 3 | GPIO2 · I²C data |

This connection leaves the disk fan's GPIO18 PWM and GPIO24 tachometer lines free. The Radxa pin allocation lists pins 3 and 5 for OLED I²C; the Raspberry Pi header documentation describes the Pi's GPIO and power contacts.
Enable it in PaNasMs
- Install PaNasMs 0.2.30 or later, then open Settings → General → OLED display. Display support is available on compatible Raspberry Pi 5 systems and is off on a fresh installation.
- Enable display support. For this wiring, retain SDA GPIO2 / SCL GPIO3 (physical pins 3 / 5), SSD1306 · 128×64 and address 0x3C in Advanced settings. PaNasMs uses I²C bus 1 for this pin pair. I use 25% brightness and 0° rotation.
- Choose a layout, inspect its example and press Apply. Selecting an example alone does not change the physical screen. Brightness and 180° rotation can be adjusted in the same section.
PaNasMs manages the display service and I²C setup. This standalone display uses PaNasMs directly; the optional Radxa top-board software is not needed for it. Choose other GPIO pairs only when your wiring matches them; conflicts with the cooling pins are rejected and changing pins on an active I²C bus may require a restart.
- Overview: NAS name, IP address, CPU temperature, hottest disk and a fifth row for uptime.
- Large temperatures: IP address plus larger CPU and hottest-disk readings. This is the layout I use.
- Individual disks: IP address, CPU and each disk's temperature; longer disk lists continue on further pages.
- Rotating pages: IP address, CPU and each disk on separate pages with large temperature values.
The page interval is adjustable from 4 to 60 seconds in Advanced settings, with a default of 6 seconds. IP, CPU and disk readings can be selected separately. Disk temperatures reuse existing cooling telemetry without waking sleeping disks; unavailable or stale temperatures appear as --.
In October 2026 I checked I²C communication, a complete frame with zero offset, readable large text, all four layouts and automatic page changes. I have not physically tested other controller types or alternative pin pairs on this NAS.
Power-off that cuts the supply
Why I added a power switch
I found that shutting down Linux on my Raspberry Pi 5 + Radxa Penta SATA HAT stopped the operating system but did not disconnect the incoming 12 V supply. The NAS remained electrically powered after shutdown. A software shutdown alone could not open that power path.
I modified the HAT's existing DC input: I desoldered and lifted the connector's positive contact from the Radxa PCB, isolated it from its original pad, and soldered a wire from that contact to VIN on a Pololu Big Pushbutton Power Switch. I soldered a second wire from VOUT back to the original positive supply pad on the HAT. I left the connector's ground connection in place and added a ground branch to Pololu. Only the positive 12 V path is interrupted; the return is 0 V / GND, not −12 V.
DC connector +12 V → Pololu VIN → switched VOUT → Radxa +12 V pad
My installed circuit: button on, software off
I connected my external normally-open momentary button between A and GND. It only turns the NAS on; pressing it again while running does not request shutdown or cut power. The Pololu latch keeps power on after the button is released. I do not use its onboard toggle button or the A–B toggle connection for normal NAS operation.
To turn my NAS off, I use the normal shutdown action in PaNasMs. Linux stops services and shuts down storage first. At the final power-off stage the kernel's gpio-poweroff driver raises GPIO25, which drives Pololu's OFF input through a 1 kΩ resistor. Pololu then removes the downstream 12 V supply. This signal comes from the final kernel power-off path, not from stopping the PaNasMs service. A normal restart keeps power on.
| From | To | Connection |
|---|---|---|
| Lifted DC connector positive contact | Pololu VIN | Unswitched +12 V |
| Pololu VOUT | Radxa original positive supply pad | Switched +12 V; no parallel bypass |
| Connector / HAT ground | Pololu GND | Common ground; original ground is not cut |
| External momentary button | Pololu A and GND | One wire to each; on-only |
| Pi GPIO25, physical pin 22 | Pololu OFF | 1 kΩ series resistor in the signal wire |
| Pololu OFF | Pololu GND | 10 kΩ pull-down soldered directly on the switch board |
| Pololu B, ON and CTRL | Unconnected | Unused in this installed version |
Both resistors are 0.25 W, ±1%. Pi and Pololu share ground through the HAT and the supply wiring; an additional wire from Pi pin 6 is unnecessary when that connection already exists. GPIO25 is a BCM number: it is physical pin 22, not physical pin 25. My OLED uses GPIO2/3 and disk cooling uses GPIO18/24.
With the Pololu label side facing you and its four large power pads at the top, those large pads read VOUT, GND, GND, VIN from left to right. The eight small holes down the right edge read VIN, VIN, GND, GND, ON, OFF, CTRL, GND. The 10 kΩ resistor joins the third small hole (upper GND) and the sixth small hole (OFF). Confirm the printed labels and continuity on your board before soldering; the duplicated holes are connection alternatives.


Enable automatic cut-off in PaNasMs
- Install 0.2.31 or later and open Settings → General → Power control on a compatible Raspberry Pi 5. On a fresh installation, no power-control GPIO is activated. In the 0.2.32 Testing builds, both options are preselected in the setup form; only saving activates the configuration. For my ON-only wiring, leave physical-button shutdown unchecked.
- Enable automatic power cut-off and select the Power board GPIO matching your wiring: GPIO25 / physical pin 22 here. The pin is configurable; PaNasMs checks cooling, OLED and detected peripheral conflicts. Check any additional custom wiring yourself.
- Save and restart the NAS to activate the boot configuration. Verify that the settings show GPIO25 as active. Until this restart, the old shutdown configuration remains active. Move wiring only with the supply disconnected.
- Use the normal shutdown command, wait for completion and confirm that the downstream supply turns off. Press the external button to start again.
I tested GPIO25 power-off, a restart that kept power on, and a full shutdown followed by a button start. Check your Pololu variant's MP/HP current rating and size the switch, wiring and supply for disk spin-up and enclosure temperature.
Before powering on
- Disconnect all power, including possible USB back-power, before soldering or moving wires.
- Check the board revision and pin-1 orientation. On the HAT close-ups, the rightmost inner joint is pin 1 and the outer joint below it is pin 2. The Pi power-control diagram uses a different orientation, with pin 1 at the left; follow each figure’s stated view.
- Verify contact continuity while unpowered and the supply voltage before connecting the fan. The illustrated large power connector reads 12 V, GND, GND, NC from top to bottom.
- Insulate the joints, add strain relief and inspect for solder bridges. Do not solder into mating socket contacts.
- Check fan voltage, mechanical clearance, starting current and airflow. A similarly named Noctua 5V PWM model must not receive 12 V.
- For the four-wire fan, configure and verify the 25 kHz PWM output before automatic use. Test startup, minimum duty, temperature response and failure handling with the case assembled.
Sources and image credits
Build photos: Pavlo Matviienko. The header socket photo is by SparkFun Electronics, licensed CC BY 2.0.
HAT wiring diagrams adapt a Radxa Penta SATA HAT photograph, licensed CC BY 4.0. The GPIO25 diagram also includes a Raspberry Pi 5 reference image.
Additional references: Raspberry Pi GPIO documentation · RP1 peripherals · Radxa V1.2 mechanical reference.


