NucuCar/NucuCar.Sensors
2021-05-27 22:22:48 +03:00
..
Abstractions Refactor Telemetry project structure 2020-08-01 18:07:13 +03:00
Grpc Make NucuCar.Sensors\Grpc\Responses.cs field read only. 2021-05-27 22:22:48 +03:00
Modules Remove int cast for Pms5003Sensor telemetry. 2021-04-30 16:05:37 +03:00
Properties NUH-38: Implement TelemetryPublisherConsole 2020-08-01 17:49:20 +03:00
appsettings.Development.json Modify launchSettings and appsettings 2020-08-01 16:40:46 +03:00
appsettings.json NUC-32: Refactor Pms5003Sensor code. 2021-04-25 23:33:12 +03:00
BaseSensorConfig.cs NUC-32: Implement PMS5003 Sensor 2021-04-24 21:44:54 +03:00
Dockerfile NUH-40: Add Dockerfile support for NucuCar.Sensors 2020-08-09 12:49:36 +03:00
NucuCar.Sensors.csproj NUC-32: Implement PMS5003 Sensor 2021-04-24 21:44:54 +03:00
Program.cs NUC-32: Improve Pms5003 sensor implementation & register 2021-04-25 18:40:56 +03:00
Readme.md NUC-36: Replace fritzing with kicad. 2021-05-01 18:35:57 +03:00
SensorWorker.cs NUC-3: Fix unhandled TaskCanceledException in SensorWorker.cs and TelemetryWorker.cs 2020-10-25 15:31:54 +02:00

Introduction

This module will read sensors data periodically and provide access to it via gRPC, while optionally publishing telemetry data into the cloud.

For installing see instructions from the Readme.md file located at the root directory.

Wiring

You may download the Kicad diagrams from Docs/kicad/.

Wire your sensor according to the following diagram:

raspberry pi wiring diagram

BME680

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.

Make sure I2C is enabled. Use raspi-config.

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)

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"
    },
    "EnvironmentSensor": {
        "Enabled": true,
        "Telemetry": true,
        "Grpc": true
    },
}

Sensors

Environment Sensor

We use BME680 environmental sensor from Bosh.

Sensor capabilities:

  • Temperature
  • Barometric Pressure
  • Humidity
  • VOC Gas (Gas Resistance)