A lockdown build: reusing an old RO water cabinet and its solenoid valve, an Arduino Nano, and an ultrasonic sensor to dispense sanitizer touch-free without false triggers.

During the lockdown I found an old RO cabinet lying around unused. I contacted the RO mechanic and learned how the machine controlled the flow of liquid. The solenoid valve at the heart of the mechanism was intact and could be reused.
The tank can be filled with a soap solution or sanitizer and used to dispense it in a controlled, contactless way.
The challenge was how to control the dispensed quantity based on human input, triggered automatically. One option was an infrared sensor. The problem with the IR sensor was that it triggered falsely whenever electrical appliances nearby switched on or off, so I experimented with an ultrasonic sensor for the first time. To my surprise, it worked superfast and without false triggers.
I integrated the sensor with an Arduino Nano and 3D-printed a housing for the ultrasonic sensor, gluing it to the bottom of the cabinet. I later refined the design by changing cabinets and installing the sensor internally for greater robustness.
Originally published on sslabs.in.