IoT water tank telemetry project – part 1

This is the first in a series of articles describing a simple maker / DIY IoT water tank telemetry system.

Design criteria

  • capture water depth, temperature and relative humidity;
  • IoT connectivity;
  • solar / battery powered;
  • wireless connection;
  • use existing inexpensive electronic modules.

Design choices made initially:

  • 4-20mA water pressure sensor for depth measurement;
  • ESP8266 Wemos D1 mini pro for the MCU and wireless elements;
  • NodeMCU / Lua software environment;
  • external antenna for improved WiFi range;
  • 6V 100mA PV array;
  • module with TP4056 batter charger and cell protection chip;
  • 2500mAh 18650 cell;
  • AM2320 temperature and humidity sensor;
  • bipolar transistor switch for boost converter;
  • Thingspeak RESTful interface for data accumulation and presentation.

Block diagram

Above is a block diagram showing the major system components. Almost all of the electronics is on easily obtained low cost electronic modules source from eBay, assembled on a Veroboard backplane.


Above is a breadboard mock-up for prototyping code and making measurements to establish feasibility of the design (proof of concept if you like).

Initial tests used an inexpensive 4-20mA simulator (ebay: ~$12) to provide a convenient simulation of the water pressure sensor for testing and calibration. In the pictured mock-up, Vbat is divided down and supplies the ADC input for logging batter voltage instead of sensor input, a load test of battery consumption. The mockup above lacks the PV array and battery charger elements. The DC-DC boost converter is a substitute pending arrival of the intended device, and the module to far right is unused in this test.

The pic is taken during the couple of seconds every ten minutes that the 4-20mA loop is powered, it is shutdown when not needed to conserve battery.

Above, the submersible 4-20mA water pressure sensor is about 150mm long and just under 30mm diameter weighing around 400g + cable, this one is calibrated for 0-4m depth and cost around $56 posted on Aliexpress.

Initial measurements

Converter start time

The MCU board contains a low drop out (LDO) regulator to 3.3V, and more than 3.4V input is sufficient for regulation. Tests will be conducted to proved the minimum unregulated voltage for reliable operation.

Above is a capture of the logical drive to the boost switch, and the voltage at the a0 pin with the 4-20mA simulator set to 20mA. The system stabilises in well under 20ms, but the definitive test is with the intended boost converter, and the water pressure sensor. The battery consumption tests proceed with 1000ms delay before measurement, probably way more than ever needed.

Battery consumption

The following is a conservative estimate of battery consumption, it is likely to be well less than the estimate under actual usage and with variations like converter on duration.

Battery consumption is dominated by the measurement phase, sleep consumption is negligible. The measurement phase has two components, 70mA for the entire 12s phase (70*12/3600) 0.233mAh, and converter consumption of say 500mA for 1.0s (500*1.0/3600) 0.139mAh, for 6 measurements per hour gives a daily total of 54mAh per day, a life of 46 days on a 2500mAh 18650 LiIon cell. The cell will be charged from a solar PV array, but it has a long reserve for low insolation.

Solar power

A PV array 80x55mm is available, it was sold as a 6V 100mA array. The Chinese invariably cheat on these things, so it bears checking.

Above, a load curve for the PV array in full Sun. 80mA would be a fairer rating, and we can expect that it will deliver that to a LiIon (or LiPo) cell right up to 4.3V cell voltage.

If we budget on a term average of 1 hour full Sun equivalent over 10 days, that is 800mAh, well in excess of expected consumption, so a battery with capacity of more than say 1000mAh should not go flat.

Now, experience is that these cheap PV arrays are not UV tolerant and will craze over in a couple of years (Chinese Quality?), eventually requiring replacement. This should be kept in mind in designing the fixing.

Trial acquisition

Above is a set of graphs from Thingspeak for about nine hours of data collection. The first graph is from the 4-20mA simulator set to 12mA (50%), the others are real data from the AM2320 sensor.