Intruder Alarm – Josh Milkins & Suleyman Akbulut


Can we combine a touch and PIR motion sensor with multiple sensory outputs to create a functional, practical project.


Touch Sensor

The touch sensor has two outputs, an analogue output that is dependent on how strongly a touch is detected, or a digital output that will go high if touch is detected above a threshold set by the potentiometer.


transistor-current-explanationIt works by using a darlington transistor to allow a current to flow from the collector to the emitter when the small amount of current from your skin is applied to the base pin of transistor. Depending on how much current is applied to the base pin (how close your finger is) the amount of current allowed to flow through the transistor varies. If your finger has good contact with the base pin then the current allowed to flow increases and if the pin is not being touched then no current will flow.

There’s also an LED that indicates the status of the digital pin. If the threshold is met, the LED illuminates and as mentioned above, the threshold is set by the potentiometer. There is another LED that indicates power is being provided to the sensor.

PIR Motion Sensor

Using motion sensors and an Arduino you can trigger lights, fans, etc. This kind of sensor is known as the Passive Infrared Motion Detector or PIR. These sense the infrared radiation emitted by all objects above absolute zero. When something passes in front of a PIR sensor it detects the change in background temperature and then triggers an output voltage. This voltage can be read by an Arduino digital input and then the Arduino can act upon it.


Can we design and code a security system by combining our PIR and touch sensors to deter intruders by using sensory outputs.


Our intruder alarm consisted of a PIR sensor which was used to detect movement in a room, it also had a touch switch which could be used to reset the alarm once is had been tripped. When the alarm is tripped, LED’s flash and a buzzer is sounded to deter intruders from continuing.

This was the fritzing diagram which shows all of the components used;

fritzing combined

Photo Capture Alarm sys

And the code;


This worked surprisingly well although the motion sensor has a very wide detectable angle of 170 degrees and so it was hard to find position that didn’t trigger it. Taking the diffuser off meant that the chip was much more directional and wasn’t constantly triggered while testing the code.

We had a few problems with the code. In particular the debounce of the touch sensor as this was required to smooth out the signal coming from the touch sensor. It works by taking a certain times worth of 1’s and 0’s and converting them into either a High (1) or Low (0) this means that when touching the touch sensor, the arduino doesn’t think that it was being touched at the rate of which the arduino could keep up. When trying without the debouce the arduino simply cannot decipher what it need to do. We put in a 200ms debounce so that it works a lot more smoothly although the touch switch requires a fast touch otherwise the debounce time elapses and the problem continues.


Overall our circuit was fully functional along with our code. The code was simple but effective and demonstrated the purpose of the intended application, Next time we would use a touch keypad to set a passcode that is used to arm and unarm the system and  potentially an LCD that told the user what passcode was being entered and we could then have options for changing the passcode with hardware.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s