A miniature automatic door closer can be created using an Arduino Uno by utilizing optocouplers such as A10026 sensors.
The kit includes an optical beam sensor with digital and analog output that can be connected to any microcontroller. It operates on 3.3V to 5VDC and provides a HIGH voltage output when the beam is blocked.
The microcontroller can interpret the 0-5-0V pulse train to detect an obstacle blocking the sensor. The module features LEDs for power and digital output indicators.
A motor servo actuator can be controlled by the Arduino to move and close the door based on programming requirements. It has the capability to move 90 degrees to the left or right.