Here's a link to an instruction sheet, for my IoT students, on how to interface an InfraRed (IR) detector to a WeMos D1 Mini..
Note: This exercise uses a WeMos D1 Mini, Node-RED and MQTT (mosquitto) and of course an IR detector.
The project grew into using a RPi-camera to FTP images to a server and a dashboard to display those images.
I hope you enjoy reading this as much as I enjoyed writing it.
Regards from David.