The first phase of testing for the project consisted only of the A3BU, the LED and the piezo-buzzer, and the IR distance sensor. There was no password interface or mechanism for disarming the alarm, except for removing the power to the A3BU. This first iteration of the project can be seen in Figure 1 below.
The infrared distance sensor works using two beams of infrared light with effective measurement ranges of 4 cm to 1 m. If either of the beams is interrupted by a solid object, the distance sensor will transmit a voltage signal back to the A3BU – 3.3 V for 4 cm distance and 0.4 V for the maximum measureable distance. Once this voltage signal is received by the A3BU, it uses an Analog to Digital Conversion (ADC) input to translate the signal into an 8-bit pattern (0 to 127 decimal) that can be translated using a linear regression into a physical distance interpretation.
Based on conditional logic in the programming (see “Source Code”), the LED and piezo-buzzer react differently at different bit patterns. For example, once the bit pattern reaches 70, the LED begins to flash at 50% duty cycle (1 kHz) as a warning that the system is armed. The LED and piezo-buzzer were powered from the A3BU and received a Pulse Width Modulated (PWM) signal at 1 kHz and varying duty cycles, based on the bit pattern received post-ADC from the IR distance sensor.
The second and final iteration of the prototype included password prompts from the A3BU, entered using SW1 and SW2 buttons native to the microcontroller. It also included an emergency switch to remove power from the piezo-buzzer in the instance of a false trip during our demo. This final product is depicted in Figure 2 below.
Once the bit pattern reached 100, the user would be prompted for a password on the LCD screen. If the password given was incorrect, the buzzer would sound in a “breathing” duty cycle pattern, similar to that used in Lab 4. If the correct password was given, then the logic was interrupted and the system went back to its pre-alert state. If the alarm was tripped, the user could press SW1 to deactivate the system, in the instance of a false trip. The emergency switch was also an option, but was only used to interrupt the piezo-buzzer. An example of the password prompt is shown in Figure 3.
The basic schematic form of the circuits are shown in the “Schematics (Hardware)” section of this report. The schematic was drawn using Microsoft Visio.