All Projects → artem-smotrakov → esp32-weather-google-sheets

artem-smotrakov / esp32-weather-google-sheets

Licence: MIT License
Weather station based on ESP32 and MicroPython with sending data to Google Sheets

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to esp32-weather-google-sheets

nfc attendance system esp32
NFC Attendance System | 智慧校園NFC考勤系統 | 基於ESP32的智慧校園NFC考勤系統控制器
Stars: ✭ 27 (-43.75%)
Mutual labels:  esp32
inventory-demo
a simple MERN stack CRUD app example
Stars: ✭ 15 (-68.75%)
Mutual labels:  oauth2
esptool
esptool.py replacement written in #golang
Stars: ✭ 18 (-62.5%)
Mutual labels:  esp32
IoTManager
Это модульная система автоматизации на базе ESP32/ESP8266 микроконтроллеров и приложения IoT Manager.
Stars: ✭ 41 (-14.58%)
Mutual labels:  esp32
esp32-custom-vision
A simple face recognition using ESP32 Microcontroller with camera, and leveraging cloud-based inference powered by Azure Custom Vision.
Stars: ✭ 43 (-10.42%)
Mutual labels:  esp32
Callisto
A desk clock that uses a Russian IV-18 VFD tube
Stars: ✭ 18 (-62.5%)
Mutual labels:  esp32
angular2-social-login
Angular 2 OAuth social login facebook, google, LinkedIn etc using NodeJS server
Stars: ✭ 40 (-16.67%)
Mutual labels:  oauth2
nanoFramework.M5Stack
📦 Board support package for M5Stack, M5StickC and M5StickCPlus for .NET nanoFramework
Stars: ✭ 18 (-62.5%)
Mutual labels:  esp32
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (-33.33%)
Mutual labels:  esp32
Flask-Discord
Discord OAuth2 extension for Flask. An Easier implementation of "Log In With Discord".
Stars: ✭ 123 (+156.25%)
Mutual labels:  oauth2
esp-rgb-led-matrix
Full RGB LED matrix, based on an ESP32 and WS2812B LEDs.
Stars: ✭ 91 (+89.58%)
Mutual labels:  esp32
werther
An Identity Provider for ORY Hydra over LDAP
Stars: ✭ 103 (+114.58%)
Mutual labels:  oauth2
interesting-keys
Interesting collected (leaked) encryption/decryption keys
Stars: ✭ 33 (-31.25%)
Mutual labels:  rsa
lis3dh-esp-idf
LIS3DH driver for ESP-IDF (ESP32)
Stars: ✭ 27 (-43.75%)
Mutual labels:  esp32
nextjs-redux-authentication-boilerplate
NextJS app with Redux based authentication (via OAuth2).
Stars: ✭ 38 (-20.83%)
Mutual labels:  oauth2
esp-idf-vscode-boilerplate
Boilerplate for developing ESP-IDF applications using VS Code
Stars: ✭ 26 (-45.83%)
Mutual labels:  esp32
GITGET
GitHub의 Contributions를 iOS의 Widget으로 보여주는 App
Stars: ✭ 101 (+110.42%)
Mutual labels:  oauth2
odata2poco
generate POCO classes from OData service
Stars: ✭ 42 (-12.5%)
Mutual labels:  oauth2
osm-teams
Teams for OpenStreetMap! Check the beta 👉
Stars: ✭ 14 (-70.83%)
Mutual labels:  oauth2
esp32 snow
esp32 evk
Stars: ✭ 74 (+54.17%)
Mutual labels:  esp32

Weather station based on ESP32 and MicroPython

This is a weather station based on ESP32 and MicroPython.

Here is a list of main features:

  • Measuring temperature and humidity with DHT22 sensor
  • Measuring CO2 level with MH-Z19B sensor
  • Sending data to a Google sheet
  • Supporting Google OAuth 2.0 service to get access to the sheet
  • Reporting network connection status, errors and high CO2 level with LEDs
  • Configuring the device via web browser

The sheet doesn't need to be publicly available on the Internet. The device doesn't require any middleman such as PushingBox or IFTTT.

This README contains a brief description how the project can be built. More details can be found in the following blogs:

How to make a weather station

Here is a circuit.

The project uses MicroPython 1.13. Older or newer versions may also work. The project uses the following tools:

  • esptool for flashing ESP32
  • mpfshell for uploading files to ESP32
  • minicom for connecting to ESP32 for debugging purposes
  • openssl and rsa package for reading cryptographic keys

Preparing a service account in Google IAM

To access a Google sheet, the project needs a service account:

The key is encoded in PKCS1 format. Unfortunately, the project doesn't support PKCS1 yet. You need to convert the key to the format which the project undrstands:

$ cd scripts
$ sh extract_key.sh ../google_key.json ../key.json

You'll need key.json and an email for the sercvice account.

Creating a Google sheet

Create a Google sheet and extract its ID from the URL

https://docs.google.com/spreadsheets/d/<ID_is_here>/edit#gid=0

Share the sheet with your service account. The sheet doesn't need to be publicly accessible from the Internet.

Preparing a configuration file

main.conf contains a configuration for the device. Provide the following parameters:

  • ssid and password are credentials for your Wi-Fi
  • access_point_ssid and access_point_password are credentials for a Wi-Fi access point that is started by the device in the configuration mode.
  • google_service_account_email is an email for the Google's service account
  • google_sheet_id is the Google's sheet ID
  • measurement_interval is a mesurement interval in Xh Ym Zs format, for example, 1h 2m 3s
  • co2_threshold is a threshold for CO2 level. If the current CO2 level is higher than the threshold, the yellow LED turns on.
  • Pins on the ESP32 board that are connected to the sensors, switch and LEDs.

Uploading MicroPython

The following scripts may be used to upload MicroPython to ESP32:

$ sh scripts/erase.sh
$ sh scripts/flash.sh
$ sh scripts/verify.sh

Uploading code and configs

You can run sh scripts/upload.sh to upload the code, the configuration file and the key. Before running the script, set the followin environment variables:

$ export SSID=ssid-for-your-wifi
$ export WIFI_PASSWORD=password-for-your-wifi
$ export ACCESS_POINT_SSID=esp32-weather-google-sheets
$ export ACCESS_POINT_PASSWORD=password-for-the-access-point
$ export GOOGLE_SERVICE_ACCOUNT_EMAIL=your-google-service-account-email
$ export GOOGLE_SHEET_ID=your-google-sheet-id
$ sh scripts/upload.sh

Then, you can connect to the board with sh scripts/minicon.sh command to check if everything works fine.

Configuration mode

The switch turns on the configuration mode. In this mode the device starts up a Wi-Fi access point, and runs an HTTP server on http://192.168.4.1. The server provides a web form for updating the configuration of the device.

Acknowledgement

Further enhancements

Here is a list of possbile enhancements:

  1. Support BMP280 barometric pressure sensor
  2. Support DS18B20 temperature sensor
  3. Support PKCS1
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].