2 Light-Sensing Alarm Using the Analog Comparator and APM Module

The following use case was designed to highlight the capabilities of the APM as well as to showcase its configuration in MCC Melody. The Comparator (CMP) peripheral is used along with the APM to design a light-sensing alarm.

The Comparator’s input signals are provided by a POT 3 and AMBIENT Click boards. The Comparator’s output signal and a PWM signal are inputs to the Configurable Logic Cell (CLC) peripheral set up as an AND gate whose output drives a BUZZ Click board.

The user can set the light intensity threshold at which the speaker is driven with the help of the potentiometer. Once the ambient light intensity exceeds the value set by the potentiometer, the Comparator will output a logic ‘1’ signal and the speaker will be driven. The APM will switch the Comparator on and off based on the specified period and event timings.