Let’s Fight COVID-19 with Electronics
By Hesam Moshiri, Anson Bao
As we all know, the COVID-19 pandemic significantly impacted our daily lives. In this context, alcohol and hand sanitizers have become essential, but they must be used properly. Touching alcohol containers or hand sanitizers with contaminated hands can spread the virus. In this article, we will design an automatic hand sanitizer dispenser using IR sensors to detect the presence of a hand and activate a pump to dispense the liquid. The goal is to create an affordable and simple solution, so no microcontroller or Arduino is involved. Two design options are provided, and you are free to choose and build either one. The first design uses SMD components, while the second design is even simpler, using DIP components on a single-layer PCB.
I. First Design:
[A] Circuit Analysis
Refer to the schematic diagram in Figure 1. The P1 connector is used to supply 6V to 12V to the circuit. The C6 capacitor helps reduce any potential supply noise. The REG-1 is the well-known AMS1117 LDO regulator, which stabilizes the voltage at 5V.
Figure 1: Schematic diagram of the automatic hand sanitizer dispenser (First Design)
D2 indicates the proper power connection, and R5 limits the LED current. D1 is the IR transmitter diode, and R1 limits the current flowing through it, thereby determining the sensor’s sensitivity. U1 is the widely used 555 timer IC, configured to emit a 38kHz pulse to the D1 diode. You can adjust the frequency by turning the R4 potentiometer. C1 and C2 are used to minimize noise.
U2 is the TSOP1738 IR receiver. According to the TSOP17XX datasheet: “The TSOP17XX series are miniaturized receivers for infrared remote control systems. The PIN diode and preamplifier are assembled on the lead frame, and the epoxy package acts as an IR filter. The demodulated output signal can be directly decoded by a microprocessor. The TSOP17XX series supports all major transmission codes.”
The TSOP1738 provides an active-low output, meaning the output pin of U2 goes low when exposed to 38kHz IR light. As a result, a P-Channel NDS356 MOSFET is used to drive the DC motor (liquid pump). D4 protects against reverse current from the motor, and C8 reduces inductive noise from the motor. D3 is an LED indicator for IR reception and pump activation. C4 and C5 are used to filter supply noise.
[B] PCB Layout
Figure 2 shows the PCB layout. As seen, all components except the IR transmitter diode and the TSOP IR receiver are SMD components.
Figure 2: PCB layout of the automatic hand sanitizer dispenser (First Design)
I used the SamacSys component libraries (Schematic Symbols and PCB Footprints) for the AMS1117-5.0, LM555, TSOP1738, and NDS536AP components. These libraries are free and comply with IPC footprint standards, which helps significantly reduce design time and minimize errors. To install the libraries, you can either use a CAD plugin or download them from the component-search-engine. I used Altium Designer and preferred the Altium plugin.
Figure 3: SamacSys CAD plugin and components used in the Altium Designer plugin
Figures 4 and 5 show 3D views of the top and bottom of the PCB board.
Figure 4: Top 3D view of the PCB board
Figure 5: Bottom 3D view of the PCB board
[C] Assembly and Testing
The assembly process is straightforward. All components, except the TR and RE sensors, are SMD. For rapid testing, I used a semi-homemade PCB board without solder masks and silkscreens. A professionally fabricated PCB board would make the task even easier! Figure 6 shows the prototype.
Figure 6: Prototype of the hand sanitizer dispenser (First Design) on a semi-homemade PCB board
After assembly, adjust R1 and R4 to optimize the detection range. R1 controls the IR power (range), and R4 adjusts the transmission frequency.
[D] Bill of Materials
II. Second Design
[A] Circuit Analysis
Figure 7 shows the schematic diagram of the device. The P3 connector is used to connect the +5V supply to the circuit. Capacitors C4 and C5 are used to reduce input supply noise. IC1 is the core component of the circuit, the well-known LM393 comparator [10].
Figure 7: Schematic diagram of the automatic hand sanitizer dispenser (Second Design)
According to the LM393 datasheet: “The LM393 series are dual independent precision voltage comparators capable of single or split supply operation. These devices are designed to permit a common mode range down to ground level with single-supply operation. Input offset voltage specifications as low as 2.0 mV make this device an excellent choice for consumer, automotive, and industrial electronics.”
The LM393 is an affordable and versatile IC. For applications requiring a comparator, I recommend using dedicated comparator chips instead of operational amplifiers. In this design, we use the first comparator of the LM393 chip, and the R3 potentiometer sets the activation threshold. Capacitor C2 helps reduce noise on the middle pin of the potentiometer. Diode D1 is an IR transmitter, and D2 is an IR receiver diode. D2 is connected to the negative pin (-) of the comparator, while the positive pin (+) voltage is compared with it. The output pin of the comparator is active-low, but it is advisable to pull it high using resistor R4.
Transistor Q1 is the BD140 PNP transistor [11], which drives the pump (DC motor) and the D3 LED. D4 is a reverse protection diode, and C3 reduces the inductive noise from the pump to maintain circuit stability. Finally, P1 is used to connect a blue 5mm LED to indicate a proper power connection.
[B] PCB Layout
Figure 8 shows the PCB layout for the second design. It is a single-layer PCB with all components in DIP form, making it simple for anyone to assemble this DIY project at home.
Figure 8: PCB layout of the automatic hand sanitizer dispenser (Second Design)
As with the first design, I used SamacSys component libraries (Schematic Symbols and PCB Footprints) for the LM393 [12] and BD140 [13]. These free libraries follow IPC footprint standards. You can install them via a CAD plugin [9] (see Figure 9) or download them from the component search engine. Using these libraries significantly reduces design time and minimizes errors. I used Altium Designer CAD software, so I opted to install the Altium plugin.
Figure 9: SamacSys supported CAD plugins and components used in Altium Designer
Figure 10 shows a 3D view of the assembled PCB board.
Figure 10: 3D view of the assembled PCB board (top)
[C] Assembly and Test
Figure 11 shows the assembled PCB board. This is a semi-homemade PCB used for quick concept testing. You can order it for fabrication. Soldering is straightforward, as all components are in DIP form, making it easy to assemble. This design is simpler and even more cost-effective than the first design, so I proceeded with it to complete the hand sanitizer dispenser device.
Figure 11: Prototype of the sanitizer dispenser (Second Design) on a semi-homemade PCB board
Figure 12 shows the selected liquid pump. Although it is likely the cheapest available, I am satisfied with its performance.
Figure 12: Selected liquid pump to dispense the hand sanitizer liquid
Finally, Figure 13 shows the complete hand sanitizer dispenser. You can use any similar glass or plastic container, such as a plastic coffee storage container. I selected a glass sauce container. I used simple copper wire to bend and hold the hose in place. Adjust the R3 potentiometer from the lowest sensitivity level and gradually increase it to achieve your desired detection range. Do not set it to too high a sensitivity, as the pump might activate spontaneously without a trigger.
Figure 13: Complete DIY hand sanitizer dispenser
Figure 14 shows the dispenser in the dark. The light from the blue LED (P1) provides an attractive glow, which should be mounted on the container lid.
Figure 14: Hand sanitizer dispenser view in the dark
[D] Bill of Materials
References
- [1]: AMS1117-5.0 Datasheet: http://www.advanced-monolithic.com/pdf/ds1117.pdf
- [2]: LM555 Datasheet: http://www.ti.com/lit/ds/symlink/lm555.pdf?&ts=1589508422474
- [3]: TSOP1738 Datasheet: https://eu.mouser.com/datasheet/2/427/introductionpartnumbers-1766653.pdf
- [4]: NDS356 Datasheet: https://eu.mouser.com/datasheet/2/308/NDS356AP-D-1813031.pdf
- [5]: AMS1117-5.0 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=2376678
- [6]: LM555 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=380204
- [7]: TSOP1738 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=1116997
- [8]: NDS356 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=840198
- [9]: CAD Plugins: https://www.samacsys.com/library-loader-help
- [10]: LM393 Datasheet: http://www.ti.com/lit/ds/symlink/lm393-n.pdf?&ts=1589509317025
- [11]: BD140 Datasheet: https://www.mouser.com/datasheet/2/149/BD140-888626.pdf
- [12]: LM393 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=298790
- [13]: BD140 Schematic Symbol and PCB Footprint: https://componentsearchengine.com/part.php?partID=166782
If you have any questions regarding PCB and PCBA, please feel free to contact me at info@wellcircuits.com.