Skip to content

Project to measure water level in water tank using ESP32 and sending to InfluxDB.

License

Notifications You must be signed in to change notification settings

johnnyfleet/esp32-water-tank

Repository files navigation

ESP32 Setup

This page outlines the tips I've learnt as I've tried to set up an internal weather station to compliment the external station. I started with Arduino IDE but prefer VSCode so quickly ported over to that.

Device

I've used the ESP32S Dev kit board. I bought this one from AliExpress.

Pin out Diagram

This guide is a useful diagram to get the wiring right. Also the names are labelled on tbe bottom.

ESP32S Pin Diagram

Tips to setup ESP32 in VSCode

If needing to set up again. My working setup uses platform.io extension to work

  1. Follow these instructions
  2. Setup udev rules for platform.io
  3. Specifically - read the part labelled Similarly, Arch users may need to add their user to the “uucp” group.
sudo usermod -a -G uucp $USER     # log out and back in of course
sudo usermod -a -G lock $USER     # log out and back in of course
  1. Set up the right default project location (seems to have issues with the Nextcloud document symlinks otherwise. Follow guide here
    1. Open new PlatformIDE terminal (within VSCode)
    2. Enter pio settings set projects_dir /new/path/projects/dir

Useful Info

Platform.io in VSCode

This site has logs of info on the settings and config that can be applied within VSCode.

Erase ESP32

If you've been playing around with lots of code and want to wipe back to the start you can follow the steps here.

In a PlatformIO terminal (in vscode) pio run -t erase. NOTE: If getting issues connecting, you may need to hold down the boot button on the board (or press and release). Once done hit the reset button to restart (although won't do much).

Setup Arduino IDE

This information for reference if wanting to use the ArduinoIDE

Setup ESP32 in ArduinoIDE

Follow these instructions

Make sure permissions to USB setup right on Manjaro. This page was useful. Specifically:

sudo pamac install arduino arduino-avr-core
sudo usermod -a -G uucp $USER     # log out and back in of course

Fix 'No "Serial" module' issue.

Similar to reported here.

sudo pip install pyserial

Fix Python issues on Ubuntu

espressif/arduino-esp32#13 On ubuntu 20.04 Python2 is gone and Python3 is default. But python program not visible (instead python3).

Run this to add a symlink

sudo ln -s /usr/bin/python3 /usr/bin/python

Set baud rate to 9600

Check in the code for the serial baud rate set and set up the serial monitor for the same.

9600 is on the standard program.

ESP32 Current readings

Reading of the ESP32 dev kits:

  • When running and settled - 55-65ma (Wifi on I think)
  • When running and settled - 48.2ma
  • Deep sleep 4.7ma

Seems to line up with this good summary comparison here. time to get a firebeetle board.

Solar charger

This gives a lot of good advice YouTube

I've got a 1W panel which I think will be sufficient for the project. Start with the dev kit but look to switch to the firebeetle when it arrives.

About

Project to measure water level in water tank using ESP32 and sending to InfluxDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published