This tutorial will take sensors, add central monitoring code, and output alarm events to an annunciation system (another computer connected via Bluetooth). Several configurations will be shown to allow you to configure your own alarm system.

The Trinket has the capability to design an excellent alarm at a price point much lower than other alarm platforms. There are 5 general use pins, three of which may be digital or analog. At a minimum, you would need one sensor (or sensor branch) in, and one annunciation path out. That uses two of our five pins, thus you can have an annunciator that uses up to 4 pins or several sensor branches and more modest annunciator.

We will use a generic monitored area in the presented design. A single area alarmed and annunciated either locally or to a remote site. You can use the technique to wire multiple rooms (doors, windows, movement) but there are limitations to the number of sensors if you want to know the exact sensor number. If you only need to know "something" happened in a sensor chain, a nearly unlimited number of sensors may be used.

A typical scenario is monitoring a place like a room or a garage. The garage has a main garage door, a side door and the space within the room (a regular room would substitute a window for the garage door). To cover the area well, a magnetic contact will be placed on each of the areas that can open/close plus a volumetric (area) sensor in case one of the other sensors fails or someone breaks in without tripping a magnetic contact. You can always go to extremes covering an area but it only costs resources (money and processor pins) without providing much more security.
This design will use one analog sensor branch per the design diagram. The Infrared sensor and the magnetic contacts will be wired together into an analog ladder per alarm basics. These will be transmitted via Bluetooth to a monitor room inside the house. A good design has the monitor away from the area to not allow the intruder to disable the alarm easily.

This leaves many pins for additional sensors or other annunciation.

Annunciation Selections

Again there are many ways to alert you if the alarm has tripped. Some of my favorite ways:

1) Speaker: the simplest method is to use a loud noise. The piezo speaker does this well - you can output several tones or just an ear piercing tone. You can use an audio amplifier to make a louder sound. You will need to match the wattage of your speaker to that of the amplifier. Between the Trinket and amplifier ensure you do not input too much power or voltage.

2) Display: if you leave Pins #0 and #2 (the I2C pins) free, a character display with backpack could display the status. You may also use an LED as a simple indicator. The Trinket Pin 1 built-in LED is perfect for this although Neopixels or other LEDs could also be used.

3) Communication: My favorite - leverage the power of your home network to get a signal out. Trinket does not have enough memory to use a Wifi shield directly. But a serial link like new Bluefruit-EZ -Link or an FTDI Friend can be sent to another computer to get the word out - leverage your cloud to spread the alarm message.

or The Combination: If the infrared sensor and all the magnetic switches are on a combined branch on an analog input, then multiple annunciation methods could be available.

The final project built uses the Pin 1 LED and a Bluefruit.

This guide was first published on Dec 31, 2013. It was last updated on Dec 31, 2013.

This page (Design) was last updated on Nov 24, 2013.

Text editor powered by tinymce.