IoT water tank telemetry project – ultrasonic sensor – #1 described an inexpensive ultrasonic ranging sensor for trial.
Above is the HC-SR04 ultrasonic ranging sensor, it was purchased for around $6 from a local eBay seller and delivered within days. Note that there are somewhat similar looking things with a second board on the back and a different interface, the basic HC-SR04 as pictured suits this project.
In this second trial, the battery saving feature has been activated. It powers the HC-SR04 on for each measurement, waiting 600ms for the HC-SR04 to stabilise.
Previous versions of the tanklevel project have used a switch designed around two bipolar transistors, this test was of a AQY212EH Photomos chip which is easily driven by the 3V MCU pin via a 470Ω resistor, and the MOS output can switch 500mA with 60V withstand and very low ON resistance.
The Photomos has been very successful, works very well, very simple circuit, and very low cost.
A series of tests were conducted of range to a hard surface at a distance of about 2200mm and calculated ‘tank’ level and temperature plotted over time. Temperature is measured on the prototype breadboard using a DS18B20, and calculation of distance is compensated for the variation in velocity of sound with temperature.
We might expect some measurement noise, but the occasional glitches are unexpected.
The problem might be with the individual device, it is cheap Chinese hardware and that hints low quality. Some more are coming (on a slow boat from China) and will be trialed.
A work in progress…