Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivkos/sds011-client
https://github.com/ivkos/sds011-client
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ivkos/sds011-client
- Owner: ivkos
- License: mit
- Created: 2018-02-10T08:55:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T21:54:56.000Z (5 months ago)
- Last Synced: 2024-08-10T06:47:50.350Z (3 months ago)
- Language: JavaScript
- Size: 115 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SDS011 Client for Node.js
=========
[![Build Status](https://travis-ci.org/ivkos/sds011-client.svg?branch=master)](https://travis-ci.org/ivkos/sds011-client) [![Codecov](https://img.shields.io/codecov/c/github/ivkos/sds011-client.svg)](https://codecov.io/gh/ivkos/sds011-client)Air quality measurements made easy with client library for SDS011 UART interface.
Save your time and focus on specific IoT solution instead of serial communication.
[![NPM](https://nodei.co/npm/sds011-client.png)](https://npmjs.org/package/sds011-client)
## 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](https://github.com/ivkos/sds011-client/wiki/API#SDS011Client+setWorkingPeriod) to extend life span of your solution.
## Synopsis
1. Require the module
```js
const SDS011Client = require("sds011-client");
```
2. Connect to your sensor through serial port
```js
const sensor = new SDS011Client("COM5");
```
3. Configure
```js
Promise
.all([sensor.setReportingMode('active'), sensor.setWorkingPeriod(10)])
.then(() => {
// everything's set
});
```
4. Do awesome things
```js
sensor.on('reading', r => {
if (r.pm2p5 > 10) {
powerAirPurifierOn();
} else {
powerAirPurifierOff();
}
});
```## Installation
`npm install sds011-client`
## Usage
- Check the 'examples' folder.
- See the [API docs](https://github.com/ivkos/sds011-client/wiki/API)## Contributors
This project is based on the original work by [Michał Wilski](https://github.com/triforcely) - [SDS011-Wrapper](https://github.com/triforcely/sds011-wrapper).