Skip to content

jwlauer/PressureToGoogleSheets

Repository files navigation

Overview

This repository includes code for developing a wifi-enabled differential pressure logger using an ESP32 microcontroller (Lolin D32 Pro), a MS5803-05BA submersible pressure sensor, a Bosch BMP/BME 280 atmospheric pressure sensor, and an optional DS3231 Real Time Clock. Code was tested using the generic MicroPython 1.14 build for ESP IDF v3.x.

The logging program saves data to an SD card or flash memory on the Lolin D32 Pro and attempts to post the data to a Google Sheet using a separate Google Apps script. The dopost.js Google Apps script is coded in javascript and must be deployed using a valid Google account. Appropriate API Keys must updated in the file logger_google_sheets.py.

The easiest way to deploy the code is to copy all *.py files in the repository to the Lolin D32 Pro using an IDE like Thonny. Thonny can also be used to install the correct version of MicroPython on the ESP32.

Wiring

The code assumes all sensors as well as the DS3231 RTC are wired to the same I2C bus using:

SDA --> Pin 21
SCL --> Pin 22
VCC --> 3V
GND --> GND

The code uses pin 15 to wake the ESP32 from deep sleep. Proper functionality may require adding a weak external pullup resistor (e.g., 100K) to pin 15.

Breakout modules for the BMP/BME280 and DS3231 RTC are readily available. While breakout modules for the MS5803 are also commercially available, they can be too large for practical incorporation in a submersible pressure sensor. I've laid out a small custom PCB that can simplify wiring and allows the sensor to be installed inside standard 1-inch PVC pipe. The I2C address of the MS5803 must be set to 0x76 using an appropriate solder bridge. Instructions for using the MS5803 with a small generic PCB are available at the Cave Pearl Project.

Acknowledgements

The code uses the prerequests library, the BME280 library, and AdaFruit's urtc library. This MS5803-05BA library was modified for use with micropython. The javascript code is based on this Google App Scripts example.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors