Built to order

Automatic Hand Sanitizer Dispenser with IR Sensor and Low-Refill Alert using Arduino

This project builds an automatic hand sanitizer dispenser using an Arduino Nano: an FC-51 IR proximity sensor detects a hand under the nozzle and switches on a mini submersible pump to dispense sanitizer touchlessly, while an HC-SR04 ultrasonic sensor tracks the tank level and a SIM800L GSM module sends an SMS low-refill alert to the owner. A 16x2 LCD shows live status (READY, DISPENSING, REFILL NEEDED), and the dispense time is adjustable in firmware. Suitable for B.E./B.Tech final-year projects in Electronics & Telecommunication, Electrical and Computer engineering.

IoT & Embedded Arduino NanoHC-SR04 ultrasonic sensorSIM800L GSM module16x2 LCDAT commands · UARTLM2596 buck converterFC-51 IR proximity sensorMini submersible pump · relay moduleHardware
Automatic Hand Sanitizer Dispenser with IR Sensor and Low-Refill Alert using Arduino — project thumbnail preview
More project photos (2)

The problem

Shared sanitizer pump bottles in college corridors, canteens and labs are pressed by hundreds of hands a day, which undermines the hygiene they are supposed to provide. Commercial automatic dispensers solve the touchless part but are priced for institutions, run on sealed proprietary refills, and give the owner no way to know the tank is empty until someone waves at a dead nozzle. This project builds the same idea the open student way: an Arduino Nano reads an FC-51 IR proximity sensor mounted under the nozzle and runs a mini submersible pump for a fixed few seconds per hand detection, while a 16x2 LCD reports READY, DISPENSING or REFILL NEEDED. An HC-SR04 ultrasonic sensor on the tank lid continuously measures the sanitizer surface, and when the level sinks below a set threshold the SIM800L GSM module sends a low-refill SMS to the owner's phone. Every module is standard and cheaply available, and the behaviour — sensor range, dispense time, alert threshold — is all adjustable in the firmware.

SYSTEM FLOW

4 components 3 connections

Live flow
Drag to explore
100%
sensorHC-SR04 level sensor

Ultrasonic sensor on the tank lid times the echo off the sanitizer surface every few seconds; the firmware averages 5 readings.

Follow the working sequence

How it works

  1. The FC-51 IR module emits infrared from its LED and watches for the reflection with its photodiode; the onboard LM393 comparator flips its digital output LOW when a hand enters the roughly 10 cm detection zone (potentiometer-adjusted, design target).
  2. The Arduino Nano polls the IR output, and on a fresh detection it drives a 5 V relay module that switches the mini submersible pump (3–6 V DC, design target) for the configured dispense time — about 2 s by default, adjustable from 1–5 s in firmware.
  3. Sanitizer travels from the pump at the tank bottom through silicone tubing to the downward nozzle on the stand; the pump stops when the timer expires, and a lockout of about 3 s (design target) ignores further triggers while a hand stays under the nozzle.
  4. Independently, every few seconds the Arduino sends a 10 µs trigger pulse to the HC-SR04 on the tank lid, times the echo return, and converts it to the sanitizer surface distance (sensor range 2–400 cm, datasheet); averaging 5 readings smooths ripples into a stable fill percentage.
  5. When the fill falls below the roughly 20% threshold (design target), the Nano issues AT commands over UART to the SIM800L (AT+CMGF=1, then AT+CMGS) to send the low-refill SMS to the stored owner number; the alert fires once per event and re-arms after the level rises past the threshold.
  6. The 16x2 LCD mirrors the state machine throughout: READY on the first line with the fill percentage on the second, DISPENSING during a dispense, and blinking REFILL NEEDED when the level is low — so the unit is fully diagnosable without a computer attached.

Tech stack:

  • Arduino Nano (ATmega328P, Arduino framework)
  • FC-51 IR proximity sensor (LM393, adjustable 2–30 cm)
  • HC-SR04 ultrasonic sensor (TRIG/ECHO, 40 kHz)
  • SIM800L GSM module (quad-band 2G, AT commands, UART)
  • Mini submersible DC pump · 5 V relay driver module
  • 16x2 character LCD (I2C interface)
  • LM2596 buck converter (dedicated 4.0 V GSM rail)
  • Arduino IDE toolchain
Parameter Value
Controller Arduino Nano, ATmega328P at 16 MHz clock
IR hand detection FC-51 module, adjustable 2–30 cm range (typical); set to approximately 10 cm (design target)
IR output Digital, active-LOW on detection (module behaviour)
Ultrasonic level sensing HC-SR04, 2–400 cm range at 40 kHz (datasheet); 10 µs trigger, echo-timed
Level alert threshold Approximately 20% of tank depth, firmware-configurable (design target)
Tank Transparent plastic container, approximately 1 L capacity (design target)
Pump Mini submersible DC pump, 3–6 V (design target), switched via 5 V relay module
Dispense time 1–5 s per trigger, firmware-adjustable (design target; default approximately 2 s)
Re-trigger lockout Approximately 3 s after each dispense (design target)
GSM module SIM800L, quad-band 2G 850/900/1800/1900 MHz, text-mode SMS via AT commands (datasheet)
GSM supply Dedicated 3.7–4.2 V rail via LM2596 buck converter, 2 A peak capability (datasheet)
GSM logic levels 2.8 V UART (module datasheet); resistor divider on the Arduino TX line (design practice)
SMS behaviour One alert per low-level event; re-arms after refill (firmware)
Display 16x2 character LCD, I2C interface
System supply 5 V DC adapter, 2 A rating (design target)

Project features

  • [Touchless IR-triggered dispensing] The FC-51 IR proximity sensor under the nozzle watches for a hand at roughly 10 cm (potentiometer-set, design target); on detection the Arduino switches the pump on through a relay module, so sanitizer flows with zero contact.
  • [Ultrasonic tank-level monitoring] The HC-SR04 on the tank lid measures the distance to the sanitizer surface every few seconds and converts it to a fill percentage; the firmware averages several samples to smooth out surface ripples.
  • [SMS low-refill alert] When the level drops below the firmware-set threshold (about 20% of tank depth, design target), the SIM800L sends a text-mode SMS to the owner's number; the alert fires once per empty event and re-arms only after a refill.
  • [Live 16x2 LCD status] The display shows READY when idle, DISPENSING while the pump runs, and a blinking REFILL NEEDED when the level is low, so the unit's state is readable at a glance without a laptop.
  • [Honest GSM power design] The SIM800L runs on its own 3.7–4.2 V rail from an LM2596 buck converter with 2 A peak capability, exactly as its hardware design requires — the Arduino's 5 V pin cannot supply it, and the build documents this as a deliberate design decision.
  • [Firmware-configurable behaviour] Dispense time (1–5 s), level-alert threshold and the owner's phone number are constants at the top of the sketch, adjustable without touching any wiring.
  • [Re-trigger lockout and alert cooldown] A short lockout after each dispense ignores further triggers while a hand lingers under the nozzle, and the SMS alert is rate-limited to one message per low-level event.

Configurable in firmware: dispense time, level threshold, owner number, lockout period. Optional add-on: piezo buzzer beep on each dispense. Not included (future scope): Wi-Fi/cloud dashboard, battery or solar power, multi-nozzle variants — quotable separately.

What is included

  • Working automatic sanitizer dispenser prototype (tank, pump, nozzle stand, IR and ultrasonic sensors, SIM800L, LCD, Arduino Nano)
  • Complete Arduino firmware source code (documented, configurable constants)
  • Wiring diagram and full component list with sourcing notes
  • Tank and stand assembly guide with silicone-tubing routing notes
  • Calibration procedure: IR range potentiometer setting and level-threshold setup
  • Project report PDF (background, sensor theory, methodology, results discussion)
  • PPT presentation for final review
  • Viva Q&A preparation document (IR sensing, ultrasonics, GSM AT commands, power design)

Limitations & prerequisites

  • The SIM800L is a 2G-only module: the SMS alert needs a SIM on a network that still carries 2G, so confirm local 2G coverage — operators are phasing 2G out in some regions.
  • The GSM module must have its own 3.7–4.2 V rail with 2 A peak capability; powering it from the Arduino 5 V pin will reset or damage it, which is why the build uses a buck converter.
  • The IR sensor responds to ambient infrared: direct sunlight can cause false triggers, so the unit is intended for indoor use.
  • Sanitizer gel viscosity varies between brands, so the dispensed volume is set by time and is approximate — the buyer calibrates the dispense seconds against their own sanitizer.
  • Ultrasonic readings jitter on foamy or rippled surfaces; the firmware averages samples, but very small tanks give coarser level steps.
  • This is an academic prototype for demonstration, not a certified hygienic or medical device.

Frequently Asked Questions

Is this project suitable for a final-year project?

Yes — for Electronics & Telecommunication, Electrical and Computer programs. It combines proximity sensing, relay-driven actuation, ultrasonic level measurement, UART-based GSM messaging with real power-supply design constraints, and LCD interfacing in one build, with viva-friendly theory at every stage from IR reflection physics to AT-command SMS flow.

How does the low-refill SMS alert actually work?

The Arduino watches the HC-SR04 fill percentage; when it drops below the firmware threshold, the sketch sends text-mode AT commands (AT+CMGF=1, then AT+CMGS with the owner's number) to the SIM800L, which transmits the SMS over the 2G network. The alert fires once per empty event and re-arms only after a refill pushes the level back above the threshold.

Why can't the SIM800L be powered from the Arduino's 5 V pin?

The module's hardware design specifies 3.7–4.2 V with up to 2 A bursts during network transmission, and it has no onboard regulator. The Arduino's 5 V rail cannot safely deliver that current, and 5 V itself exceeds the module's maximum — so the build uses an LM2596 buck converter set to about 4.0 V with a 2 A peak capability.

Can I use liquid soap or a different sanitizer?

Yes — any free-flowing liquid works the same way. Thicker gels need a longer dispense time, so you recalibrate the seconds constant in firmware; if you switch liquids, rinse the pump and tubing first to avoid mixing residues.

Does it work outdoors?

Not reliably. The IR sensor's receiver is saturated by the infrared in direct sunlight, which causes constant false triggers — the build is intended for indoor corridors, labs and classrooms, where it is fully reliable. Shaded placement away from direct sun works.

How much sanitizer comes out per dispense, and can I change it?

The volume is set by the dispense-time constant (1–5 s in firmware, default about 2 s); the actual millilitres depend on the pump, tubing and gel viscosity, so you calibrate by dispensing a few shots into a measuring cup and adjusting the constant. A single dispense is typically a few millilitres (design target).

Components & software requirements
  • Arduino Nano (ATmega328P, Arduino framework)
  • FC-51 IR proximity sensor (LM393, adjustable 2–30 cm)
  • HC-SR04 ultrasonic sensor (TRIG/ECHO, 40 kHz)
  • SIM800L GSM module (quad-band 2G, AT commands, UART)
  • Mini submersible DC pump · 5 V relay driver module
  • 16x2 character LCD (I2C interface)
  • LM2596 buck converter (dedicated 4.0 V GSM rail)
  • Arduino IDE toolchain
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation