
Over the past few years, smoking prevalence among adults in India fell from 14.0% (2009-2010) to 10.7% (2016-2017), thanks to public smoking bans, advertising its harms, and higher taxation. Despite this, tobacco use remains high—particularly smokeless varieties—and occasional public smoking still occurs in parks, train toilets, and office cabins.
This system deploys an automated detector that sounds a buzzer alarm and captures a MaixCam snapshot on the SD card whenever a cigarette is lit or smoked, alerting nearby individuals and deterring the smoker.
Fig. 1 shows the MaixCam board used in this system. The components required to assemble the unit are listed in the Bill of Materials table.

EFY note. As this board has been used previously, refer to related articles published in the April and May issues. Those articles offer additional details on the MaixCam development board.
Bill of Materials | |
Components | Quantity |
MaixCam | 1 |
5V power adaptor | 1 |
LED | 2 |
Operating system
The MaixCam runs a lightweight, custom Linux-based operating system designed specifically for Kendryte K210 boards. Key features include:
- Integrated support for YOLOv5 through YOLOv8
- Headless mode for efficient remote operation
- Python 3.11 for scripting and automation
- SSH daemon for secure remote access
This configuration supports real-time machine learning and is well-suited for entry-level AI systems and lightweight edge AI applications. Fig. 2 shows the pin description of the MaixCam device.

Working
For smoker detection, the system uses a pre-trained and modified Chinese neural network (YOLOv5) model named `smoking.mud,` which internally uses `smoking.cvimodel.` The model is uploaded to the `/root/models` directory or another designated location on the MaixCam board’s SD card.
The MaixCam’s camera captures images at a 320×240 resolution in high-resolution 24-bit RGB format. These images are processed using a Python script that runs the YOLOv5 neural network model to analyse each frame and determine whether the smoke is caused by a smoker or if a burning cigarette is present (see Fig. 3). The pre-trained model does not detect smoke alone in the absence of a cigarette (see Fig. 4). A visible cigarette must be present in the image for a positive detection.


Upon detection of a smoker, the following actions are triggered:
OOPS! THIS IS EFY PRIME CONTENT…
which means that you need to be an EFY PRIME subscriber to read it.
EFY PRIME content is our best content. Hence, you need to make a small investment to access all of our content including EFY Prime content.
If you’re already an EFY PRIME member, feel free to login below.
Else, CLICK HERE to invest in an EFY Prime account and become our VIP customer who can access all our content, and that too without the clutter of ads!
BENEFITS OF EFY PRIME MEMBERSHIP:
(1) Zero Clutter AD free experience
(2) Super-fast user experience
(3) Focussed reading experience with no distractions
(4) Access to all our content including our Best-of-Best which is EFY Prime