/arduino-water-level-measurement

Measure water level in a cistern using an Arduino and an ultrasonic sensor

Primary LanguageC++MIT LicenseMIT

Water Level Measurement using an Arduino and an Ultrasonic Sensor

The whole project was inspired by the work described in the following posts:

Hardware & Wiring

In this project, the Wemos D1 mini is utilized. To install this board type in Arduino IDE,

  1. Add the following URL to File -> Preferences -> Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json.
  2. Install the esp8266 board via the Boards Manager.
  3. Select "Wemos D1 mini" from the ESP8266 Boards as the currently used board.

HP-SR04

At first, the HP-SR04 can be put into operation. One major problem however, is that the sensor has a high probability to break due to humidity.

Visualization of the wiring for the HP-SR04

AJ-SR04M

A better option might be the AJ-SR04M. Here, the actual sensor is attached to a long wire and thus separated from the actual board. Thus, there is a better protection against humidity induced malfunction as it is possible to place the board outside the cistern.

Visualization of the wiring for the AJ-SR04M

Libraries

The following libraries are required:

Just clone them into the Arduino/libraries folder.
Also add the ArduinoJson Library to the project.

Upload Files

  • Navigate to the Sketch folder an create a now folder called data. In this folder, all website-related stuff like images, .css or .html files are stored.
  • The flash size of the corresponding ESP8266 Board should be set to 4M (FS:1MB) or 4M (1M SPIFFS).
  • .html, .css files and icons are uploaded using the Arduino ESP8266 filesystem uploader.
  • Download a release and put the resulting folder in the tools folder of your Sketchbook folder.