Introduction: Openhab MQTT PIR Motion Sensor
In this instructable I am going to show you how you can make your own Motion sensor for Openhab.
Step 1: Bill of Materials
for this project you are going to need:
- 1X3 female header
- 1X3 male header
- 3 colors of wire you can use servo extensions if you want
- 1 10K resistor
- Arduino uno or mega
- 3d printed parts.
Step 2: PIR Assembly
1. Solder the header to the wire shown in the picture.
2. Add a 10K resistor between GND and the Signal.
3. Put the sensor in the case
4. Mout the back plate to the wall.
5. Add mount the housing on the back plate with a 3M bolt and screw.
Step 3: Connections to the Microcontroller.
1. Connect the 5V to the 5V on the microcontroller.
2. Connect the GND to the GND on the microcontroller.
3. Connect the signal wire to A0 on the microcontroller.
Step 4: Assembly of the Arduino
1. Put the ethernet shield on the arduino.
2. Connect the Ethernet-cable to the arduino.
3. Power the arduino.
Step 5: Code
1. Download and install the library's for the sketch.
2. Put the library in the library folder of your Arduino-IDE.
3. Change the server IP to YOUR openhab server IP.
4. Change the topic to a topic that you want.
5. Upload the Code to the arduino.
Step 6: Trouble Shooting
- Case: The arduino won't connect to the server.
- Check that the ethernet cable is plugged in.
- Is the pin 13 led burning?
- check the server IP in the code.
- Is the Item config Correct?
- Is the mqtt topic correct in the code?
- Is there a mqtt server?
- Is the sensor plugged into the right connector?
- Is there power going to the sensor?
- Is the sensor calibrated right?
Step 7: The End
This was my first instructables feel free to leave feedback on it.
If there are any questions feel free to ask them.