https://github.com/triforcely/sds011-wrapper
Wrapper library created to simplify use of SDS011 laser dust sensor in your projects
https://github.com/triforcely/sds011-wrapper
sds011 sensor uart-protocol wrapper-library
Last synced: 9 months ago
JSON representation
Wrapper library created to simplify use of SDS011 laser dust sensor in your projects
- Host: GitHub
- URL: https://github.com/triforcely/sds011-wrapper
- Owner: triforcely
- License: mit
- Created: 2017-08-20T13:49:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:47:55.000Z (about 3 years ago)
- Last Synced: 2025-05-07T22:46:00.065Z (9 months ago)
- Topics: sds011, sensor, uart-protocol, wrapper-library
- Language: JavaScript
- Size: 178 KB
- Stars: 17
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SDS011-Wrapper
=========

[](https://travis-ci.org/triforcely/sds011-wrapper) [](https://codecov.io/gh/triforcely/sds011-wrapper)
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.
[](https://npmjs.org/package/sds011-wrapper)
## 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/triforcely/sds011-wrapper/wiki/API#SDS011Wrapper+setWorkingPeriod) to extend life span of your solution.
## Synopsis
1. Require the module
```js
const SDS011Wrapper = require("sds011-wrapper");
```
2. Connect to your sensor through serial port
```js
const sensor = new SDS011Wrapper("COM5");
```
3. Configure
```js
await sensor.setReportingMode('active');
await sensor.setWorkingPeriod(10);
// everything's set
```
4. Do awesome things
```js
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](https://github.com/triforcely/sds011-wrapper/wiki/API)