Skip to main content
Version: ACS CC

Smoke Detector

A smart smoke detector with visual, auditory, and remote alerting capabilities.

info

Author: Ureche Andreea-Maria

GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-urecheandreea

Description

This project consists of building a smoke detector using a Raspberry Pi Pico 2W. The device detects the presence of smoke and notifies the user via email. A visual indicator (LED strip), a buzzer, and a fan are also included to provide immediate feedback and ventilation. The alarm can be turned off by entering a verification code received through email on a keyboard module.

Motivation

The project was chosen to address the need for affordable, customizable, and connected safety systems for smoke detection. It aims to provide a cost-effective, open-source alternative that not only detects smoke but also alerts users in real time via email, allowing for faster reaction in emergency situations. From a learning perspective, this project also provides an opportunity for me to lear and deepen my understanding of embedded systems and to gain practical experience with Rust programming in a real-world context. Overall, this is both a learning journey and a way to build something useful.

Architecture

The architecture consists of the following main components:

  • Sensor Module: Smoke detection using MH-MQ sensor.
  • Microcontroller: Raspberry Pi Pico 2W acts as the main controller.
  • Network Stack: Provides email notifications via SMTP over WiFi.
  • User Interface: Keyboard module for disabling the alarm with code verification.
  • Feedback Systems:
    • LED strip for smoke level indication.
    • Buzzer for audible alert.
    • DC Motor with fan for smoke evacuation.
    • LCD to provide an interface for displaying information.

Architecture Diagram

Log

WeekActivity
Week 5 - 11 MayFinished the project documentation and started working on the initial wiring as well as some part of the software.
Week 12 - 18 May
Week 19 - 25 May

Hardware

The smoke detector system is built around the Raspberry Pi Pico 2W, a Wi-Fi enabled microcontroller that serves as the core of the project. To detect the presence of smoke, the project uses an MH MQ-type gas sensor, which provides analog readings corresponding to the level of smoke in the air. These readings are processed by the Pico through its ADC (analog-to-digital converter), and if a dangerous threshold is crossed, an alert is initiated. As part of the feedback mechanism, the system includes a WS2812 RGB LED Bar, which visually indicates the current smoke level using different color patterns. Additionally, a 5V buzzer is used to provide a loud audio alert when smoke is detected. It is connected via a PWM-capable GPIO pin for tone control. For active smoke evacuation, a small DC motor with propeller (fan) is activated during high smoke levels. User interaction is facilitated by a keyboard module, which allows users to input a verification code received by email to stop the alert. A 1602 LCD is also included in the system to display useful information such as system status, sensor readings or the code provided.

Schematics

Bill Of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
MQ-4 Gas SensorSmoke detection10 RON
DC Motor with Propeller FanSmoke evacuation8 RON
Keyboard ModuleUser input (code entry)19 RON
WS2812 RGB LED BarVisual feedback7 RON
1602 LCDInformation display17 RON
Passive BuzzerAudio alert1.40 RON
Breadboard & WiresBoard22 RON

Software

LibraryDescriptionUsage
embassy-netNetworking stack on top of EmbassyWi-Fi setup, TCP/IP sockets, DNS, SMTP transport
embassy-rpRP2040 PeripheralsGPIO, ADC, PWM, PIO, I²C on RP2040
embedded-halStandard traits for embedded hardware abstractionAbstract ADC, GPIO, SPI, I²C in drivers
ag-lcdDisplay LibraryWrite to LCD display
lettreHigh-level email library for RustCompose and send email notifications
heaplessFixed-size data structures without dynamic allocationBuffers for messages, queues, and heapless strings
defmtLogging framework optimized for embedded RustCompact, efficient logs over UART for debugging
probe-rsFlashing and debugging tools for ARM microcontrollersFlash firmware, debug live over SWD
embassy-timeTime LibraryTimers and delays