Tasmota-Berry Tank Sensor for fuel-oil usind VL53L1X or SR04 sensor

Tasmota-Tank-Sensor

Tasmota-Berry Tank Sensor for fuel-oil volume measurement using an VL53L1X or SR04 sensor

The Sensor body

The sensor was prepared with 4 x 28awg 6inch wires that will connected later to the ESP32 board. The sensor body was made from a 2in PVC coupling, threaded on one end for the tank, and “slip” fitting on the other. A sheet of clear 1/16in Lexan was cut with a 2 ½ in hole saw to make the mounting plate for the sensor. (The inside diameter of the 2 1/2in hole saw is just the correct size for the mounting plate) The sensor was centered in the Lexan and mounted to the Lexan with 2 x 2.5mm stainless screws, thru the Lexan, with a nut that was pre-tighten, and a nylon washer to get the correct distant from the sensor to the Lexan, then the sensor, another nylon washer on top and finally a nut. Lexan was selected as its resistant to fuel-oil.

The PVC coupling was prepared with a bead of Permatex 82180 oil resistant silicon on the inside ridge of the coupling. The sensor assembled was then pressed inside the coupling onto the black silicon to form a vapor free seal from the tank to the sensor. A weight was added to keep pressure on the bond, and it was left to cure for 12hr.

Above the sensor, a thin piece of cardboard was cut with hole in the center to route the cable to the ESP32. This allowed the ESP32 to free float above the sensor without any issue of contact between the sensor and the ESP32 board.

The sensor wires were connected to the ESP32 D1 style board to GND, +3.3V, SDA on GPIO 23 and SCL to GPIO 22. To supply power, a cable was attached to GND and to VCC pins on the ESP32 board. This cable was routed to a cable gland mounted on top of a 2in PVC plug. The cable was connected to a 5V power source. (NOTE: 5V Only!!) PVC plug was pressed fit into coupling, not glued

Programming of the ESP32 was done via its micro-USB connector.

Programing the firmware

The sensor use on the project is an ST-Micro VL53L1X time of flight optical sensor, using the Tasmota Open source IOT firmware for ESP32 with its Berry scripting language. It provides a rich framework for develop IOT projects like this. We looks at other sensor options like SR04M ultrasonic sensor, but decided on the VL53L1X optical device. Another option would be the older VL53L0X with some minor changes to the software.

Tasmota has many, many options, it support a web interface and a full MQTT delivery of sensors data to downstream device like Node-Red, Grafana or home automation system, it also has a very rich scripting language (Berry) available.

The standard release (Ver: 10.1.0.0) that we used did not load the driver for the VL53L1X as a standard option, and we then needed to re-compile the program, that was done via Visual Studio Code and a copy of the source-tree from GitHub. A pre-compile binary is available in GitHub for this project.

It appears that the I2C driver for the VL53L1X does-not play well with some of the other pre-define drivers in Tasmota. To solve this issue we needed to disable all of the I2C driver except this one…

All change were made in one file: tasmota/user_config_override.h and re-compile of Tasmota ESP32.

This will enable I2C on GPIO 22 and 23

#define USER_TEMPLATE "{\"NAME\":\"Tank Sensor VL53L1X\",\"GPIO\":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,608,640,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],\"FLAG\":0,\"BASE\":1,\"CMND\":\"SetOption8 1\",\"CMND\":\"Module 0\"}"
   
    
#ifndef USE_VL53L1X   // Time of Flight Sensor
#define USE_VL53L1X 
#endif

#ifdef USE_VL53L1X
  #undef USE_VL53L0X    // same I2C addres as VL53L1
  #undef USE_TSL2561
  #undef USE_TSL2591

  // I2C enable bit array
  #undef  I2CDRIVERS_0_31
  #define I2CDRIVERS_0_31  0x00000000
  #undef  I2CDRIVERS_32_63
  #define I2CDRIVERS_32_63 0x00400000   // enable only device 54, the VL53L1
  #undef  I2CDRIVERS_64_95
  #define I2CDRIVERS_64_95 0x00000000
#endif

To load this file, compile Tasmota32 with the option above... Then Load the new binary image in your ESP32 and re-boot it. Open the web page for this device, select Console, then Manage File System Rename this Berry file to "autoexec.be", then upload it to the ESP32 file system. Reboot Tasmota, this Berry file will run after re-booting.

tasmota32-2022.01.3-VL53L1X.bin is compiled for VL53L1X and is located in GitHub
user_config_override.h was used to build this .bin
Similar Resources

Allows for multiple SwitchBot buttons and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Meter/Temp Sensor

SwitchBot-MQTT-BLE-ESP32 Switchbot local control using ESP32. no switchbot hub used/required. works with any smarthub that supports MQTT https://githu

Dec 27, 2022

🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

b-parasite b-parasite is an open source Bluetooth Low Energy (BLE) soil moisture and ambient temperature/humidity sensor. Features Soil moisture senso

Jan 8, 2023

Arduino based bicycle movement sensor and GPS tracker

Arduino based bicycle movement sensor and GPS tracker

Bike Tracker Background There are actually plenty of bicycle trackers around, so why make your own? Well, so that it works the way you want it… And it

Aug 21, 2022

Simple sensor filter chain nodes and nodelets

sensor_filters This package is a collection of nodes and nodelets that service a filters::FilterChain for message types from sensor_msgs package. Each

Aug 15, 2022

Example application for Sparkfun-Himax workshop with CCS811 sensor

Example application for Sparkfun-Himax workshop with CCS811 sensor

What's that smell workshop This repo contains the example applications for the workshop with Sparkfun Qwiic Environmental Combo breakout and Himax WE-

Apr 16, 2021

Common Sensor API for the BMA2 family of sensors

BMA2 Sensor API Sensor overview The BMA2 is a triaxial, low-g acceleration sensor with digital output. An ASIC in the sensor converts the output of a

Dec 5, 2022

Driver for the TI TMP102 I2C temperature sensor. For use with TI TM4C123X MCUs.

TI TMP102 Driver Simple driver for the TI TMP102 I2C temperature sensor. For use with TI TM4C123X MCUs and TI's TivaWare™ Peripheral Driver Library. D

Jun 27, 2021

LM75A temperature sensor library that you can use with STM32F10x series microcontrollers.

STM32F10x-LM75A-Library LM75A temperature sensor library that you can use with STM32F10x series microcontrollers. Launching the LM75A sensor in your a

Nov 25, 2022

A Multi-sensor Fusion Odometry via Smoothing and Mapping.

A Multi-sensor Fusion Odometry via Smoothing and Mapping.

LVIO-SAM A multi-sensor fusion odometry, LVIO-SAM, which fuses LiDAR, stereo camera and inertial measurement unit (IMU) via smoothing and mapping. The

Dec 24, 2022
A STM32F428I-DISC1 based sonar which implements the HC-SR04 ultrasonic sensor and a mini-servo
A STM32F428I-DISC1 based sonar which implements the HC-SR04 ultrasonic sensor and a mini-servo

STM32 Sonar Youtube This is a Sonar based on the STM32 microcontroller. It uses the following parts: STM32F428I-DISC1 Devboard HC-SR04 ultrasonic sens

Nov 9, 2022
Decompilation of the Berry Fix Program included in Pokémon Emerald and FireRed/LeafGreen

Berry Fix This is a decompilation of the "Berry Program" multiboot image which comes compressed within Pokémon FireRed, LeafGreen, and Emerald. It is

Nov 13, 2022
A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux.
A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux.

TasmoManager A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux. Features Native Tasmota device discovery (via ta

Dec 10, 2022
DEV repository for full support of Ikea Vindriktning device to #Tasmota

Ikea Vindriktning a Tasmota V tomto repu. je vývojová verze úpravy Tasmota FW, tak aby mohl být použit na PCB LaskaKit ESP-VINDRIKTNING ESP-32 I2C. Cí

Dec 1, 2022
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9inch e-Paper Module
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9inch e-Paper Module

How to join: If device in FN(factory new) state: Press and hold button (1) for 2-3 seconds, until device start flashing led Wait, in case of successfu

Feb 13, 2022
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9/2.13/1.54 inch e-Paper Module
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9/2.13/1.54 inch e-Paper Module

How to join: If device in FN(factory new) state: Press and hold button (1) for 2-3 seconds, until device start flashing led Wait, in case of successfu

Dec 9, 2022
multispectral monitoring of a sourdough starter; esp32 eink module, scd30 co2 sensor, vl6180 distance sensor

EINK STARTER MONITOR See full blogpost here Tracks height of starter with a VL6180 i2c distance sensor, and CO2/temperature/humidity with an SCD30. A

Feb 16, 2022
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Apr 11, 2022
This is a tool for software engineers to view,record and analyse data(sensor data and module data) In the process of software development.
This is a tool for software engineers to view,record and analyse data(sensor data and module data) In the process of software development.

![Contributors][Huang Jianyu] Statement 由于工具源码在网上公开,除使用部分开源项目代码外,其余代码均来自我个人,工具本身不包含公司的知识产权,所有与公司有关的内容均从软件包中移除,软件发布遵循Apache协议,任何人均可下载进行修改使用,如使用过程中出现任何问

Dec 25, 2022
MPU-9250 sensor driver.
MPU-9250 sensor driver.

mpu9250 This library communicates with InvenSense MPU-9250 and MPU-9255 Inertial Measurement Units (IMUs). License Changelog Contributing guide Descri

Dec 30, 2022