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
Explore the cooling options ↓
The completed black NAS tower with a ventilated top, OLED display, power button, Ethernet and USB ports
The completed NAS with its ventilated top cover, OLED and front ports.

The parts

What is inside

PartThis build
ComputerRaspberry Pi 5 with 8 GB RAM.
Storage boardRadxa Penta SATA HAT, linked to the Pi's PCIe connector by an FPC cable.
Data drivesFour Western Digital WD10JFCX 1 TB, 2.5-inch SATA HDDs.
System drivemicroSD, separate from the data array. I have not recorded the card model and capacity here.
Status displayFour-pin 128×64 I²C OLED, flex marking NFP1315-51A; tested with the SSD1306-compatible configuration at 3.3 V. Identification and wiring.
CPU coolingRaspberry Pi 5 Active Cooler, separate from the disk-bay fan.
Power12 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.
EnclosurePrinted tower with lower I/O openings, a vertical drive bay and a ventilated top cover.
Operating systemRaspberry 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.

  1. Assemble the Pi, SATA HAT, drives and cooling, then check the power supply, board revision and wiring against Radxa's Raspberry Pi 5 instructions.
  2. 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=pciex1 to /boot/firmware/config.txt and reboot. Then confirm that Linux detects the intended drives before configuring storage.
  3. 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.
  4. 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.

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

Connection5 V fan12 V fan
Module VIN+Physical pin 2: +5 VConfirmed +12 V on the large HAT power connector. Leave pin 2 disconnected.
Module VIN−Physical pin 6: GNDGND on the HAT power connector
Module control GNDPhysical pin 6; common with supply negative
Module TRIG/PWMPhysical pin 13: GPIO27
Fan positive / negativeModule OUT+ / OUT− respectively
GPIO solder-joint diagram: pin 2 for 5 V, pin 6 ground, pin 13 GPIO27 control; separate 12 V power connector
GPIO connection variant. Component side, GPIO joints along the bottom; pin 1 is at the right-hand end of the inner row.

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.

Small 2 by 5 connector wiring with pin 4 supply, pin 9 ground and pin 8 PWM, plus a separate 12 V supply option
Connector variant. Both diagrams show alternative supply choices: use only the voltage matching the fan.

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 wireFunctionConnect to
Black · contact 1GroundHAT power connector GND; second contact from top in the illustration
Yellow · contact 2Continuous +12 VTop contact of the illustrated HAT power connector, marked 12V
Green · contact 3Tachometer outputPhysical pin 18 / GPIO24, input with internal pull-up to 3.3 V
Blue · contact 4PWM inputPhysical pin 12 / GPIO18, hardware PWM at 25 kHz
Noctua wiring illustration: yellow to 12 V, black to ground, blue to physical pin 12 GPIO18, green to physical pin 18 GPIO24
Four-wire variant. This connection uses no external resistor; enable the GPIO24 internal pull-up in software.

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 contactPhysical header pinSignal
VCC13.3 V from the Raspberry Pi header
GND6Ground
SCL5GPIO3 · I²C clock
SDA3GPIO2 · I²C data
OLED connection map: physical pin 1 supplies 3.3 V to VCC, pin 6 connects GND, pin 5 GPIO3 connects SCL, and pin 3 GPIO2 connects SDA. Component-side view with pin 1 at the rightmost inner joint.
Component-side view: SATA connectors face you, the large power connector is at the upper left, and the 40-pin joints run along the bottom. The rightmost inner joint is pin 1; the outer joint below it is pin 2. Colours identify signals in this illustration, not the colours of an existing cable.

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

  1. 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.
  2. 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.
  3. 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.

FromToConnection
Lifted DC connector positive contactPololu VINUnswitched +12 V
Pololu VOUTRadxa original positive supply padSwitched +12 V; no parallel bypass
Connector / HAT groundPololu GNDCommon ground; original ground is not cut
External momentary buttonPololu A and GNDOne wire to each; on-only
Pi GPIO25, physical pin 22Pololu OFF1 kΩ series resistor in the signal wire
Pololu OFFPololu GND10 kΩ pull-down soldered directly on the switch board
Pololu B, ON and CTRLUnconnectedUnused 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.

My installed power circuit: connector positive to VIN, VOUT to Radxa positive, common ground, A–GND start button, GPIO25 through 1 kΩ to OFF and 10 kΩ from OFF to ground
Installed circuit: start button on A–GND; GPIO25 cuts power after shutdown. The DC connector is shown schematically.
GPIO25 is physical pin 22 on the Pi; the 10 kΩ resistor connects Pololu OFF to upper GND, with 1 kΩ in series from GPIO25
My GPIO25 connection and OFF–GND resistor placement. The Pi view is from the component side, with USB/Ethernet on the right: GPIO25 is the 11th contact from the left in the outer, even-numbered row. A view from below is mirrored. The Pololu detail shows its right-hand small-hole row; the large power pads are not included in that count.

Enable automatic cut-off in PaNasMs

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Optional next step — not installed

One button for start and a shutdown request

My installed A–GND button only starts the NAS. An alternative circuit can also let a running Pi detect a press and request an orderly shutdown. I have not assembled or tested this optocoupler extension, but the PaNasMs 0.2.32 Testing builds include an optional button-input handler for builders who choose it. The existing automatic OFF output remains in use.

In this alternative, replace the A–GND button connection: connect VIN +12 V → momentary button → node X → Pololu ON. Node X also feeds a PC817 optocoupler LED through a 2.2 kΩ resistor. Its transistor pulls a separate Pi GPIO input low when the button is pressed. The input has a 10 kΩ pull-up to the Pi's 3.3 V rail. The optocoupler transfers the button signal without putting 12 V on a GPIO; because the grounds are common, this is not galvanic isolation of the entire NAS.

ConnectionPurpose
Node X → 2.2 kΩ, 0.25 W → PC817 pin 1 (anode)LED drive, approximately 5 mA at 12 V
PC817 pin 2 (cathode) → GNDLED return
PC817 pin 4 (collector) → separate GPIO inputActive-low button signal
Pi 3.3 V, physical pin 1 → 10 kΩ → same inputPull-up: released = high, pressed = low
PC817 pin 3 (emitter) → Pi GNDSignal return; common ground
GPIO25 → 1 kΩ → OFF; OFF → 10 kΩ → GNDKeep the existing final power-off circuit

I have shown GPIO22 / physical pin 15 as a possible button input, but I have not installed or reserved it for this purpose. Audit the chosen pin against the HAT, enabled overlays, OLED, cooling and custom wiring before using it; an alternative OLED pair can use GPIO22/23. GPIO25 / physical pin 22 is the separate, already-tested OFF output. A, B and CTRL stay unconnected in this proposed ON-input arrangement.

Unbuilt PC817 proposal: VIN through the button to ON and through 2.2 kΩ to the optocoupler LED; its collector drives a separate pulled-up 3.3 V input; GPIO25 separately drives OFF through 1 kΩ with a 10 kΩ ground pull-down
Proposed PC817 button circuit; not built or tested. The yellow panel shows a Radxa header photograph with pin labels. Verify PC817 pin numbers against your component's datasheet.
  1. Select the Testing update channel and install a 0.2.32 Testing build containing the button feature. Stable remains 0.2.31 and does not include the input handler. Verify the assembled circuit and choose an unused BCM GPIO; GPIO22 / physical pin 15 is the suggested input, distinct from GPIO25 / physical pin 22 for final OFF.
  2. Open Settings → General → Power control. For this compatible two-function circuit, keep both options selected, choose the correct pins and save. For ON-only wiring, clear Shut down using a physical button before saving. Existing installations retain their old settings.
  3. If requested, reboot to activate final power cut-off. The button input waits for the configured output to be active. Release the button and check that the input reports armed. A held startup button must not shut the system down.
  4. With no important work running, test a later press/release, normal shutdown, final power removal, cold start and reboot. Recheck GPIO conflicts and consult the agent journal if the input reports an error. I have not physically tested this optocoupler circuit.

The input handler debounces each transition for 100 ms, waits for the initial start-button release before arming, and requests a normal OS shutdown only after a later press and release. After a successful shutdown request it ignores further presses. If the request fails, release the button and use a new press/release to retry; it does not retry automatically. Running NAS jobs may be interrupted. Do not replace this with an immediate OFF pulse: that would remove power before storage has shut down.

Reference checks: Pololu switch controls and variant specifications, Pololu support on VIN-level control and ON/OFF priority, and Sharp PC817 pinout and electrical data.

Before powering on

  1. Disconnect all power, including possible USB back-power, before soldering or moving wires.
  2. 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.
  3. 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.
  4. Insulate the joints, add strain relief and inspect for solder bridges. Do not solder into mating socket contacts.
  5. Check fan voltage, mechanical clearance, starting current and airflow. A similarly named Noctua 5V PWM model must not receive 12 V.
  6. 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.