Skip to content

HerrRiebmann/Caravan_Leveler_2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caravan Leveler 2.0

ESP32 digital water level bubble with an MPU6050 Gyroscope & Accelerometer

The successor of the Caravan Leveler 1.0

Caravan Leveler

An ESP32 will create a hotspot with a captive portal. This captive portal will force the phone to open up a, usually for login intended, website (which represents the water level).

Version Live Demo

Contents

Intention

The intention was, to attach this to my caravan (Knaus Sport & Fun) and provide it with 12V on-board voltage. When arriving at a campingside, the phone will automatically connect to this as a known hotspot, open up the digital leveler and I can happily crank the supports.

In short: Lazy me doesn´t want to constantly walk to the inside and check the level 🤷

Usage

Main Menu

Main Menu

  • Upload loads a file to the SPIFFS filesystem. To overwrite existing files, the filename must be equal (see /data)! The filenames are case sensitive!

  • Or updates the firmware by uploading a *.bin file.

  • Or updates the spiffs with a spiffs.*.bin file.

Settings

Settings

  • Indicating Range describes the water bubble maximum value, when it will reach the scales end

  • Invert Axis turns the MPU6050 Gyro (swaps X- and Y-Axis)

  • Serial Output enables USB serial (and webbased) output

  • Save will store all values to the ESP32

  • Calibrate sets the current degrees to zero (ensure the Gyro is leveled)

  • Restart reboots the ESP32

  • Advanced Settings opens further settings

Advanced Settings:

Advanced Settings

Advanced Voltage Settings

  • Voltage Pin Analog ADC pin number for voltage measurement (0-36) Check your ESP for ADC inputs!

  • Voltage Threshold threshold to correct differences by diodes and resistors

  • Resistor 1 First resistor value in ohms for voltage divider (After 12V, Before measuring)

  • Resistor 2 Second resistor value in ohms for voltage divider (After measuring, before GND)

WiFi

  • Use Accesspoint or connect to an existing WiFi (SSID and Pasword required in code or can be set on the web-installer)

  • Accesspoint PW Password to secure the Accesspoint access

MPU6050

  • SDA Pin I²C Serial Data GPIO

  • SCL Pin I²C Serial Clock Line GPIO

  • I²C Adress Integer representation for the I2C adress (104 or 105)

Gimmicks

Gyro Chart

A Chart for Gyro, Acceleration and Voltage. Mostly just to debug and play around.

The Serial is also only implemented for testing purpose.

Things

Installation

You can download the files here, add the additional libraries and flash them via the Arduino IDE. All Libraries & Tools mentioned below. Or you can use the ESP32 Web firmware flash-method, which will install all the required components directly onto the ESP.

Currently supported Versions are ESP32, ESP32-S3 & ESP32-C3.

Caravan Leveler - Web Installer

This makes use of the ESP Web Tools from ESPhome, hosted on unpkg.com.

HardwareComponents

  • ESP32 C3 Supermini (Any other ESP32 will work)
  • MPU6050 (Accelerometer / Gyro)
  • LM2596 (DC-DC converter)
  • 5.2k & 1k Ohm Resistor (For measuring voltage)
  • 2 Diodes to prevent voltage reversing (like SR560 or SB5100)

Wiring

Wiring for my tested ESP32 types. Check the I2C pinout for your board!

MPU6050 ESP 32 ESP32-S3 ESP32-C3
SCL G22 G09 G09
SDA G21 G08 G08
VCC 3.3V 3.3V 3.3V
GND GND GND GND

The I²C adress will be 0x68 (Integer 104). In some cases, this might be 0x69 (105) when the jumper is set onto the board.

ESP 32 LM2596
VIN 5V OUT+
GND OUT-

Voltage Divider Any possible ADC Pin can be used. Please check it with the pinout for your device from the ESP32-family.

Type Pin
ESP32 34
ESP32-S3 1
ESP32-C3 0

For most other ESP32 Development Boards pin 30-36.

-Supply voltage (max 15V!!!)
|----LM2596 IN+
|5.2k Resistor
|----Connect ADC-Pin
|1k Resistor
|----LM2596 IN-
-GND

Schematic

Schematic

Diodes to secure the parts from reversed polarity were highly recommended!

SPIFFS Upload

To upload the HTML, JS and CSS files, I´ve used the Arduino ESP32 filesystem uploader You can find the latest release here and a tutorial on RandomNerdTutorials

For Arduino IDE 2.X use the VSIX from arduino-spiffs-upload

This is only necessary if you want to compile the code yourself and upload the webinterface to the ESP32 afterwards.

Libraries

  • Adafruit_MPU6050.h (2.2.6)
  • Adafruit Unified Sensor (1.1.15)
  • Improv WiFi Library (0.0.1)

OTA (Over the Air Update)

You should see the ESP32 in Arduino IDE under Tools -> Port -> Network-Interfaces (Caravan Leveler at IP-Adress) For more information see RandomNerdTutorials

Compatibility

Installed on ESP32 C3 Supermini, ESP-WROOM-32 DevBoard and ESP32-S3-WROOM-1 DevBoard (with 2 USB-C) Tested on Firefox, Chrome & Edge for Windows, iOS and Chrome & Firefox for Android.

Demo

The website, which will be hosted on the ESP32 can be tested here: Caravan Leveler 2.0 - Demo

Video

Main Menu

About

ESP32 digital water level via hotspot on any mobile device. Without an app or any installation. Great for leveling caravans or RV´s.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors