A design for a wall switch insert accommodating an HC-SR501 type motion sensor and a DHT22 temperature/humidity sensor for a DIY IoT/smart device project.
This custom insert replaces the standard wall switch in my bathroom, enabling automated light control based on motion and fan activation in response to humidity levels. The sensors link to a Wemos D1 Mini microcontroller, powered by an AC to DC adapter connected to the mains voltage, housed in a compact project box behind the switch plate.
Caution: This project involves working with mains electricity. Always disconnect power at the breaker before starting. I am not liable for any injuries or damages from replicating this setup.