This is an example on how to wire up a door sensor and activate a piezo alarm. When the door is opened, an LED will light up and a tone will play. Using WebHooks, you could record this data into a database or send a text message with the Twilio API.
- Large Piezo Alarm $2.95
- Photon Core $19.00
- Breadboard $4.95
- Door Sensor Recessed or Surface Mount $10.00
- Green or Red LED $1
- Misc wires and resistor $2
Total Project Cost: ~$39.90 + tax & shipping costs
For the complete schematic, open the door-sensor-alarm.fzz file in Fritzing.
See the door-sensor-alarm.ino file.
You could optionally create a WebHook that makes an API request when the door is open. This would allow you to record each open and close event.