https://github.com/chatch/nova-sds011
Nova SDS011 PM sensor serial reader
https://github.com/chatch/nova-sds011
Last synced: 11 months ago
JSON representation
Nova SDS011 PM sensor serial reader
- Host: GitHub
- URL: https://github.com/chatch/nova-sds011
- Owner: chatch
- License: gpl-3.0
- Created: 2016-04-10T03:36:09.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-22T13:23:49.000Z (about 10 years ago)
- Last Synced: 2025-06-01T15:47:40.208Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nova-sds011
[](https://www.npmjs.com/package/nova-sds011)
[](https://travis-ci.org/chatch/nova-sds011)
[Nova SDS011](http://inovafitness.com/upload/file/20150311/14261262164716.pdf) PM sensor serial reader
## Quickstart
Plugin the Nova and run "node index.js". (NOTE: script assumes the Nova is at /dev/ttyUSB0)
## Library Usage
Use [serialport](https://www.npmjs.com/package/serialport) with this library to read values:
```
let serialport = require("serialport")
let sds011 = require('nova-sds011')
let serial = new serialport.SerialPort("/dev/ttyUSB0", {
baudrate: 9600
})
serial.on('data', function (data) {
let pmValues = sds011(data)
if (!pmValues) {
log.error('failed to parse buffer [' + data.toString('hex') + ']')
return
}
console.info("pm2.5: " + pmValues.pm2_5 + "\tpm10: " + pmValues.pm10)
});
```