PHPackages                             dept-of-scrapyard-robotics/system-fans - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dept-of-scrapyard-robotics/system-fans

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dept-of-scrapyard-robotics/system-fans
======================================

ScrapyardIO Framework extension library that enabled PWM and GPIO Control of Fans on Linux

0.1.1(4mo ago)00MITPHP ^8.3

Since Dec 27Pushed 4mo agoCompare

[ Source](https://github.com/DeptOfScrapyardRobotics/SystemFans)[ Packagist](https://packagist.org/packages/dept-of-scrapyard-robotics/system-fans)[ RSS](/packages/dept-of-scrapyard-robotics-system-fans/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

ScrapyardIO SystemFans
======================

[](#scrapyardio-systemfans)

Control your PWM or GPIO-driven SystemFans on your Embedded Linux enabled Device.

Requirements
------------

[](#requirements)

- PHP 8.3 or greater
- Scrapyard's [LinuxSystem](https://github.com/DeptOfScrapyardRobotics/LinuxSystem) Extension
- [ScrapyardIO](https://github.com/DeptOfScrapyardRobotics/ScrapyardIO) Package

Tested Devices
--------------

[](#tested-devices)

- Raspberry Pi 4 and 4
- Raspberry Pi Zero 2W
- Jetson Orin Nano

To Be Tested
------------

[](#to-be-tested)

- Arduino Uno Q
- BananaPi
- OrangePi
- BigTreeTech Pi4B

Installation
------------

[](#installation)

After installing Zephir, the Scrapyard LinuxSystem extension, and the ScrapyardIO package you can install the framework via composer:

```
composer require dept-of-scrapyard-robotics/system-fans
```

Usage
-----

[](#usage)

### GPIO Fans

[](#gpio-fans)

GPIO Fans are fans with 3-pins -

- (+) Voltage - 5V, 12V or 24V usually
- (-) Ground
- Data

When you plug the data pin into an available GPIO pin, you can turn the on at Full Speed or shut it off completely.

```
use ScrapyardIO\Actuation\SystemFans\Adapters\GPIOFanAdapter;

// On RPi 4, 5 and Zero2, the main PWM Chip is 4. This fan is plugged into GPIO 6 which maps to
// physical pin 31.
$fan = (new GPIOFanAdapter())->chip(4)->line(6);

// Turn on the fan
$fan->motorOn();

// Turn off the fan
$fan->motorOff();
```

### PWM Fans

[](#pwm-fans)

PWM Fans are fans with 3, sometimes 4-pins -

- (+) Voltage - 5V, 12V or 24V usually
- (-) Ground
- Data
- (Optional) Tachometer (like Noctua fans)

When you plug the data pin into an available PWM-controlled pin, you can do various things to the fan

- Toggle On/off
- Set the speed

```
use ScrapyardIO\Actuation\SystemFans\Adapters\PWMFanAdapter;

// This fan is plugged into PWMChip 0 broadcasting on Channel 0 which maps to
// physical pin 32 on an RPi 4, 5 and Zero2
$fan = (new PWMFanAdapter())->chip(0)->channel(0);

// Sets the speed to 80% and turns the fan on
$fan->speed(80)->on();

$fan->off()

```

### Using a Tachometer

[](#using-a-tachometer)

If the systems fan plugged into PWM also contains a 4th Pin, you can plug that pin into an available GPIO pin and set it as an input to read the fan's spinning RPMs.

```
use ScrapyardIO\Actuation\SystemFans\Adapters\PWMFanAdapter;

// This fan is plugged into PWMChip 0 broadcasting on Channel 0 which maps to
// physical pin 32 on an RPi 4, 5 and Zero2

// On RPi 4, 5 and Zero2, the main PWM Chip is 4. This tachometer is plugged into GPIO 6 which maps to
// physical pin 31.

$noctua_fan = (new PWMFanAdapter())->chip(0)->channel(0)->tach(4, 6);

// Blocks by default for 2 seconds, and sets PPR to 2
$rpm = $noctua_fan->rpm();
```

### Extending

[](#extending)

You can build you own fan implementation which will give you PWM access to

- Set the oscillation frequency

```
use ScrapyardIO\Actuation\SystemFans\Adapters\SystemFanAdapter;
use ScrapyardIO\Actuation\SystemFans\Concerns\PWMFanMotor;

class CustomFan extends SystemFanAdapter
{
    use PWMFanMotor;

    public function getOscillationFrequency(): int
    {
        return $this->fan_motor_pwm()->frequency();
    }
}
```

Credits
-------

[](#credits)

- [Angel Gonzalez](https://github.com/projectsaturnstudios)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance75

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2169021b88d520bd58d9a37f51fa55058af7adbf7362c8cade65b261d644874c?d=identicon)[projectsaturnstudios](/maintainers/projectsaturnstudios)

---

Top Contributors

[![projectsaturnstudios](https://avatars.githubusercontent.com/u/10563160?v=4)](https://github.com/projectsaturnstudios "projectsaturnstudios (4 commits)")

---

Tags

iolinuxembeddedGPIOpwmsystem fans

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/dept-of-scrapyard-robotics-system-fans/health.svg)

```
[![Health](https://phpackages.com/badges/dept-of-scrapyard-robotics-system-fans/health.svg)](https://phpackages.com/packages/dept-of-scrapyard-robotics-system-fans)
```

###  Alternatives

[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

688126.8M194](/packages/react-stream)[geo-io/interface

Geo I/O base interfaces.

626.1M7](/packages/geo-io-interface)[jolicode/php-os-helper

Helpers to detect the OS of the machine where PHP is running.

212.8M4](/packages/jolicode-php-os-helper)[piphp/gpio

A library for accessing the GPIO pins on a Raspberry Pi

4325.9k2](/packages/piphp-gpio)[ronanguilloux/php-gpio

GPIO-related utils &amp; toolkit PHP library

2678.0k](/packages/ronanguilloux-php-gpio)[genesisweb/valet-linux-plus

Advanced local development experience for Linux.

18215.3k](/packages/genesisweb-valet-linux-plus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
