Arduino-based ATX power supply controller for an Intel NUC system.
This firmware allows an Intel NUC (which normally uses a DC barrel jack) to control a standard ATX power supply — giving it the ability to power on/off the PSU and itself, as if it had a 24-pin ATX motherboard connector.
An ATmega328p microcontroller sits between the NUC and the ATX PSU, connecting to the NUC's internal front panel header (power switch, reset switch, power LED, HDD LED) to monitor and control its power state. An external case power button triggers state transitions. It also manages a PWM cooling fan with temperature-based speed control.
stateDiagram-v2
[*] --> OFF
OFF --> ON : Power Button Pressed
ON --> TURNING_OFF : Power Button Pressed
ON --> OFF : NUC power LED off
TURNING_OFF --> OFF : NUC power LED off
OFF --> OFF : Long press (4s) — force power off
ON --> OFF : Long press (4s) — force power off
TURNING_OFF --> OFF : Long press (4s) — force power off
state OFF {
[*] --> off_idle
off_idle : PSU off (PS_ON HIGH)
off_idle : Fan off (0%)
off_idle : Arduino LED off
}
state ON {
[*] --> on_boot
on_boot : PSU on (PS_ON LOW)
on_boot : Press NUC power button (200ms pulse)
on_boot : Arduino LED on
on_boot --> on_running
on_running : Poll DHT11 sensor
on_running : Fan PWM scaled 25°C–49°C → 0%–100%
on_running : If 30+ sensor failures → Fan 99% (safety)
on_running : Monitor fan RPM via tachometer
}
state TURNING_OFF {
[*] --> shutdown
shutdown : Fan 99% — "Jet Mode"
shutdown : Press NUC power button (200ms pulse)
shutdown : Waiting for NUC power LED to go off
}
- Power sequencing: Manages ATX PSU PS_ON signal to start/stop the power supply
- NUC control: Simulates front panel power button press (200ms pulse) to boot/shutdown the NUC
- Graceful shutdown: Short press while ON initiates NUC shutdown, waits for power LED to go off
- Force shutdown: Long press (4 seconds) immediately kills PSU power from any state
- Temperature-based fan control: DHT11 sensor linearly scales fan speed between 25°C (off) and 49°C (full speed)
- Fan safety override: If temperature sensor fails 30+ consecutive reads, fan runs at 99%
- Fan tachometer: RPM monitoring via interrupt-based pulse counting
- MCU: ATmega328p (Arduino Pro Mini or SparkFun Pro Micro)
- Temperature sensor: DHT11
- Fan: 4-pin PWM fan at 25kHz
- NUC: Intel NUC (tested with D54250WYB / D34010WYB)
| Pin | Function |
|---|---|
| 2 | Fan tachometer (interrupt) |
| 3 or 10 | Fan PWM (board-dependent) |
| 6 | NUC reset switch |
| 7 | NUC power switch |
| 8 | NUC HDD LED input |
| 9 | NUC power LED input |
| 10 | PSU PS_ON signal |
| 11 | DHT11 sensor |
| 13 | Arduino status LED |
| A3 | External case power button |
Requires PlatformIO.
# Build pio run -e pro16MHzatmega328-win # Upload pio run -e pro16MHzatmega328-win -t upload # Serial monitor pio device monitor -e pro16MHzatmega328-win
Available environments:
pro16MHzatmega328-win— Arduino Pro Mini, Windows (COM7)pro16MHzatmega328-osx— Arduino Pro Mini, macOSsparkfun_promicro16-osx— SparkFun Pro Micro, macOS