npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-pwm-fan

v1.1.0

Published

PWM-based fan control and RPM output plugin for Homebridge

Downloads

9

Readme

homebridge-pwm-fan

PWM-based fan control and RPM tachometer, plugin for Homebridge

Installation

  1. Install Homebridge using npm install -g homebridge
  2. Install this plugin npm install -g homebridge-pwm-fan
  3. Run sudo pigpiod after installing the pigpio library and Python
  4. Update your configuration file - see below for an example

Wiring diagram

More information: How PC Fans Work

Example of a wiring diagram for a PC fan with three wires:

PC fan with 3 wires

If there are four wires, wire the control wire to the PWM instead (leaving the fan power tied to the voltage rail) (untested). If you only have two wires, PWM fan speed control is possible but there is no feedback, no tachometer to read RPM (TODO: make the tachometer optional)

Note that the tachometer may output voltage equal to the supply rail. To power the fan on higher voltages, a logic level shifter would be needed to drop down the tachometer output to +3.3V suitable for Raspberry Pi GPIO input.

Configuration

  • accessory: "PWMFan"
  • name: descriptive name
  • tach_bcm: Broadcom pin number of tachometer
  • motor_bcm: Broadcom pin number of motor control/power
  • frequency: PWM frequency in hertz
  • def_dutycycle: default dutycycle on startup (0-255 = 0-100%)
  • min_dutycycle: minimum dutycycle, ignore attempts to set below (0-255 = 0-100%)

The given pin numbers should be the Broadcom (BCM) numbers, not physical. Tachometer readings may be inaccurate on 3-wire fans, especially at higher frequencies or lower duty cycles (fix is to use a 4-wire fan, with independent pulse-width control and fan power supply).

Example configuration:

    "accessories": [
        {
            "accessory": "PWMFan",
            "name": "Desk Fan",
            "tach_bcm": 16,
            "motor_bcm": 23,
            "frequency": 1,
            "def_dutycycle": 255,
            "min_dutycycle": 0
        }
    ]

This creates a Fan service, with characteristics: On, and RotationSpeed (get/set).

Implementation notes

Currently this plugin uses a Python helper script to access pigpiod, see pwmfanhelper.py for reasons why and how this could be improved to use native Node.js modules in the future (patches welcome!).

License

MIT