doudar / Caravan_Leveler

ESP32 digital water level bubble with a ADXL345 Accelerometer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caravan Leveler

ESP32 digital water level bubble with an ADXL345 Accelerometer

Caravan Leveler

An ESP WROOM32 will create a hotspot with a captive portal. This captive portal will force the phone to open up a login-site (which represents the water level).

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

Captive Portal (Android 10):

Captive Portal

Calibrate sets the values to zero

Settings:

Settings

Threshold describes the water bubble maximum value, when it will reach the scales end

Invert Axis swaps X- and Y-Axis

Use Accesspoint or connect to an existing WiFi (SSID and Pasword required in code)

Valutation represents the values range from 0° to 90° (or -90° to 0°)

Rec starts recording the minimum and maximum values on both axis. Tip the board over to 90 degrees on every side. Afterwards, hit End to see those values.

Save will store all values above, to the ESP32

Upload loads a file to the LittleFS. To overwrite existing files, the filename must be equal (see /data)!

Video

3D Case

3D Printed case with wood filament:

Captive Portal

Attention! The wood filament comes thicker, so you might have to sand parts of the case. That´s not necesary using regular PLA.

Hotspot (Android 4.4.3):

Hotspot

Things

HardwareComponents

  • ESP WROOM32
  • ADXL345 (Accelerometer / Gyro)
  • LM2596 (DC-DC converter)
  • Rocker switch (15mm x 10mm)
  • 3D Printed Case

Wiring

ESP 32 ADXL345
G22 SCL
G21 SDA
3.3V VCC
GND GND
ESP 32 LM2596
5V OUT+
GND OUT-

LittleFS 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

Libraries

  • Adafruit Unified Sensor (1.0.3)
  • Adafruit ADXL345 (1.2.2)

OTA (Over the Air Update)

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

Power Switch

The DC converter is connected to the 12V net. So it will only be powered, enabling the boardnet (as you can see at the start of the video). To prevent the converter being powered all the time, standing on a campingside, I´ve added a illuminated momentary switch: Power Switch 19mm momentary blue led switch. Color and various logos can be ordered on well known, chinese express online shop ;)

Got a relais in between, which disconnects after about 15 minutes, after powering up. Not easy to find the right one, which immediately closes the relais and opens it after a specific period of time. Then remain like that, until the powersupply is cut off. A JK 11 timing relais (V2.0.2021-1) worked great, using a jumper instead of a trigger button. But not yet constantly installed...

Compatibility

Tested on iOS and Android 4.4.3, 8 and 10.

(And all estabished none-mobile Browsers, like Firefox, Edge or Chrome)

Disclamer

The ADXL345 is not a proper device to show exact degrees! It´s an accelerometer, which goal was to measure movements by gravitation. So all results are just approximation.

About

ESP32 digital water level bubble with a ADXL345 Accelerometer


Languages

Language:C++ 59.8%Language:JavaScript 23.2%Language:CSS 8.8%Language:HTML 8.1%