MiCS-6814 Gas Sensor Library for Proteus Simulation: the MiCS-6814 breakout, three pull-ups, an I2C LCD 16x2, three LEDs and a buzzer on an Arduino UNO V4.0

MiCS-6814 Gas Sensor Library for Proteus Simulation

40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new MiCS-6814 Gas Sensor Library for Proteus Simulation. The MiCS-6814 packs three independent gas sensors into one small package: one for reducing gases such as carbon monoxide, one for oxidising gases such as nitrogen dioxide, and one for ammonia. With this library you can run a full Proteus simulation of the common MiCS-6814 breakout, read its three channels with an Arduino, calibrate them in clean air and turn the readings into ppm with the curves of the datasheet.

Animated MiCS-6814 gas sensor Proteus simulation: an Arduino UNO V4.0 showing CO, NO2 and NH3 on an I2C LCD with alarm LEDs
Figure: The MiCS-6814 gas sensor simulation at work.
Updates

MiCS-6814 Gas Sensor Library for Proteus

Latest version: V1.0 (December 2026, this tutorial)

Helping Tools

The demo is a garage air monitor: an Arduino UNO V4.0 watches CO, NO2 and NH3 four times a second while a car runs in the garage and somebody cleans with ammonia. It shows the three gases on a 16x2 LCD and switches green, yellow and red LEDs and a buzzer for OK, WARNING and ALARM.

NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the gas sensor board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the MiCS-6814 Gas Sensor Library for Proteus Simulation:

MiCS-6814 Gas Sensor Library for Proteus Simulation: the MiCS-6814 breakout, three pull-ups, an I2C LCD 16x2, three LEDs and a buzzer on an Arduino UNO V4.0
Figure: The MiCS-6814 Gas Sensor Library for Proteus Simulation.

What Is the MiCS-6814 Gas Sensor?

The MiCS-6814 is a metal-oxide (MOX) gas sensor in a 5 x 7 mm package. Inside are three separate sensing elements, each a small heated plate with a metal-oxide layer whose resistance changes with the gases around it:

  • RED - for reducing gases: carbon monoxide (1 - 1000 ppm), and also hydrogen, ethanol, methane, propane and butane. Its resistance FALLS when they appear.
  • OX - for oxidising gases: nitrogen dioxide (0.05 - 10 ppm). Its resistance RISES with NO2.
  • NH3 - for ammonia (1 - 300 ppm). Its resistance falls with the gas.

Each element has its own heater: about 2.4 V and 32 mA for RED, 1.7 V and 26 mA for OX, 2.2 V and 30 mA for NH3. The heaters are what makes the chemistry work, and they need time to settle: a fresh power-up takes minutes before the readings are stable.

The Breakout Board

The common breakout is a small board of about 17 x 14 mm with only the sensor and three heater resistors on it, so the heaters run straight from 5 V. Its five pins are 5V, GND, NO2, NH3 and CO. Here is the surprise: each of the three output pins is simply the sensing resistor to ground. There is no load resistor on the board. You add a pull-up to 5 V yourself - 47 to 56 k is usual, never below 820 ohm - and the sensor and the pull-up make a voltage divider:

  • V = 5 V x Rs / (Rs + RL)
  • On an Arduino: Rs = RL x counts / (1023 - counts).
  • So the CO and NH3 voltages FALL when gas appears, and the NO2 voltage RISES.

R0 and the Curves

Metal-oxide sensors are not precise and no two are the same. The datasheet gives the resistance in clean air, R0, only as a wide range: 100 - 1500 k for RED, 0.8 - 20 k for OX, 10 - 1500 k for NH3. So a sketch measures R0 itself in clean air after the warm-up, and from then on works with the ratio Rs / R0. The datasheet's curves turn that ratio into ppm; on log-log paper they are straight lines, and a popular driver library fits them like this:

  • CO = 4.385 x ratio^-1.179
  • NO2 = ratio^1.007 / 6.855
  • NH3 = ratio^-1.67 / 1.47

A ratio of 1 - clean air - gives about 4.4 ppm CO, 0.15 ppm NO2 and 0.7 ppm NH3: the clean-air points of the curves, not real gas. The readings are estimates, good for spotting changes and trends, not for certified measurements.

Features of the MiCS-6814 Library

  • A real-looking breakout: the board at its true size with the sensor and its heater resistors; at Run the three heaters glow on the sensor.
  • Three real resistors: each output pin is a resistor to GND, so your pull-up and your ADC see exactly what a real board gives.
  • The datasheet curves: CO on the RED element, NO2 on OX - rising - and NH3 on NH3; alcohol on the RED element too.
  • Any sensor: R0RED, R0OX and R0NH3 set each element's clean-air resistance.
  • Heaters and warm-up: about 56 mA from the 5V pin and a warm-up drift, set by WARMUP.
  • A pop-up: three cards with each gas, Rs, R0, Rs / R0, the pin's voltage and the pull-up it sees; graphs, an event log and a check page.
  • A complete package: about 2.7 MB with the library, our I2C LCD, resistors, LEDs and buzzer, our Arduino UNO V4.0 and the demo, without the source code of the model.

The MiCS-6814 in Proteus

The device is MICS6814TEP in TEPMICS6814.LIB, under Modules > Sensors, with the model TEPMICS6814.DLL. Search MICS6814 or gas in Pick Devices. Its five pins are the header of the real board. Its properties: PROFILE (DEMO or STEADY), CO, NO2 and NH3 for STEADY, R0RED, R0OX and R0NH3 for the clean-air resistances, and WARMUP - 3 s by default, so the demo shows the warm-up in fast time.

MiCS-6814 gas sensor breakout from the MiCS-6814 Library for Proteus Simulation, with the 5-pin header
Figure: The MiCS-6814 breakout.

Download MiCS-6814 Gas Sensor Library for Proteus Simulation

Click the button below to download MiCS-6814-Gas-Sensor-Library-for-Proteus-v1.0.zip (about 2.7 MB, without the source code of the models):

MiCS-6814 Gas Sensor Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
  • Proteus Library Files: TEPMICS6814.LIB, TEPI2CLCD16X2.LIB, TEPRESISTOR.LIB, TEPLED5MM.LIB, TEPBUZZER.LIB and ArduinoV4TEP.LIB.
  • Proteus Model Files: TEPMICS6814.DLL, TEPLCD.DLL, TEPRESISTOR.DLL, TEPLED5MM.DLL, TEPBUZZER.DLL and TEPARDUINO.DLL.
  • Arduino Code: the demo sketch (Wire only).
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install MiCS-6814 Gas Sensor Library for Proteus Simulation

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the files from Proteus Model Files into the MODELS folder.
  4. Delete TEPMICS6814.IDX from the LIBRARY folder if it is there.
  5. Start Proteus, press P and search for MICS6814.

Proteus Simulation of a Garage Air Monitor

A running engine in a closed garage fills it with carbon monoxide and nitrogen dioxide - both dangerous - and cleaning products bring ammonia. The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0. The breakout (U1) has CO on A0, NH3 on A1 and NO2 on A2, each with its 56 k pull-up (R1 to R3) to 5 V. A 16x2 LCD from our I2C LCD 16x2 Library for Proteus sits on the I2C bus at 0x27; three LEDs on D5 to D7 show OK, WARNING and ALARM, and BZ1 from our Active Buzzer Library for Proteus on D8 beeps. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open MiCS-6814-Garage-Air-ArduinoUnoV4.pdsprj.

The DEMO air is a recorded garage, played in fast time: clean air, a car started inside, the door opened, an ammonia cleaner, and airing out. The thresholds in the sketch follow common exposure limits: CO 35 / 100 ppm, NO2 1 / 5 ppm, NH3 25 / 50 ppm.

MiCS-6814 simulation in Proteus: the MiCS-6814 breakout, three 56 k pull-ups, an I2C LCD 16x2, three LEDs and a buzzer on an Arduino UNO V4.0, A4 sheet
Figure: The whole simulation on an A4 sheet.

The Sketch

Each channel is a divider, so the sketch turns the ADC counts back into the sensor's resistance:

  return RL * c / (1023.0 - c);

It never calibrates a cold sensor: it waits for the warm-up, then averages ten readings of each element as R0:

  for (byte i = 0; i < 10; i++) { for (byte ch = 0; ch < 3; ch++) r0[ch] += readRs(ch) / 10.0; delay(100); }   // clean air: R0

Then four times a second it works out the ratios and the three curves. Notice the NO2 line: its exponent is positive, because the OX element's resistance rises with the gas:

  ppm[0] = 4.385 * pow(ratio[0], -1.179);                    // CO: the RED element, resistance falls with the gas
  ppm[1] = pow(ratio[1], 1.007) / 6.855;                     // NO2: the OX element, resistance RISES with the gas
  ppm[2] = pow(ratio[2], -1.67) / 1.47;                      // NH3

The worst of the three gases decides the state, and the LCD shows all three with the gas that caused a warning or an alarm.

MiCS-6814 Simulation Results

Open the project and press Run. The demo runs 11.9 simulated seconds and took about 3 minutes 40 seconds on our PC with the pop-up open and the pictures being taken. Click U1 for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.

The Warm-Up

At power-on the three heaters start, and the elements have to settle before their resistance means anything. The sketch waits: the LCD counts down "WARM-UP", the yellow LED blinks and the monitor says "warming up the three heaters: 3 s here, 10 - 30 minutes on a real sensor". The pop-up at 2.0 s shows why: the banner says the elements are at 96 % of their clean-air resistance - the RED element at 447 k instead of 480 k. On the sheet the three heaters glow on the sensor.

MiCS-6814 Proteus simulation pop-up: the three heaters warming up, the elements below their R0
Figure: The warm-up.
MiCS-6814 Proteus simulation: the gas sensor breakout with its three heaters glowing
Figure: The sensor at work.
The MiCS-6814 gas sensor simulation running in the Proteus workspace
Figure: The simulation in the workspace.

Clean Air and R0

At 3 s the sketch measures R0, ten readings of each divider averaged, and the monitor prints "R0 in clean air: CO 477.9 k, NO2 12.27 k, NH3 274.4 k" - close to the model's 480, 12 and 280 k. The first status line, at 4.16 s, reads CO 4 ppm, NO2 0.15 ppm and NH3 1 ppm: the ratios are 1, so these are the clean-air points of the curves. The pop-up at 4.2 s is green - CLEAN AIR - and the green LED is on.

MiCS-6814 Proteus simulation pop-up: clean air, all three ratios at 1
Figure: Clean air.

A Car Running in the Garage

At 4.4 s a car is started in the garage. CO climbs fast: at 5.15 s the monitor says "WARNING: CO 42 ppm" - the yellow LED and a beep. The pop-up at 5.2 s already shows 74 ppm CO and 0.97 ppm NO2 in the air: the pop-up shows the air itself, while the sensor's settling and the sketch's averaging run a little behind it. At 5.90 s comes "ALARM: CO 108 ppm", the red LED and the buzzer.

MiCS-6814 Proteus simulation pop-up: a car started, CO rising past the warning level
Figure: A car started.

The pop-up at 6.9 s shows the worst of it: CO 164 ppm and NO2 2.09 ppm. The RED element has fallen from 480 k to 22.8 k - Rs / R0 = 0.047 - so its pin is down at 1.445 V. The OX element has risen from 12 k to 162.8 k, Rs / R0 = 13.57, and its pin is up at 3.719 V. Each card also works out the pull-up the pin sees from Rs and the voltage: 56 k. At that moment the LCD reads "CO 155 NO2 1.93" and "NH3 1 ALRM CO".

MiCS-6814 Proteus simulation pop-up: car exhaust, CO above 100 ppm and NO2 above 1 ppm
Figure: The exhaust at its worst.

The Door Opened and an Ammonia Cleaner

At 7.0 s the door is opened and the exhaust clears: "WARNING: CO 91 ppm" at 7.65 s, and at 8.15 s "OK - all three below the warning levels" with CO 21 ppm and NO2 0.43 ppm.

At 8.6 s somebody starts cleaning with an ammonia cleaner. The monitor says "WARNING: NH3 28 ppm" at 9.40 s and "ALARM: NH3 57 ppm" at 9.90 s. The pop-up at 9.8 s shows 75 ppm of ammonia in the air, the NH3 element down from 280 k to 21.4 k, and CO and NO2 clean - each element answers to its own gas. At 10.15 s the monitor reads NH3 64 ppm.

MiCS-6814 Proteus simulation pop-up: an ammonia cleaner, NH3 above 50 ppm
Figure: Ammonia.

From 10.4 s the garage airs out: "WARNING: NH3 49 ppm" at 10.90 s and "OK" at 11.40 s. The pop-up at 11.9 s is green again with CO 4, NO2 0.15 and NH3 3 ppm.

MiCS-6814 Proteus simulation pop-up: the garage aired out, the ratios back near 1
Figure: Aired out.

The Graphs, the Event Log and the Check Page

The Graphs page plots CO, NO2 and NH3 and the warm-up: the car shows as a CO hill with a small NO2 hill beside it, the cleaner as a separate NH3 hill. The Event log lists the power-on, the end of the warm-up and each stage of the garage. The Check page sums up the run: the 5V supply at 5.00 V with the heaters taking 56 mA and 281 mW; the warm-up at 100 %; the pull-ups the pins see, 56 k on all three; at most 0.108 mW in a sensing layer, far below the datasheet's 8 mW; and the air back to CO 4 ppm, NO2 0.15 ppm and NH3 3 ppm.

MiCS-6814 Proteus simulation graphs: CO, NO2, NH3 and the warm-up
Figure: The Graphs page.
MiCS-6814 Proteus simulation Event log: the warm-up and the garage stages
Figure: The Event log.
MiCS-6814 Proteus simulation Check page after the demo run
Figure: The Check page.

The Arduino's built-in serial monitor prints the warm-up and the three R0 values at start-up, then a status line every 2 s - CO, NO2 and NH3 in ppm - and a line of its own for every change of state: WARNING, ALARM or OK, with the gas that caused it. Its times come from millis(), which starts when the sketch starts, a few hundredths of a second after the simulation does.

Arduino UNO V4.0 serial monitor in the MiCS-6814 Proteus simulation: R0, the three gases and the alarms
Figure: The Arduino's monitor.

MiCS-6814 or MQ Sensors?

The MQ sensors in our MQ Gas Sensor Library for Proteus are the classic metal-oxide sensors: one gas family each, a big heater and a module with a load resistor and a comparator. The MiCS-6814 puts three elements in a tiny package and uses far less heater power, but leaves the load resistors to you. For indoor air quality with a ready-made index, the digital ENS160 in our ENS160 Air Quality Sensor Library for Proteus does the calculation on the chip.

Try It Yourself

  • Click U1 while the simulation runs and use the chips: Car exhaust raises CO and NO2, Ammonia raises NH3, Clean air brings everything back.
  • Click Alcohol: the CO reading jumps although there is no CO at all - the RED element sees every reducing gas, so alcohol vapour reads as "CO".
  • Remove the pull-up R1: the CO pin reads 0 V, the sketch sees zero resistance and a huge CO reading - the Check page reports the missing pull-up.
  • Calibrate too early: set WARMUP to 10 - the sketch measures R0 on a sensor still warming up, so afterwards CO and NH3 read too low and NO2 too high.
  • Change R0RED to 1000: the sketch measures the new R0 itself and the ppm readings stay right - that is why you calibrate.

Ideas to Extend the Demo

  • Switch an extractor fan through a relay at the WARNING level and back off when all three are OK.
  • Store R0 in the EEPROM after a long warm-up, so a quick restart does not calibrate in dirty air.
  • Log the three ratios over a day to see the traffic, cooking or cleaning in them.

Your Own Sketches

The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.

Things to Know Before Using a Real MiCS-6814

  • Warm-up: 10 - 30 minutes before R0, and a new sensor needs a longer burn-in.
  • Not a CO alarm: the RED element reacts to alcohol, hydrogen and fuels too - use a certified detector for safety.
  • Temperature and humidity: the curves are given at 25 C and 50 %; outside that the readings change.
  • Power: the heaters need about 56 mA from a steady 5 V.
  • Pull-ups: 47 - 56 k, never below 820 ohm.

Troubleshooting

  • A pin reads 0 V: it has no pull-up.
  • A pin reads almost 5 V all the time: the heaters have no supply and the element is cold.
  • The readings drift after start-up: the warm-up - calibrate R0 only after it.
  • CO jumps near alcohol or a lighter: that is the RED element, not a fault.
  • The part is not simulated: TEPMICS6814.DLL is missing from MODELS and from the project folder.

Limitations of the Simulation

  • The three elements, their directions, the clean-air ranges, the heater figures and the curves follow the datasheet and a driver library's fits; the board is our own drawing.
  • Our own figures: R0 480 k / 12 k / 280 k, the heater load of about 56 mA, WARMUP 3 s, a 0.3 s lag, reducing gases adding their conductances.
  • The DEMO is a recorded garage in fast time.
  • Not modelled: temperature and humidity, the other gases' curves, the OX element's response to reducing gases, ageing.
  • Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the maker of the MiCS-6814.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.

So, that was all about the MiCS-6814 Gas Sensor Library for Proteus Simulation. I hope it helps you keep an eye on the air in your garage or workshop. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation