Lesson plan

MQ gas sensors, honestly lesson plan

Heaters, Rs/R0, calibration, cross sensitivity and alarms on the cheap MQ sensors, and why a hobby build never replaces a listed detector.

4 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • A heated tin dioxide film, its warm-up, and the ratio its chart is drawn in.
  • Measure R0, and learn which gas a reading can and cannot name.
  • Hysteresis, exposure over time, test buttons and faults, and what a listing means.
  • A garage fume alarm that knows what it is not.

Materials for the whole unit

  • Air quality sensor, MQ-135
  • Arduino Uno R3
  • Buzzer
  • Carbon monoxide sensor, MQ-7
  • Gas sensor, MQ-2
  • LED
  • Pushbutton
  • Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 30 min

How the sensor works

A heated tin dioxide film, its warm-up, and the ratio its chart is drawn in.

LessonTimeWhat students do
The heater and burn-inInside an MQ sensor is a heater and a film of tin dioxide. Watch a cold one read as gas, then settle, and learn why every gas sketch waits.45 min
  1. Power the sensor
  2. A cold sensor cries gas
  3. The DO pin agrees
  4. Watch it settle
  5. Arm the alarm later
  6. Burn-in, power and heat
Rs/R0 ratiosTurn AO into the element's resistance, then into the ratio the datasheet's chart is drawn in, then into parts per million.45 min
  1. Run the ratio sketch
  2. From volts to ohms
  3. Eleven counts is not much
  4. Let some gas in
  5. Read the chart
  6. Use this sensor's R0

Materials

  • Arduino Uno R3
  • Gas sensor, MQ-2

Check for understanding

Each student finishes "Rs/R0 ratios" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Use this sensor's R0".

Chapter 2. About 1 h 30 min

Readings that mean something

Measure R0, and learn which gas a reading can and cannot name.

LessonTimeWhat students do
Calibration in clean airR0 varies by a factor of two or more between sensors. Measure it in clean air, and see what trusting the datasheet's typical value costs.45 min
  1. A different sensor
  2. Measure R0
  3. Why the 10 k load
  4. Same gas, two answers
  5. Clean air is a judgment
  6. More samples
Cross sensitivityEvery MQ sensor answers to many gases and cannot say which one it smells. Fool all three sensors on the bench.45 min
  1. Three sensors, three guesses
  2. The real CO line
  3. A drink near the MQ-2
  4. Hydrogen on the CO sensor
  5. Hand sanitizer is CO2
  6. What a reading means

Materials

  • Air quality sensor, MQ-135
  • Arduino Uno R3
  • Carbon monoxide sensor, MQ-7
  • Gas sensor, MQ-2

Check for understanding

Each student finishes "Cross sensitivity" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What a reading means".

Chapter 3. About 1 h 50 min

Alarms, honestly

Hysteresis, exposure over time, test buttons and faults, and what a listing means.

LessonTimeWhat students do
Alarms with hysteresisA reading that hovers near a threshold turns a simple alarm on and off all day. Two thresholds fix it.55 min
  1. One alarm, two rules
  2. A reading that hovers
  3. Two thresholds hold
  4. The buzzer follows
  5. Clear the air
  6. Take the gap away
  7. Hysteresis everywhere
What a listed detector doesA CO alarm listed to UL 2034 decides by exposure over time, sounds a set pattern, tests itself and reports faults. Sketch the ideas, and learn why a sketch is never the alarm.55 min
  1. Read this first
  2. Run the sketch
  3. Press TEST
  4. Count the beeps
  5. Dose, not a reading
  6. No alarm at 30 ppm
  7. A fault is not silence

Materials

  • Arduino Uno R3
  • Buzzer
  • Carbon monoxide sensor, MQ-7
  • Pushbutton

Check for understanding

Each student finishes "What a listed detector does" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A fault is not silence".

Chapter 4. About 1 h 5 min

Boss

A garage fume alarm that knows what it is not.

LessonTimeWhat students do
Boss: a garage fume alarmPut it together: warm-up lockout, calibration at boot, a fan on CO, a dose alarm, a fuel vapor alarm and a test button. A project that sits beside listed alarms, never in their place.65 min
  1. Locked out while warming
  2. Calibrated at boot
  3. Car idling: run the fan
  4. Running too long: CO alarm
  5. Spilled fuel: vapor alarm
  6. Test button
  7. Make it yours
  8. Where it sits

Materials

  • Arduino Uno R3
  • Buzzer
  • Carbon monoxide sensor, MQ-7
  • Gas sensor, MQ-2
  • LED
  • Pushbutton
  • Resistor

Check for understanding

Each student finishes "Boss: a garage fume alarm" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Where it sits".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.