An open API service indexing awesome lists of open source software.

https://github.com/mguida22/environment-sensor


https://github.com/mguida22/environment-sensor

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        


robot with sensor 1
robot with sensor 2

# M5 Atom Matrix + BME688

Read environment data (temperature, humidity, pressure, altitude and gas resistance) using a M5 Atom Matrix wired up to a BME688 sensor.

An optional Rust server will log MCAP data files and stream it to [Foxglove](https://foxglove.dev/) using the [Foxglove Rust SDK](https://docs.foxglove.dev/docs/sdk/introduction).

foxglove streaming data over websocket

## Setup

### Wiring

Connect the sensor to your controller. I'm using a Seengreat BME688 sensor and wired the following pins together.

| Seengreat BME688 | M5 Atom |
| ---------------- | ------------- |
| VCC | 5V |
| GND | GND |
| SLC/SCK | G21 |
| SDA/MOSI | G25 |
| MISO/ADDR | not connected |
| CS | not connected |

m5 atom matrix wired to a seengreat bme688

References:

- https://seengreat.com/wiki/162/bme680-environmental-sensor-bme688-environmental-sensor#toc14
- https://docs.m5stack.com/en/core/ATOM%20Matrix

### Controller

Follow https://docs.m5stack.com/en/arduino/arduino_ide to get setup with Arduino and the M5 Atom Matrix.

You'll likely need to install the Adafruit BME680 and M5Stack libraries, along with their dependencies.

## Running

Select your device in the Arduino IDE and upload the code. Open the Serial Monitor and set the baud rate to 115200. You should see sensor readings.

```
{"temperature":19.37,"humidity":38.15,"pressure":900.16,"altitude":985.17,"gas_resistance":135.63}
```

These have the following units:

- Temperature: °C
- Humidity: %
- Pressure: hPa
- Altitude: m
- Gas Resistance: kΩ

## ESP32 Logger

If enabled in the `atom-environment-sensor` Arduino code, data will be sent over UDP to the rust server.

This will stream data to [Foxglove](https://foxglove.dev/) via a websocket connection, and write logs to MCAP files which can also be viewed in Foxglove.

```
cd esp32_logger
cargo run
```