Built to order

Smart Mosquito Trap with CO2 and UV Attraction using ESP32

This project builds a smart mosquito trap that lures mosquitoes the way they find humans — carbon dioxide and warmth cues — then captures them with a suction fan. A baking-soda/vinegar CO2 generator and a UV LED ring form the bait, a 12 V fan pulls insects into a catch chamber, and an IR beam-break counter logs every capture on an ESP32 with a live count on an OLED. A light sensor runs the trap only at dusk and night when mosquitoes are active, saving power and bait. Suitable for B.E./B.Tech final-year projects in Electronics and IoT & Embedded.

Smart Mosquito Trap with CO2 and UV Attraction using ESP32 — project thumbnail preview
More project photos (2)

The problem

Mosquitoes find people largely by sensing exhaled carbon dioxide, which is why CO2-baited traps outperform simple UV zappers — but commercial CO2 traps are expensive imports. This project builds an affordable smart version from student parts: a drip-fed baking-soda and vinegar chamber generates a steady CO2 plume, a violet UV LED ring adds the visual lure, and a low-noise 12 V fan creates the suction that pulls approaching mosquitoes into a mesh catch chamber they cannot escape. An IR beam-break sensor across the intake counts each capture, and the ESP32 logs hourly counts to flash memory, shown live on an OLED with a daily total. An LDR enables the trap automatically at dusk and parks it at dawn, and a bait-low estimate reminds the user to refill the chamber. It is a complete embedded system — chemistry, airflow, sensing and logging — in one demonstrator.

How it works

  1. At dusk the LDR crosses its threshold; the ESP32 wakes the trap, starts the fan and powers the UV ring.
  2. The drip valve meters vinegar into the baking-soda chamber at a set rate, releasing a continuous CO2 plume from the outlet tube.
  3. Mosquitoes following the CO2 gradient reach the intake, where the UV ring and fan airflow pull them into the mesh catch chamber.
  4. Each insect crossing the intake breaks the IR beam; firmware debounces the signal and increments the capture count.
  5. Counts accumulate per hour in flash memory; the OLED shows live count, nightly total and system status.
  6. At dawn the LDR parks the system — fan and UV off, drip valve closed — and the bait estimator updates remaining charge.

Tech stack:

  • ESP32 dev board
  • 12 V DC fan · 395 nm UV LED strip
  • IR beam-break sensor module
  • LDR light sensor · 0.96 inch OLED (I2C)
  • Baking-soda/vinegar CO2 chamber + drip valve
  • Arduino IDE · C/C++ firmware
Parameter Value
Attractants CO2 plume + 395 nm UV ring
Capture Suction fan into mesh chamber
Counter IR beam-break, firmware debounced
Automation LDR dusk-to-dawn, adjustable threshold
Display Live count, nightly total, bait estimate
CO2 charge Approx. 200 g baking soda + 500 mL vinegar per fill (expected, ~8–10 h plume)
Power 12 V DC 2 A adapter
Logging Hourly counts in flash, 30-day ring buffer

Project features

  • [CO2 bait generation] Drip-fed baking-soda + vinegar reaction chamber produces a steady CO2 plume mimicking human breath — the primary long-range mosquito attractant.
  • [UV lure ring] 395 nm UV LED strip around the intake adds the short-range visual cue that draws mosquitoes into the suction zone.
  • [Suction capture] 12 V DC fan creates intake airflow into a mesh catch chamber; captured insects cannot fly back out against the airflow.
  • [IR catch counter] Beam-break sensor across the intake throat counts each capture; the ESP32 debounces and logs hourly totals to flash.
  • [Dusk-to-dawn automation] LDR light sensing runs the trap only when ambient light falls below threshold — bait and battery last through the nights that matter.
  • [OLED dashboard] Live catch count, tonight's total, fan status and bait-level estimate on a 0.96-inch display.
  • [Bait refill reminder] Firmware estimates CO2 charge depletion from runtime and flags refill on the display before the plume fades.

What is included

  • Working smart mosquito trap prototype (trap chamber, fan, UV ring, CO2 generator, ESP32, sensors)
  • Complete firmware source with counter, automation and logging
  • Assembly diagram and airflow path documentation
  • Bait mixing and drip-rate setup procedure
  • Project report PDF (background, mosquito behavior basis, system design, testing)
  • PPT presentation for final review
  • Viva Q&A preparation document (IR sensing, LDR, debouncing, embedded logging)

Limitations & prerequisites

  • Capture effectiveness is placement- and species-dependent; no catch-rate figure is claimed — the report provides a buyer-run field-test procedure (count vs. a control location over 7 nights) instead of invented results.
  • The CO2 charge lasts roughly one night per fill (expected); it is a consumable the user refills, not a fit-and-forget device.
  • UV LEDs attract some non-target night insects too; the catch chamber is non-selective by design.
  • Indoor bedroom use is discouraged — the trap is designed for verandas, courtyards and outdoor seating areas.
  • The vinegar/baking-soda reaction is mild but the chamber must stay upright and away from children and pets.

Frequently Asked Questions

Why CO2 instead of just a UV zapper?

Mosquitoes hunt primarily by CO2 plumes from breath; UV alone mostly catches moths. The CO2 brings mosquitoes in from metres away, and the UV + fan finish the job at the intake.

Is it safe?

Yes — no high-voltage zapper grid, no pesticides. The bait is kitchen chemistry (baking soda + vinegar) and everything runs on 12 V DC.

How often must the bait be refilled?

Roughly every night of use (one charge ≈ 8–10 hours of plume, expected). The display's bait estimator flags refill time based on runtime.

Does it need Wi-Fi or an app?

No — counting, logging and automation all run locally on the ESP32 with the OLED as the interface.

Will it work indoors?

It is designed for semi-outdoor spaces (veranda, courtyard). Indoors, competing CO2 from people in the room overwhelms the trap's plume.

Is this project suitable for a final-year project?

Yes — for Electronics and IoT & Embedded programs. It is a genuinely multidisciplinary build: chemistry, airflow, optics, sensing and embedded logging in one system. Suitable for B.E./B.Tech final-year projects in Electronics and IoT & Embedded.

Components & software requirements
  • ESP32 dev board
  • 12 V DC fan · 395 nm UV LED strip
  • IR beam-break sensor module
  • LDR light sensor · 0.96 inch OLED (I2C)
  • Baking-soda/vinegar CO2 chamber + drip valve
  • Arduino IDE · C/C++ firmware
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Blueprint-style technical illustration of an ESP32 development board at the centre, with sensor nodes, data-flow arrows and a circuit-brain motif representing an AI agent reasoning and sending decisions back.Engineering students building IoT or embedded final-year projects who want to add local AI agent behaviour with ESP32, MQTT and a small language model.

AI Agents on ESP32: Agentic IoT Final-Year Projects

An agentic IoT system observes, reasons, acts, remembers and explains. On ESP32 that means a split architecture: the chip senses and acts while a small local model (Ollama on your laptop) reasons over MQTT — a full LLM needs gigabytes of RAM the chip doesn't have. This guide covers three working patterns (host-reasoned agent, on-device tinyML on ESP32-S3, and a hybrid of both), plus Wi-Fi CSI presence sensing, parts and budget for India, code shapes, and honest limits to state in your report.

Read guide
Technical illustration of three electronic control units linked by a twisted-pair CAN bus cable carrying signal pulses between them.Electronics, E&TC, IoT and robotics students who keep hearing “CAN bus” in EV, automotive and industrial project ideas and want to understand it properly before wiring anything

CAN Bus Basics for Students: How ECUs Communicate

CAN bus is the shared network that lets dozens of controllers in a car, EV or robot communicate over two wires. This guide explains message IDs, arbitration, the physical layer, frame structure, error handling and CAN FD, then walks through building a working two-node bench network with an ESP32 and a transceiver.

Read guide
Illustration of a quadcopter drone build showing labeled parts including frame, motors, propellers, ESCs, flight controller, and battery.B.E./B.Tech Electronics, Mechanical, and Computer Science students planning to build a quadcopter drone who need to select compatible parts without wasting money on mismatched

Drone Build: Parts Selection Guide

Picking drone parts that actually work together is a sizing problem, not a shopping problem. This guide walks the compatibility chain — frame to props to motors to ESCs to battery — with the thrust math, firmware choices, LiPo safety, and the bench-test order that prevents disasters.

Read guide
Get a quotation