Analog Devices Develops Smoke Detector Reference Design for Reducing Nuisance Alarms
“We generated code from our algorithms for an Analog Devices microcontroller, but our customers can customize the algorithms in MATLAB and then target whatever production microcontroller they choose with Embedded Coder. That flexibility is a big advantage for them and for us.”
Challenge
Create a smoke detector reference design that reduces nuisance alarms and meets recently established industry standards
Solution
Use MATLAB to analyze sensor data and to design, test, and implement embedded algorithms
Results
- Months of development time saved
- Parameter tuning time cut from hours to minutes
- Certification tests passed on first attempt
About 20% of all US homes have at least one smoke detector that is non-operational—often because the owner has disabled the device to prevent nuisance alarms. To address this issue, Underwriter Laboratories (UL) has created standards that require smoke alarms and smoke detectors to differentiate between various sources of smoke, such as food on the stove and burning cloth.
Analog Devices has developed a smoke detector reference design, based on the company’s ADPD188BI particulate sensor, that enables its customers to accelerate the design and certification of smoke detector hardware and software. Analog Devices engineers developed, optimized, and tested the design's advanced detection algorithms in MATLAB® before generating embedded code for implementation on a microcontroller.
“Our work spans a variety of environments and languages, and we need to navigate them seamlessly,” says Travis Collins, development engineer at Analog Devices. “The ability to move easily between MATLAB, C code, and an embedded target simplifies our workflow and accelerates development.”
Challenge
In UL lab tests for the updated standard, smoke detectors must distinguish between different smoke profiles. In one test, for example, the device must not issue an alarm when it detects smoke from an overcooked hamburger patty, but must do so minutes later when it detects smoke from flaming polyurethane foam.
To develop algorithms capable of meeting these requirements, the Analog Devices team needed to analyze gigabytes of sensor data collected during tests at UL. They then needed to develop and tune detection algorithms that would be power-efficient when deployed to a microcontroller. The team needed certify the complete reference design in time for manufacturers to comply with the new standard before or soon after it went into effect.
Solution
Analog Devices engineers used MATLAB to analyze sensor data, develop and refine algorithms, and generate embedded code for a smoke detector reference design that complies with the latest UL standards.
The team collected more than 48 gigabytes of sensor data during tests at the UL labs and analyzed it using MATLAB tall arrays. They used statistical functions to correlate sensor readings with smoke obscuration measurements, which quantify smoke concentration as a function of the smoke’s reduction of light intensity.
The team then developed algorithms that performed window averaging, detrending (by detecting small changes in the mean of time-series values), and adaptive thresholding.
The engineers performed parameter sweeps to tune the thresholds and other algorithm parameters and find values that maximized the sensitivity and specificity of the overall system. To accelerate this process, they ran the sweeps in parallel on a 36-core machine using Parallel Computing Toolbox™.
The team generated C code from the algorithms with MATLAB Coder™ and Embedded Coder® and deployed it to an Analog Devices® ADuCM3029 microcontroller. They used the MATLAB Unit Testing Framework to author and run unit tests to verify the MATLAB algorithms and the generated code. They later integrated this test suite into a Jenkins™-based continuous integration workflow that automatically tests the MATLAB algorithms, generates code, tests the generated code, and packages the entire reference design for delivery to the customer.
The reference design has passed UL 217 8th Edition tests at certified test labs, and Analog Devices now offers the reference design, including the MATLAB code and unit test suite, as a product.
Results
- Months of development time saved. “If we had developed the reference design in a language other than MATLAB, it would have taken us at least three more months to complete,” says Collins. “More importantly, MATLAB enabled us to deliver a cohesive product that included MATLAB algorithms, a testing framework, and an embedded implementation optimized for code size, power consumption, and processing complexity.”
- Parameter tuning time cut from hours to minutes. “The sweeps that we ran to tune parameter values initially took 22 hours,” says Collins. “Parallel Computing Toolbox helped us reduce that time to 25 minutes on a multicore processor. That meant we could fine-tune our algorithms in a matter of minutes instead of almost a full day.”
- Certification tests passed on first attempt. “Testing time at the UL lab is limited, so you have to make sure you’re well-prepared,” notes Collins. “We thoroughly tested our algorithms in MATLAB beforehand, and that enabled us to pass all UL tests on the first attempt, with no changes to our algorithms or hardware.”