
Building a Carbon Monoxide Detector
Build a circuit that senses carbon monoxide (CO) — the invisible, odourless gas from any incomplete combustion — and raises an alarm when it rises. An MQ-7 sensor gives the Arduino a reading that climbs with CO; the code compares it to a clean-air baseline and triggers a buzzer and red LED. A great way to learn gas sensing — but read the safety note: this is a demonstration, NOT a certified life-safety CO alarm.
Зааварчилгаа
Wire the sensor, buzzer and LED
Wire the sensor, buzzer and LED
On the breadboard: MQ-7 VCC to Arduino 5V, GND to GND, and its analog output (AOUT) to Arduino A0. Active buzzer + to pin 8, - to GND. Red LED anode to pin 7 through a 330 Ω resistor, cathode to GND.
Энэ алхмын материал:
Arduino Uno R31 ширхэг
Carbon Monoxide Sensor - MQ-71 ширхэг
Идэвхтэй чимээлэгчийн модуль1 ширхэг
LED - Basic 5mm1 ширхэг
Resistor 330 Ohm 1/6 Watt PTH - 20 pack1 ширхэг
Breadboard1 ширхэг
Jumper Wires (Male-to-Male)1 баглааConnect and open the IDE
Connect and open the IDE
Plug the Arduino into your computer with the USB cable, open the Arduino IDE, and select Arduino Uno and its serial port.
Энэ алхмын материал:
USB-B Cable1 ширхэгШаардлагатай багаж:
Arduino IDE суулгасан компьютерUpload the detector sketch
Upload the detector sketch
Paste this sketch and upload. It warms the sensor for two minutes, records a clean-air baseline, then sounds the buzzer and lights the LED whenever the reading climbs above that baseline.
Warm up, baseline and test
Warm up, baseline and test
Power it in fresh air and let the 2-minute warm-up set the clean-air baseline (a brand-new MQ-7 also needs a longer 24–48 h burn-in before its readings settle). Then hold a small CO source nearby in a ventilated room — the smoke from a just-blown-out match works — and the buzzer and LED should trigger. Change ALARM_MARGIN to make it more or less sensitive.
Important safety limits
Important safety limits
This is a LEARNING project and, at best, a supplementary indicator — it is NOT a certified life-safety device. A hobby MQ-7 gives a relative reading, not a calibrated ppm; it drifts over time and needs regular re-baselining, and it also responds to smoke and other gases. Carbon monoxide is invisible, odourless and can be fatal: for real protection always use a UL- or EN-certified CO alarm. Never rely on this circuit to keep anyone safe.
Материал
8- Arduino Uno R3 SMD10% комисс1 ширхэг$27.06
- Carbon Monoxide Sensor - MQ-710% комисс1 ширхэг$7.04
- 1 ширхэгТүр орлуулагч
- LED - Basic 5mm10% комисс1 ширхэг$0.77
- Resistor 330 Ohm 1/6 Watt PTH - 20 pack10% комисс1 ширхэг$1.19
- Breadboard - Classic10% комисс1 ширхэг$9.50
- 1 баглаа$5.01
- SparkFun Cerberus USB Cable - 1.8 meter10% комисс1 ширхэг$5.69
Шаардлагатай багаж
2- Түр орлуулагч
- Breadboard - Classic10% комисс$9.50
Холбоотой загварууд
Эдгээр загварууд мэдлэг хуваалцдаг — арга техник, материал эсвэл зарчим
CC0 Нийтийн домэйн
Энэ загвар CC0 дор гаргагдсан. Та зөвшөөрөл авахгүйгээр хуулах, өөрчлөх, түгээх, ашиглах боломжтой.
Загвараар дамжуулан бүтээгдэхүүн худалдаж авч Бүтээгчийг дэмжээрэй Бүтээгчийн шимтгэл Борлуулагчаар тогтоосон, эсвэл энэ загварын шинэ хувилбар үүсгэж орлогоо хуваахын тулд өөрийн загварт холбоос болгон оруулна уу.

