AM312 + ESP8266 Motion Sensor
thingiverse
This is a tiny box for the AM312 PIR Motion Sensor and an ESP8266. Be aware, that only the smallest version of the ESP8266, the ESP-01 will fit in there, as the box only measures 2 x 2 x 3.5 cm. By default, the AM312 sensor will be constantly triggered from the ESP8266's wifi signals (cause it's so near to the wifi antenna) and the voltage drops that occur when the wifi is active. To mitigate this, solder a 10µF and a 0.1µF capacitor directly between the Vcc and ground pin of the sensor. The middle pin of the sensor has to be connected to GPIO1 of the ESP8266, as this seems to be the only pin that can be configured as a default low input pin. To mitigate the effects that the wifi signals have on the pir sensor, wrap the ESP8266 in electrical tape, then on its backside add a sheet of aluminium foil and solder it to ground and then add another layer of electrical tape. This shield against wifi signals and the two capacitors are definitively needed for the AM312 sensor to not have any false positives. I added a picture so you can see what i meant. You will need some soldering skills for that and please don't judge too much about my soldering skills cause i went through much troubleshooting. For assembly, just make sure you have soldered the parts as shown in the screenshot, then put the power cable through the hole in the lid, remove the white cap from the pir sensor, insert it into the box and attach the white cap. The lid should just snap on, but for a better fit just glue it in place. On a side node, i connected the power cable the wrong way because the one with the white line is usually ground, not 3,3V. You can use any 3,3V power supply which has at least 1W. For the software, i flashed [tasmota](https://tasmota.github.io/docs/Getting-Started/). Set the pin GPIO1 to Switch1n via the web interface. Then just add your mqtt credentials in there and maybe execute 'SetOption 19 1' if you're using [home assistant](https://www.home-assistant.io).
With this file you will be able to print AM312 + ESP8266 Motion Sensor with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on AM312 + ESP8266 Motion Sensor.