LoRa remote water tank level and pump controller (ReWaL): intro – 1

Spread the love

LoRa wireless remote water tank and pump controller (esp8266)
LoRa wireless remote water tank and pump controller (esp8266)

Problem

First the problem: I must refill a 1,5Km far water tank, so I need two devices:

  • a server that manages a pump: if the remote tank isn’t full the server start the pump with a relay and when the tank is full, stop the pump.
    • Start-stop pump;
    • Manage the remote message;
    • Prevent dangerous action if the remote device is no more active;
    • Monitor to select an operation mode and status.
  • A client that is in a remote position (tank position) checks the water level and warns the Server if It’s all ok or the tank is full.
    • Check the max and min level;
    • Warn Server about status;
    • Battery and solar-powered;
    • Sleep mode if no more need.

A simple demo

Here is a simple demo video.

Devices

Microcontroller

As usual, I’m going to use a WeMos D1 mini because is small and powerful, and I’d like to use WiFi (in the next release) to manage the configuration, more information on this tutorial. “ESP8266 tutorial (WeMos D1)“.

WeMos D1 mini esp8266 pinout mischianti low resolution
WeMos D1 mini esp8266 pinout mischianti low resolution

You can find the WeMos D1 on WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

Communication

For communication, I’m going to use 2 Ebyte e32 devices; check the devices in this tutorial, “LoRa e32 devices“.

LoRa E32-TTL-100

You can find the LoRa devices on AliExpress (433MHz 5Km) - AliExpress (433MHz 8Km) - AliExpress (433MHz 16Km) - AliExpress (868MHz 915MHz 5.5Km) - AliExpress (868MHz 915MHz 8Km)

Display

I love i2c devices, and in this project, I’m going to use an SDD1306, more information in this tutorial “OLED SDD1306“.

You can find here AliExpress I2C SPI SSD1306 0.91 0.96 inch OLED


Power supply

For the Server, I don’t have problems because It’s surely provided energy (to manage the pump), so a simple 5v voltage regulator (7805) for Microcontroller (selectable) and 3.3v (LM1117T-3.3) for all other components.

Pay attention. You can configure the PCB to power the E32 with 3.3v with LM1117 or from WeMos D1 or with 5v from 7805. With 5v, you can reach greater distances, but sometimes M0 and M1 can give problems.

For the client is more complex, because It’s become battery supplied, so I’m going to reuse a simple schema that you can find in this article “Emergency power bank homemade“, and a simple 6v solar panel; I chose to use an LM1117 for 3.3v for better battery management, but It isn’t so important, I’m going to do a variant to use 5v to give better performance.

Buttons

For the controls, I’m going to use pcf8574 with an encoder, more information is in this article “PCF8574 i2c digital I/O expander: Arduino, esp8266 and esp32, rotary encoder“.

Rotative encoders photo
Rotative encoders photo

You can find pcf8574 on AliExpress

You can find the encoder on AliExpress

Other components

Other simple components like 3.3v relay, electrolytic capacitors, 2n2222a transistor, LEDs, etc.

The relay on AliExpress
You can find the transistor on AliExpress

Start prototyping

To start prototyping, I use a series of shields created for this use, the result seems quite unstable, but It works very well.

WeMos All Shield pcf8574 ssd1036 relay e32 Lora
WeMos All Shield pcf8574 ssd1036 relay e32 Lora

All this shield is distributed for free, and you can buy the PCB from the PCB producer, the complete PCB of the Server, and the client. It’s also available.

For the Server I use:

LoRa wireless remote water tank and pump controller esp8266 Server PCB
LoRa wireless remote water tank and pump controller esp8266 Server PCB

For the client

LoRa wireless remote water tank and pump controller esp8266 Client PCB
LoRa wireless remote water tank and pump controller esp8266 Client PCB

Software

I use some libraries to manage devices and data.

For the Server I use:

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "PCF8574.h"
#include "LoRa_E32.h"
#include <ArduinoJson.h>

The library for the display from Adafruit, my libraries for pcf8574 and LoRa E32, and a library to manage messages in JSON format.

For the client:

#include "LoRa_E32.h"
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>

My LoRa E32 device library, the Arduino JSON, and the WiFi library manage sleep mode.

Demonstration video

Thanks

  1. LoRa remote water tank level and pump controller: intro
  2. LoRa remote water level and pump controller: server software
  3. LoRa remote water level and pump controller: client software
  4. LoRa remote water level and pump controller: server PCB
  5. LoRa remote water level and pump controller: client PCB
  6. LoRa remote water level and pump controller: assemble server and 3D printed case
  7. LoRa remote water level and pump controller: assemble client and 3D printed case


Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *