Often the 'status' of a door, window, gate or other needs to be remotely monitored.
Digital Matter devices that have digital inputs can be paired with a reed switch to monitor and alert upon whether a door is open or closed.
This will work for the following products
Dart/Dart2, G60/G62, G100/G120, G200, G62 LoRaWAN, SensorData, SensorNode (LoRaWAN + Bluetooth Versions), Falcon Cellular
There are several key components to the set up and operation of such a solution which are discussed in this article,
- The Reed Switch
- Device Digital Inputs and their set up
- Set up in Telematics Guru.
The Reed Switch
What is a reed switch?
The reed switch is an electrical switch operated by a magnetic field.
In it's most basic form, the switch consists of a flexible ferromagnetic metal contacts inside a sealed glass tube. When a magnet is brought close to the 'reeds', the reeds move so that they come into contact, closing the switch. You can often hear a slight click sound when this happens if you hold the switch to your ear.
The switch shown at 1:30 is a common form of switch that would be used, Single Pole Double Throw (SPDT) with a Normally Open (NO), and Normally Close (NC) contact.
"Normally" refers to when the switch is not affected by a magnetic field (no magnets nearby)
Here is an example:
The principle of operation is the same for all reed switches, though they come in different mount options/casings etc, and at varying costs. The one pictured is built for a garage roller door, and fits into the corrugations easily.
The 3 screw terminals are the Common, NO and NC contacts.
There is more than 1 way to set up a reed switch and the device to achieve the same result. As long as when the door is open/closed, the magnet moves near/away from the switch, causing the state of the switch to change, we can monitor it.
In this example we will consider the following:
- Door closed - magnet is in contact with the reed switch. We want the device digital input to be off/'0' in this scenario
- Door open - magnet is away from switch
*The opposite (i.e. door is closed and the magnet is not in contact with the switch, and vice versa) can also be catered for but we will not discuss it here. The physical requirements of the application might dictate this is needed. Contact DM support if you are unsure.
It is important that we can detect if there is a break in the cable (due to damage, or someone cutting it). So operation will be as follows
Normally Open (NO) on reed switch connected to Digital input on device, Common connected to Ground on device. When the door is closed, the magnet is close to the switch. This is not the 'normal' position for the switch, so it is closed.
This is illustrated in Figure 1 below
Then when the door opens the magnet moves away and the switch is in the 'normal' position - so it is open, and we want to detect this as 'on' for our device input.
This is illustrated in Figure 2 above.
Note how this breaks the circuit to register a door open. So similarly, if the cables were cut/damaged - 'open' would also be registered. The door might not actually be open but this helps in detecting tampering/faults.
The Digital Input which the reed switch was connected to needs to be set up.
Below is the configuration for a cellular device, the equivalent configuration for LoRaWAN devices can be achieved using the configuration tool.
The shown settings are from a Falcon Cellular - however the Digital Input parameters are generally identical for all devices with Digital Inputs. All are defaults for the Falcon besides those highlighted.
Bias Resistor and Active Level.
We must set the Bias Resistor to 'hold' the state of the input either high or low when nothing is connected, otherwise the state is undefined.
Pull-up and High means the behaviour will be:
- Door closed, magnet near switch, as in Figure 1
- There is a path to ground and the input is "low", so registers a '0' (since the active level is High', low means not active)
- Door open, Figure 2 applies
- There is no path, so now nothing is connected to the Device Digital Input. The bias resistor pulls the line high, which is logged as active '1' on the device.
Upload on Active and Inactive
We will get an immediate notification sent to the server if the door opens/closes.
Set up in Telematics Guru
To display in Telematics Guru, do the following:
Set up the I/O Mapping
Setting up the I/O mapping simply gives a meaningful name to the digital input. The previous step ensures that data will be sent to TG when the door opens or closes, but now we need to put it in an easily readable format.
- Go to Assets -> Manage Assets
- Click the Asset Name you want to edit (or do this when creating your asset)
- Go to I/O Mappings
- Create the Mapping
The active state (1) is Open, and inactive (0) is closed (as per OEM set-up)
Display on Trip view results in the status being available on the map
Alerts in Telematics Guru
To send alerts via Telematics Guru, we simply need to set up an alert that is sent when the Digital Input is activated.
This can be done using the "Advanced" Alert creator, found under Admin -> Alerts
If the relevant asset is selected in the "Assets" Tab of Create Alert, the name given in the I/O mapping will appear as shown in the image.
An alert can also be sent when the door closes again, so the user is notified when everything is back to 'normal' Under the Advanced tab of the alert setup, simply select this option and fill in the message you would like.
Alternatively, the Panic/Duress Button Alert from the Alert Wizard can be used - just use the Digital Input you are using with the reed switch, and a more accurate name at the end of the set up.
Reporting on Door Being Left Open
It may not be of much interest if the door is simply opened or closed, but important if it remains open. The "Duration" condition of the Alert setup can be used
The above issue shows set up for an alert to fire if the door remains open for over 10 minutes.
However for this scenario it is important that "Upload on Inactive" is selected in OEM so we know immediately when the door is closed again.
There are also some caveats to this set-up which are discussed here Duration Condition for Alerts
Reporting on Door Open/Close
To run a report on the times and duration the door was opened, we can set up a Custom Event. An Alert is the email/SMS sent due to a condition occuring, and an Event can be thought of the way this is recorded for later reporting, via the Event Reports.
To set up an event, go to Admin -> Event Types
We want to log on the Start and End of Event, so the time that the duration the door was left open for can be monitored. In this scenario the other logging is not relevant - e.g. Distance, Geofence etc. However if it was door on a truck etc that moves, Distance may be relevant, it depends on the application.
Now we can return to the Asset's I/O mappings and link Digital Input 1 to the Event
A record of door opens/closes will be available in the Custom Events - Summary, and Custom Events - Detail Reports