YouTube: https://youtu.be/OJgx_jHHoqU (https://youtu.be/OJgx_jHHoqU)
- High stability and no sensitivity to the ambient light
- Laser-cut acrylic (plexiglass) enclosure
- Flow control capability of the hand-sanitizer/alcohol (efficiency)
- Through-hole components (easy to solder)
- Single-layer PCB board (easy to fabricate)
- Single and cheap ATTiny13 microcontroller
- Low standby current consumption
As we all know, the COVID-19 outbreak hit the world and changed our lifestyle. In this condition, alcohol and hand sanitizers are vital, expensive, and in some areas hard to find fluids, so, they must be used properly and efficiently. In the second version of the hand sanitizer dispenser device, I have addressed the previous design problems and introduces a device with no sensitivity to the ambient light and flow control capability of the alcohol/sanitizer. Therefore just enough amount of liquid will be poured on each request. The design uses a cheap ATTiny13 microcontroller.
Source: https://www.pcbway.com/blog/technology/Automatic_Hand_Sanitizer_Dispenser__Version_2___Using_ATTiny13.html (https://www.pcbway.com/blog/technology/Automatic_Hand_Sanitizer_Dispenser__Version_2___Using_ATTiny13.html)
: TSOP1738 datasheet: https://www.batronix.com/pdf/tsop17xx.pdf (https://www.batronix.com/pdf/tsop17xx.pdf)
: 2N7000 datasheet: https://www.onsemi.com/pub/Collateral/NDS7002A-D.PDF (https://www.onsemi.com/pub/Collateral/NDS7002A-D.PDF)
: ATTiny13 datasheet: https://componentsearchengine.com/Datasheets/1/ATtiny13-20PU.pdf (https://componentsearchengine.com/Datasheets/1/ATtiny13-20PU.pdf)
: BD139 datasheet: https://www.st.com/resource/en/datasheet/bd140.pdf (https://www.st.com/resource/en/datasheet/bd140.pdf)
: 2N7000 schematic symbol and PCB footprint: https://componentsearchengine.com/part/1011182/model/download (https://componentsearchengine.com/part/1011182/model/download)
: BD139 schematic symbol and PCB footprint: https://componentsearchengine.com/part/1041398/model/download (https://componentsearchengine.com/part/1041398/model/download)
: ATTiny13 schematic symbol and PCB footprint: https://componentsearchengine.com/part/235118299/model/download (https://componentsearchengine.com/part/235118299/model/download)
: CAD Plugins: https://www.samacsys.com/library-loader-help (https://www.samacsys.com/library-loader-help)
I don't see why you're using a 2N7000. An Attiny pin is able to drive the IR LED/resistor directly.
A TSOP receiver is meant for interrupted IR signals, like remote controls.
Are you driving the IR LED with interrupted 38kHz?
AFAIK TSSP (not TSOP) receivers are better suited for constant 38kHz.
150-220ohm for the LED (~20mA) seems a lot of power for a few centimetres distance.
You could easily bridge 5 metres with that.
R4 is not needed. All TSOP/TSSP receivers have built-in pull up (~33k).