Difference between revisions of "Water level measurement"

From aquarium-doc
Jump to navigationJump to search
Line 10: Line 10:
==== Hardware ====
==== Hardware ====
The ultrasonic distance measurement device is sold with the commercial name [https://www.sparkfun.com/products/15569 HC-SR04].
The ultrasonic distance measurement device is sold with the commercial name [https://www.sparkfun.com/products/15569 HC-SR04].
The device has 4 pins:
* VCC: Supply voltage 5V
* GND
* TRIG: external trigger for sound wave
* ECHO: measurement of return of sound wave
The device is connected to a voltage translator with the commercial name [https://joy-it.net/en/products/COM-KY051VT KY-051].
The device is connected to a voltage translator with the commercial name [https://joy-it.net/en/products/COM-KY051VT KY-051].
[[File:Example Wiring HC-SR04 to KY051VT.png|thumb|Example Wiring HC-SR04 to KY051VT]]
The voltage translator is connected to the GPIO pins of the Raspberry Pi.
The voltage translator is connected to the GPIO pins of the Raspberry Pi.
==== Software ====
The SW implements an interrupt routine to capture the signal change timing.

Revision as of 14:37, 27 March 2022

Motivation

The measured water level is input for the calculation of the refill tank content. In order not to contaminate the water, a contact-less measurement is preferred.

Implementation

The control system uses a device which generates an ultrasonic sound and measures when the sound wave has travelled back from the water surface. The SW system will record the time used for this travel and calculate the corresponding distance using the speed of sound.

Ultra Sonic Distance Sensor Installed On Top Of Refill Tank

Hardware

The ultrasonic distance measurement device is sold with the commercial name HC-SR04. The device has 4 pins:

  • VCC: Supply voltage 5V
  • GND
  • TRIG: external trigger for sound wave
  • ECHO: measurement of return of sound wave

The device is connected to a voltage translator with the commercial name KY-051.

Example Wiring HC-SR04 to KY051VT

The voltage translator is connected to the GPIO pins of the Raspberry Pi.


Software

The SW implements an interrupt routine to capture the signal change timing.