This is a node.js based sensor station, it reads data from USB serial device and send them to SensorWeb. You can run it on Mac OS, Linux, and Windows.
Since our first initiative is to build a PM2.5 sensor network, we will demostrate below how to setup the station with PM sensor connected.
- Arduino Board
- Currently we only develope and test it on Arduino Uno.
- USB 2 TTL Adapter
- Currently tested adapters are based on PL2303/FT232RL/CP2102 chipsets, make sure yours have 5V output.
- Plantower PM Sensor with Cable
- Currently only tested with PMS3003
- 5V input, communicate via UART
- Great accuracy according to comparative measurment on AQICN
- $17 USD
for Arduino and USB 2 TTL adapter, you only need one of them to get started.
Arduino will allow you to connect more different sensors in the future.
If you use Arduino, simply upload the Plantower PMS3003 firmware with Arduino IDE.
If you use an USB to TTL Adapter but your computer can't detect it, try to install it's official driver. Below are driver download links for supported adapters:
You only need to connect 4 pins of the PM Sensor, others should be left unconnected.
PM Sensor Pins | USB Adapter Pins |
---|---|
VCC (PIN1) | +5V |
GND (PIN2) | GND |
RXD (PIN4) | TXD |
TXD (PIN5) | RXD |
Clone the repo: git clone https://github.com/sensor-web/js-station
Go to the js-station
directory.
Do npm install
to install dependencies.
Edit config.js
to put your sensorId
and apiKey
in it, serialDeviceType: 'arduino'
if you're using Arduino or set serialDeviceType: 'usbttl'
if you're using supported USB to TTL Adpater.
Run node app.js
then you'll see console output if success.