This sensor is essentially a reed switch encased in an abs plastic shell.
Raspberry pi wireless door sensor.
These raspberry pi sensors are addressed via the so called 1 wire bus.
Compatible with raspberry pi a b a b pi 2 pi 3 pi 4 and pi zero wh models.
The ds18b20 and ds18s20 represents a very simple sensor.
The other half is a magnet.
A check with infrared light barriers or other methods would certainly be possible but in this case that is much more complicated.
Entry sensor monitors your door window server cabinet or catflap.
In addition to a surveillance camera and motion sensors information about open windows and doors is also of interest to a self built surveillance system.
Gpio project kit for raspberry pi.
Because we use the thingsquare system and off the shelf hardware we do not need to do any.
Today we set up a door sensor that sends a notification to your phone when the door is opened no matter where in the world you are.
The door sensor has two wires connect 1 wire doesn t matter which to a free pin i chose pin 8 you need to refer to this pin in the code explicitly and the other to one of the ground gnd pins pin diagram here.
An advantage is that many different 1 wire components can be connected in series and read out by a single gpio.
Raspberry pi sends an email to your phone when door is opened or closed logs the event to a text file.
Sunfounder raspberry pi 3 model b 37 modules sensor kit v2 0 for rpi 4b 3 b 2b a zero raspberry pi board included 4 4 out of 5 stars 141 135 99 135.
When the magnet is less than 13mm 0 5 away the reed switch closes.
Hooking up the sensor.
Start up the raspberry pi and go to the desktop type.
Playing with a raspberry pi low voltage labs traffic lights and an adafruit door sensor.
Normally the reed is open no connection between the two wires.
As delivered the door sensor comes with bare wires we could solder these directly to the gpio pins on the pi but for a more re usable solution it s better to use the jumper wires one end of the.
However these modules can not measure additional information such as humidity and or air pressure.
They re often used to detect when a door or drawer is open which is why they have mounting tabs and screws.