Skip to content
Wrapper library created to simplify use of SDS011 laser dust sensor in your projects
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
core
examples
tests
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
wrapper.js

README.md

SDS011-Wrapper

Build Status Codecov

Air quality measurements made easy with wrapper library for SDS011 UART interface.

Save your time and focus on specific IoT solution instead of serial communication.

NPM

Watch out!

Nova Fitness SDS011 laser is designed for 8000 hours of continuous use - this is less than one year. It is recommended to configure working period to extend life span of your solution.

Synopsis

  1. Require the module
const SDS011Wrapper = require("sds011-wrapper");
  1. Connect to your sensor through serial port
const sensor = new SDS011Wrapper("COM5");
  1. Configure
Promise
    .all([sensor.setReportingMode('active'), sensor.setWorkingPeriod(10)])
    .then(() => {
        // everything's set
    });
  1. Do awesome things
sensor.on('measure', (data) => {
    if (data['PM2.5'] > 10) {
        powerAirPurifierOn();
    } else {
        powerAirPurifierOff();
    }
});

Installation

npm install sds011-wrapper

Usage

  • Check the 'examples' folder.
  • See the API docs
You can’t perform that action at this time.