Skip to content

Appendix L Adding a Propane Fuel Gauge to Genmon

jgyates edited this page Aug 11, 2020 · 15 revisions

Thanks to @zekyl314 for the following:

While there are other propane tank monitors you can purchase, you can also create one of your own. The first step is to get a guage that is compatible with your tank. For this project the tank already had the gauge at this link. It is possible to change your tanks physical gauge however the tank must be empty to change the gauge.

The tank reference above has the ability read the gauge via a sensor like this one.

Since the output of the sensor is analog, and analog to digial converter is needed to interface to the pi. This Analog to Digital Converter (ADC) was used as it converts the analog signal to a digital format than can be read via I2C. Since the raspberry pi supports I2C this was a natural fit.

The following diagram shows how the gauge, sensor, ADC and pi are connected:

Wiring Diagram

This page contains inforamtion about using the ADS1115 ADC with I2C on the raspberry pi.

Follow the instruction here to enable I2C on the Raspberry Pi.

To test that the above circuit is working you can install the i2c-tools package on the pi with the following commands:

 sudo apt-get update
 sudo apt-get install i2c-tools

Once enabled, verify the ADC is active on the I2C bus with the i2cdetect command.

sudo i2cdetect -y 1

This allows you to veryif the ADS1115 was connected at address 0x48.

You can validate your hardware is working by using the program i2cget from the command line (installed with I2C tools). To test the ADC you can use a 1.5 AA battery and a pair of batteries for 3.0 volts to validate the readings were correct.

sudo i2cget -y 1 0x48 0

The C code referenced in the link above has been modified and ported to python and is not integrated into genmon as an add on program.

For this gauge, 5 volts output is 100% full tank and zero volts is 0% (empty). The program will read the data and import it into genmon to display a gauge on the web interface. Emails will be sent when the fuel is below 20% and again at 10%.