In this project, I worked with a partner to create an alarm system from a TI MSP432r, a ultrasonic short range sensor, a PIR for long range, as well as an AdaFruit Bluetooth BLE to interface with the ultrasonic and, finally, a Launchpad for the TI board. The goal was to create an elaborate alarm system that could be armed/disarmed with bluetooth, and was adaptive to detect motion from two directions, both long and short range (hence the L and R in aLaRm).
The implementation, although very extensive, is not entirely sophisticated in most respects. I am going to break the implementation into subsections below based on each of our major components:
The BreadBoard is used to house our RIGHT DETECTION SYSTEM. In this system we have an ultrasonic sensor, which is able to emit sound waves and, upon reception, detect how far away an object is. Since it is reliable in close range, we used it as a close range detector for our “Right” side sensor. We power the sensor from the 5V set pins on our TI MSP, and have the Trigger (start reading) and Echo (get result) pins each hooked up to our AdaFruit BLE module. The AdaFruit BLE Feather module is used to connect our phone wirelessly to the right side BreadBoard. We can power the sensor on or off by sending a ‘start’ or ‘stop’ string over Bluetooth using our phone. Along with this, the Bluetooth reads in the data from the sensor, and for our demonstration, if we have a distance of less than 5 inches the Adafruit sets a GPIO high which attaches to our TI board to trigger a response.
The left side of our system was far less complicated than our right side. We implemented a simple PIR sensor to interface with our TI. Given that the PIR emits a digital HIGH when triggered, we were able to directly take GPIO interrupts off of this sensor for proper interrupt response. Along with this, we found the PIR to be relatively insensitive. Since it activates off of Infrared light, it has a built in delay, but excellent range. Thus, this “Left” side of our board was our long distance alarm.
The TI was the most crucial system in our design. It was the central interface to each of the rest of our systems. Mainly, the TI had two major interrupts; one from the HIGH generated by the right BlueFruit when triggered by the short distance sensor, and another from the left PIR digital output. Each of these interrupts caused an alarm to be emitted that was a simple TimerA OUTMOD_4 square wave implementation. We also incorporated the Launchpad, which triggered a green LED in the right side interrupt, and a blue LED on the left side interrupt. On top of this, we also included graphics which printed our the “aLaRm” brand and whether or not we were “Safe!” (no intruders detected) or whether the right or left sensors were triggered last. It should be noted that we color coded the text blue for left and green for right as well. Also, since we gave the option for the right sensor to be turned off remotely from our phone, we also included an option to disable the PIR interrupt by clicking the 5.1 button. This was a simple state machine that determined whether to en/disable the interrupt from the PIR.