NucuCar/NucuCar.Sensors/Readme.md

84 lines
2.4 KiB
Markdown
Raw Normal View History

2020-11-25 19:03:53 +00:00
# Introduction
2020-11-25 19:03:53 +00:00
This module will read sensors data periodically and
provide access to it via gRPC, while optionally publishing telemetry data into the cloud.
2020-11-25 19:03:53 +00:00
For installing see instructions from the Readme.md file located at the root directory.
2020-11-25 19:03:53 +00:00
# Wiring
2019-12-05 16:55:05 +00:00
2021-05-01 15:35:57 +00:00
_You may download the Kicad diagrams from `Docs/kicad/`._
2020-11-25 19:03:53 +00:00
Wire your sensor according to the following diagram:
2019-12-05 16:55:05 +00:00
2021-05-01 15:35:57 +00:00
![raspberry pi wiring diagram](../Docs/images/nucucar_wiring.png)
2019-12-05 16:55:05 +00:00
#### BME680
2021-04-30 13:29:21 +00:00
Connect the BME680 sensor to the I2C bus 1 (I2C.1) of the Raspberry Pi.
The address ` 0x76` will be used to communicate with the sensor.
2020-11-25 19:03:53 +00:00
Make sure I2C is enabled. Use `raspi-config`.
2021-05-01 15:35:57 +00:00
#### PMS5003
Make sure to enable the serial hardware via `raspi-config`. Interfacing Options > Serial and disable the login shell and enable the serial port hardware.
Then edit `/boot/config.txt` file and add `enable_uart=1` and `dtoverlay=pi3-miniuart-bt` to the bottom.
SENSOR 1 (VCC) -> RPI 5V
SENSOR 2 (GND) -> RPI Ground
SENSOR 3 & 6 (SET & RESET) -> 10k OHM -> RPI 3.3V
SENSOR 4 (RXD) -> RPI Gpio 14 (UART TX)
SENSOR 6 (TXD) -> RPI Gpio 15 (UART RX)
2021-04-30 13:29:21 +00:00
# Configuration
Each Sensor is configured via the `appsettings.json` file. The following configuration options are
available to all sensors:
- Enabled: (bool) Enables or disables the sensor.
- Telemetry: (bool) Enables or disables telemetry reporting for the sensor.
- Grpc: (bool): Enables or disables the gRPC endpoint for the sensor.
- MeasurementInterval: (int) The interval in milliseconds in which the sensor will read data. Default: 3000
---
Besides sensor configuration, you may also configure the telemetry service. The telemetry service collects telemetry data from all sensors
and uses a telemetry publisher to publish the data.
Example config:
```
{
"Telemetry": {
"Publisher": "Disk",
"ServiceEnabled": true,
"PublishInterval": 3000,
"ConnectionString": "FileName=nucucar.telemetry;FileExtension=txt;Separator=\n"
},
2021-08-02 18:49:38 +00:00
"Bme680Sensor": {
2021-04-30 13:29:21 +00:00
"Enabled": true,
"Telemetry": true,
"Grpc": true
},
}
```
---
2020-11-25 19:03:53 +00:00
# Sensors
2021-08-02 18:49:38 +00:00
#### Bme680 Sensor
2019-11-09 13:34:49 +00:00
2021-08-02 18:49:38 +00:00
The [BME680](https://www.bosch-sensortec.com/bst/products/all_products/bme680) environmental sensor from Bosh.
2019-11-09 13:34:49 +00:00
2019-11-09 14:54:06 +00:00
Sensor capabilities:
* Temperature
* Barometric Pressure
* Humidity
2021-08-02 18:49:38 +00:00
* VOC Gas (Gas Resistance)
#### Pms5003 Sensor
The [Plantower PMS5003](http://www.plantower.com/en/content/?108.html) air quality sensor.