This is only a preview of the February 2021 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
INDOOR 'POOR AIR
QUALITY' MONITOR
By Geoff Graham
Is the air in your office
or home ‘stuffy’? That
can be subjective – but
there is an objective
way to measure air
quality – using a volatile
organic compound
(VOC) meter. The
Micromite BackPack
and a cheap module
make building one
There are no
dead easy! Now you
switches: all controls are
really can find out if you based on the Micromite BackPack
touch screen, The CCS811 Air Sensor can be
are being hit by ‘Sick
seen on the top right of the Jiffy Box. A reading of 53
Building Syndrome’.
parts per billion (as shown here) would indicate pretty clean air!
T
he amount of volatile organic
compounds (VOCs) in the air is
a fundamental measure of air
quality. VOCs include thousands of
chemicals that can be present in the
air, many of which are recognised to
have a significant impact on the health
of people breathing them in.
This monitor uses a CCS811 MOX
(metal oxide) sensor made by ams AG,
Austria, to measure the total VOC level
MOX sensors
MOX stands for ‘Metal OXide’ which, in a
sensor such as the CCS811, is a thin film
of a metal oxide such as tin oxide (SnO2)
in a porous granular state.
In clean air, oxygen is adsorbed on the
surface of the metal oxide and this attracts
free electrons in the material to the surface
which, in turn, has the effect of increasing
the resistance of the MOX layer.
In the presence of a reducing gas (eg, a
volatile organic compound), the oxygen is
pulled from the MOX surface to react with this
gas. This frees previously trapped electrons,
causing a measurable decrease in resistance.
To assist in this process, the MOX layer
is raised in temperature by a built-in heater.
32
in the air. This sensor comes in a tiny
surface-mount package that is very
difficult to solder.
Fortunately, it can be purchased as
part of a low-cost (£7.50) fully assembled
module which, when coupled with a
Micromite LCD BackPack, makes a
capable Air Quality Monitor.
The VOC reading varies with temperature and humidity, so the sensor
module also includes temperature
and humidity sensors, allowing it to
compensate for variation in both.
Once per second, the Micromite’s
BASIC program reads these values
and feeds them to the CCS811 sensor,
which then uses them to adjust its VOC
reading to maintain accuracy.
The BASIC program then extracts
the VOC reading and displays it as a
number, expressed in parts-per-billion
(ppb). It also draws a graph on the LCD
In a modern sensor, the whole structure is
built on a semiconductor substrate using
normal manufacturing processes.
By varying factors such as the type of oxide,
the grain size and the heating temperature, the
manufacturer can adjust the sensitivity to suit
various reducing gases. The CCS811 sensor
used in our Air Quality Monitor is especially
sensitive to alcohols, aldehydes, ketones,
organic acids, amines, aliphatic and aromatic
hydrocarbons. These are typically produced
by humans and building materials.
Humidity has a strong influence on the
performance of metal-oxide gas sensors.
Reactions between the surface oxygen and
water molecules cause a reduction in the
resistance of the MOX layer, reducing its
sensitivity. Temperature also has an effect.
This is why the module used in our Air
Quality Monitor includes a temperature/
humidity sensor.
The program running on the Micromite
reads the temperature and humidity values
once per second and transfers them to the
CCS811 sensor. The internal algorithms of
the CCS811 then use these to adjust the
readings accordingly.
The sensor needs an initial burn-in
period of 48 hours to remove manufacturing contaminants from the surface. It
also needs a 20-minute warm-up period
whenever power is applied.
The sensor can become contaminated,
so it has a limited lifetime. According to
the manufacturer of the CCS811, this is at
least five years
Practical Electronics | February | 2021
The
sensor
module does
not contain many
components, and
so is quite tiny (it’s
shown here about twice life size).
Search eBay or AliExpress for the
two keywords CCS811 and HDC1080.
Many of the available modules
will match either of the keywords
but not both, so make sure that the
module you purchase matches this
photograph and has both the CCS811
and HDC1080 sensor ICs.
screen, so that you can see the trends
in the reading.
Other functions of the BASIC program allow you to set the baseline for
the VOC reading (ie, essentially set the
zero reading) and even upgrade the
firmware running in the CCS811 sensor.
We’ve described a few different
versions of the LCD BackPack in past
issues of the magazine. You can use
any of them for this project. However,
we recommend that you build the V2 or
V3 BackPack for this project, as those
versions allow the screen brightness to
be controlled by the BASIC program.
But note that the software is written
with the 2.8-inch 320×240 LCD screen
in mind, so if you build V3 with a
larger 3.5-inch 480×320 display, you
will have to modify the software to suit.
The program controlling the Air
Quality Monitor is written in the easyto-use BASIC programming language,
so you are free to get in there and
modify it to suit your preferences.
However, we don’t suggest that you
undertake the job of modifying the
software for the 3.5-inch screen unless you have some prior MMBasic
programming experience.
By the way, if you are designing
on another project based on the
Micromite LCD BackPack, you may
wish to extract segments of the Air
Quality Monitor program for your
own needs. For example, the graph
drawing algorithms could come in
handy for many other tasks.
Volatile organic compounds
The side box describes how a MOX
sensor works; essentially, it measures
organic carbon molecules that are in
vapour form suspended in the air. Many
are given off by humans, and the CCS811
is particularly sensitive to these.
In scientific literature, the term
‘VOC’ (volatile organic compound)
Practical Electronics | February | 2021
refers to any one of the thousands of
organic (ie, carbon-containing) chemicals that are present in the air. These
are mostly gases at room temperatures.
The list includes both man-made and
naturally occurring chemicals.
The amount, or concentration, of
VOCs present is expressed in a variety
of units, but in the case of our sensor, it is reported in parts per billion
(ppb). For example, if the concentration is 10ppb, then for every billion
molecules of air, there are ten volatile
organic compound molecules.
Sources of VOCs include plants,
manufactured products (such as plastics) and animals (including humans).
An important subset of VOCs is
semi-volatile organic compounds,
which come from building materials,
furnishings, cleaning compounds, air
fresheners, pesticides and activities
such as tobacco smoking and cooking
with a gas stove.
Some of the key indoor sources of
semi-volatile organic compounds are
pesticides, building or decorating materials containing flexible plastics such
as vinyl wallpaper or vinyl flooring and
materials containing flame retardants.
One common VOC that has been
recognised as having significant
health impacts is formaldehyde,
which is widely used in the manufacture of building materials and
household products. It is also a byproduct of combustion and other
natural processes.
The CCS811 sensor used in our
Air Quality Monitor reports on total
volatile organic compound concentrations. This term refers to the concentration of many different VOCs that
are present simultaneously in the air,
and the CCS811 is more sensitive to
the subset of VOCs that are typically
caused by human activity.
Taken together, the total VOC reading indicates the quality of the air that
we breathe.
For example, a reading of zero indicates clean, fresh air. A reading of
4000ppb to 8000ppb (4-8ppm) would
indicate a stuffy room, while a reading
of over 16,000ppb (16ppm) would indicate a particularly bad environment.
Note that the CCS811 does not claim
to be highly accurate; in fact, the data
sheet talks in terms of ‘indicated’ levels of VOCs in the air.
Fig.1: the Air Quality Monitor circuit
consists of just two modules. These are
the Micromite LCD BackPack and the
sensor module, with the CCS811 and
HDC1080 ICs onboard. The sensors
communicate via I2C, so the sensor
module connects to the SCL and SDA
pins on the BackPack.
DC POWER
SOCKET
LCD DISPLAY MODULE
WITH TOUCH SCREEN
RED
BLACK
CON3
GND
RX
TX
5V
GND
+5V
CCS811+
HDC1080
GAS SENSOR
MODULE
VCC
+3.3V
GND
26
SCL
25
SDA
24
WAKE
22
INT
21
RST
18
ADDR
MICROMITE
LCD BACKPACK
17
16
14
Micromite Air
Quality Monitor
MICROMITE AIR
Reproduced by arrangement with
SILICON
CHIP magazine
2021.
QUALITY
MONITOR
www.siliconchip.com.au
SC
20 1 9
10
9
5
4
3
RESET
33
The Micromite-based
Air Quality Monitor before
it is put into its Jiffy box,
So, if you are thinking of suing your
employer over a sick building environment, you would need to employ much
more accurate equipment that could
measure specific chemicals (and hire
some pretty good lawyers!).
Regardless, the CCS811 is quite
sensitive. We tested it in a large room
without much ventilation and with
two people present, the VOC reading
climbed to more than 3000ppb over a
couple of hours. Opening a window
just a crack caused the reading to drop
back to near zero within half an hour.
ICSP
CON4
47 F
USB
CON3
LCD
S1
Mode
1
Fig.2: if you’re building the Air Quality Monitor around
the original Micromite LCD BackPack, this overlay shows
how to fit the components. The orientations of IC1 and REG1
are critical. You may have polarised or non-polarised highvalue capacitors. Also, a 10µF capacitor can be used in
place of the 47µF capacitor if it’s a ceramic type. CON1 and
CON2 are fitted to the underside of the board.
34
100nF
CON1
(UNDER)
10 F
+
10 F
+
10k
1k
CON4
47 F
+
+
Backlight
100
VR1
LED1
A
100nF
S1
RESET
RESET
3
4
5
9
10
14
16
17
18
21
22
24
25
26
3V3
5V
GND
(UNDER)
10 F
REG1
MCP1700-3302E
1
http://geoffg.net/micromite.html
CON2
10 F
IC1 PIC 32 MX170F256B-50I/SP
2.8-Inch Micromite
LCD BackPack
07102122
(UNDER)
REG1
MCP1700-3302E
IC1 PIC 32 MX170F256B-50I/SP
CON3
LCD
100nF
100nF
2N7002
Q1
Micromite LCD BackPack V2 PWM
07104171
Backlight
DMP2215L
Q2
1k
10k
100nF
JP1
CON1
+
1
+
(UNDER)
IC2
PIC16F1455-I/P
CON2
5V
TX
RX
GND
RESET
3
4
5
9
10
14
16
17
18
21
22
24
25
26
3V3
5V
GND
Construction
Construction is quite simple and consists of just assembling the Micromite
LCD BackPack (which should take less
than an hour) then mounting and connecting the sensor module.
All three versions of the Micromite
LCD BackPack are available. V1 and
V2 are available in kits from our
preferred Micromite retailer: https://
micromite.org/product-category/kits/
A PCB for V3 is available from the
PE PCB Service (we no longer sell V1
or V2 PCBs).
The Micromite LCD BackPacks comprise about a dozen components, and
in each case, the PCB is printed with
the component placement and values.
So you simply populate the board and
attach a suitable LCD panel.
We have reproduced the Micromite
LCD BackPack V1 and V2 PCB overlay
diagrams below in Fig.2 and Fig.3 in
case you need them.
Full descriptions of building V1, V2
and V3 appeared in PE, May 2017, May
2018 and August 2020 respectively.
Note that CON1 and CON2 go on
the underside of the board. If in doubt
when it comes to assembling the Micromite LCD BackPacks, refer to the
relevant constructional article referred
to earlier.
All three versions of the Micromite
LCD BackPacks fit neatly into a standard UB3 plastic box (see parts list).
For the neatest appearance you can
purchase a laser-cut acrylic lid with
cutouts for the LCD and its mounting
screws. This lid is available from the
SILICON CHIP ONLINE SHOP for A$5 plus
shipping. It’s supplied in matte/gloss
5V
TX
RX
GND
your module
includes both sensors,
and preferably looks identical to
the one shown here.
This last part is important as there
are many sensor modules circulating
that claim to incorporate both sensors, but the images displayed by the
vendor show that the module does not
include the HDC1080 temperature and
humidity sensor. This is critical to the
correct operation of the device.
10k
Circuit description
The circuit of the Air Quality Monitor
basically consists of just two modules
connected together, as shown in Fig.1.
These are the Micromite LCD BackPack and the sensor module (with the
CCS811 and HDC1080 chips).
Both the CCS811 and HDC1080
communicate via I2C, so the sensor
module’s SCL (clock) and SDA (data)
pins are wired to the corresponding
I2C pins on the Micromite LCD BackPack. The module runs from 3.3V, so
its VCC pin goes to the 3.3V output on
the BackPack, and the GND pin is the
common ground.
The other pins on the sensor module
(for example, WAKE or ADDR) are not
used in our application so they can be
left unconnected.
The sensor module does not contain
many components besides the CCS811
and HDC1080 ICs; just a few pull-up
resistors and bypass capacitors. It is
also surprisingly small, barely large
enough to cover the tip of a finger.
The module that we used can
be found on eBay or AliExpress by
searching for the keywords CCS811
and HDC1080 together.
There are many modules on offer
that will match either of the keywords, so you need to make sure that
Manual
Backlight
VR1
100
Fig.3: use this overlay diagram instead if you’re building
the V2 BackPack. The main difference is the addition of the
Microbridge, IC2, which also must be oriented correctly.
You may receive three 10µF ceramic capacitors (their
orientations are not important) and one can be used in
place of the 47µF. If you’re building a V3 BackPack, refer to
the August 2020 issue or just follow the PCB silkscreen.
Practical Electronics | February | 2021
If using the laser-cut lid (see text), there are
only five extra holes required in the UB3 Jiffy box –
one for the power socket, as seen at left, and the others for
mounting the CCS811 sensor module. Two of these holes are
drilled to form a ‘figure 8’ hole which allows plenty of air circulation
to strike the sensor module (see right). The project can be powered from
a 5VDC regulated plugpack, from a computer’s USB socket or even from a
5V ‘powerbank’ to allow fully portable operation.
black (Cat SC3456; www.siliconchip.
com.au/Shop/19/3456) or clear (Cat
SC3337; www.siliconchip.com.au/
Shop/19/3337).
The laser-cut black lid can be fitted
either way around, so you can have
either a matte or gloss finish on the
lid’s outside.
Fig.4 provides the box mounting
details. The result is a neat looking
assembly with the display and BackPack securely fastened. The laser-cut
panel is thicker than the lid supplied
with the UB3 box (3mm), and it lacks
recesses, so the self-tapping screws
supplied with the box may or may not
be long enough. If they’re too short,
replace them with four 10mm-long 4G
self-tapping screws.
On the other hand, there is nothing
to stop you (carefully) cutting your
own holes in the lid supplied with
the UB3 box. It is tricky to make a
clean cut around the LCD screen, but
can be done. If you choose this route,
then make sure that no part of the box
is pressing on the surface of the LCD
as that will upset the touch sensitivity
of the panel.
M3 x 10mm BLACK
MACHINE SCREW
Final assembly
Use an M3 × 10mm machine screw on
each corner with a 1mm thick plastic
M3 washer and an M3 × 12mm tapped
spacer to attach the LCD panel to the
(acrylic) lid.
This ensures that the surface of the
LCD will be flush with the acrylic lid.
Then, the BackPack can be plugged
into the LCD and fastened by M3 ×
6mm machine screws to each spacer,
as shown in Fig.4.
The module with the CCS811 and
HDC1080 sensors typically comes
with an eight-pin header that is not
soldered to the board. So you need to
fit this, but make sure that the header
pins point out from the back (noncomponent) side of the board.
After you have cut two holes in
the box (for the two sensors), this arrangement will allow you to mount
the component side of the sensor
board close to the wall of the box. The
sensors will be next to the holes and
therefore sampling the freely circulating air outside the box.
The sensor module should be held
in place using two nylon M3 machine
screws, with a nut
between the sensor
ACRYLIC LID WITH CUT-OUT FOR LCD
(REPLACES ORIGINAL UB 3 BOX LID)
PCB and the inside wall of the case,
as shown in Fig.5.
This will space the components on
the sensor module slightly away from
the case wall, but still keep them close
enough that they are exposed to the
outside air.
We are currently experimenting
with several other air quality sensors
(ie, CO2 and particulate sensors). If
they work out, we will update the
BASIC program to incorporate them
in conjunction with the VOC sensor.
The VOC sensor module should
be mounted to one side of the case,
leaving space for the other modules
if later required.
The best method for connecting the
sensor module to the BackPack is to
use ‘DuPont’ jumper leads. These are
lengths of wire with single pin female
header sockets on each end. They are
designed to slip onto header pins like
those of the sensor module and Micromite LCD BackPack.
Example leads are those from Altronics (Cat P1017) or Jaycar (WC6026), or
just search eBay for ‘dupont jumper’.
Using these not only makes assembly easy, but you can also replace
the sensor module for testing or if the
CCS811 chip becomes contaminated.
Loading the software
The program running on the Micromite consists of three parts: the
MMBasic interpreter, the BASIC
program for the Air Quality Monitor
and the configuration settings for the
LCD panel.
The easiest method of loading all
three at once is to program the PIC32
chip with the file AirQuality.hex
which can be downloaded from the
February 2021 page of the PE website.
This is easy if you are using either
a V2 or V3 Micromite LCD BackPack,
as both of these include the capability to program the PIC32 chip (ie,
Micromite) with new firmware. If you
are using a V1, then you will need a
SC
20 1 9
TOUCH -SCREEN LCD
M3 x 12mm
TAPPED SPACER
M3 NYLON
WASHER
(1mm THICK)
M3 x 6mm
MACHINE SCREW
2.8-INCH LCD PCB
LASER-CUT
LID
LCD MODULE
NYLON M3 NUTS
NYLON M3
SCREWS
MICROMITE 2.8-INCH
BACKPACK PCB
SENSOR MODULE
UB3 CASE
Fig.4: this shows how the touchscreen, BackPack PCB and
laser-cut lid go together before the lid is attached to the UB3
Jiffy box base using four self-tapping screws. The screws
supplied with your Jiffy box may or may not be long
enough to go through the thicker laser-cut lid; if not, you
will need four No.4 × 10mm (or thereabouts) self-tappers.
Practical Electronics | February | 2021
HEADER PINS
HOLE CUT IN
THE CASE TO
ALLOW AIR TO
REACH SENSORS
Fig.5: the sensor module is mounted separately on the side of
the box and wired to the BackPack via its eight-pin header and
flying leads. Make sure the two sensor ICs sit adjacent to holes
drilled in the side of the box, so they can sample the air outside.
Note the nut between the sensor PCB and inside surface of the
case, so those sensors are not too close to the holes.
35
PIC32 programmer such as the PICkit
3 or PICkit 4.
This firmware file contains everything that you need, including the
MMBasic interpreter, the LCD configuration and the BASIC program for
the Air Quality Monitor. So as soon as
you load it, you’re ready to go.
But be aware that the touch calibration in the combined firmware and
BASIC program file was done using a
standard LCD panel. Therefore, your
unit might require display recalibration if it is significantly different from
the one that we used. Unfortunately,
we’ve seen panels with the touch sensor rotated 180° from others, and they
are not easy to tell apart!
Luckily, recalibration can be easily
performed by connecting the BackPack to a desktop or laptop computer
via USB, opening the serial port in a
terminal emulator, halting the program
with CTRL-C and re-running the calibration routine.
For further information on this procedure see the Micromite User Manual
(which can also be downloaded from:
https://geoffg.net/micromite.html
Alternatively, if you have a BackPack that’s already programmed with
the Micromite firmware, you can set up
the LCD screen (if that hasn’t already
been done), then load the Air Quality
Monitor BASIC code into it.
This file is named AirQuality.bas
and is part of the same download package for this project, from the February
2021 page of the PE website.
Power supply
The completed Air Quality Monitor
requires a 5V power supply with a
minimum capacity of 500mA.
You can use a 5V plugpack or a USB
charger. If you are using a plugpack,
make sure that it is regulated and that
its unloaded output does not rise above
5.5V, as that could cause damage.
We built the prototype with a DC
power socket (the barrel or ‘concentric’ type) for the incoming power,
mounted on the side of the UB3 box.
The two flying leads from this socket
were fitted with female header sockets and slipped over the BackPack’s
header pins.
The centre pin of the socket should
go to the 5V pin on CON1, while the
sleeve should connect to the pin
marked GND (ground).
That matches up with the most common plugpack wiring scheme, where
the inner barrel conductor connects to
the positive supply wire.
If you are using a USB charger as
the power supply, you can make up a
power cable by cutting off one end of
a standard USB cable while retaining
the Type A socket on the other end,
as shown in Fig 6. Then solder the
free end to a suitable DC power plug.
Most sockets have either a 2.1mm or
2.5mm inner pin, so make sure your
plug matches it; 2.5mm plugs will go
into 2.1mm sockets but won’t make
good contact!
The red wire in the USB cable (+5V)
should go to the centre pin of the plug
and the black to the sleeve. The other
two wires (the signal wires) can be cut
short as they are not used.
Alternatively, suitable ready-made
cables are available, such as a Jaycar
PP1985 or Altronics Cat P6701 (USB
Type A Male to 2.1mm DC Plug).
Testing
Before connecting the sensor board
to the Micromite LCD BackPack, you
should confirm that the BackPack
itself is working correctly. The testing procedure for this is described in
the Micromite User Manual and the
relevant PE articles referenced above.
It’s then simply a matter of connecting the sensor board and powering up
the whole gadget.
If it does not work straight away,
carefully check and re-check each
connection. Then measure the voltage across the pins marked VCC and
GND on the module; you should get a
reading very close to 3.3V.
Using the device
Using our Air Quality Sensor is quite
straightforward. You plug it into a
source of 5V DC power, and after a
warm-up period, it displays the air
quality as a number and draws a graph
showing how it changes over time.
The VOC reading is displayed in
parts per billion (ppb), in large digits
Parts list
Air Quality Monitor
1 Micromite LCD BackPack module with
2.8in LCD touchscreen (see text)
1 CCS811 air quality sensor module
with onboard HDC1080 temp/
humidity sensors (see text/photos)
1 UB3 Jiffy box (part WCAH2853 from
https://quasarelectronics.co.uk)
1 laser-cut lid for UB3 Jiffy box
(available from SILICON CHIP ONLINE
SHOP – see text)
1 5V DC 500mA+ regulated plugpack
OR
1 USB cable with a female 2.1mm
DC power connector on one end
[Altronics Cat P6701] AND
1 USB (5V) power supply
1 chassis-mount DC barrel power
socket, to suit the power cable
(2.1mm or 2.5mm inner diameter)
4 120mm-long DuPont female-female
jumper leads
2 120mm-long DuPont female-bare
wire leads
4 No.4 × 10mm self-tapping screws
4 M3 × 10mm tapped spacers
4 M3 × 10mm panhead machine screws
4 M3 × 6mm panhead machine screws
2 M3 × 6mm nylon panhead machine
screws
4 M3 Nylon hex nuts
4 1mm-thick nylon washers, 3-4mm
inner diameter
at the top of the screen, with the timebased graph below (see Screen1).
The graph’s vertical axis can be configured in steps from a very sensitive
500ppb full scale to 64,000ppb, while
the horizontal time scale can be set to
cover from 15 minutes to 32 hours.
When you build the Air Quality
Sensor and turn it on for the first time,
there is a burn-in period of 48 hours
that you need to observe.
This is necessary as the CCS811
sensor’s readings will drift considerably as surface contaminants from the
manufacturing process are burnt off
from the sensitive metal-oxide layer.
So, when you first turn it on, leave
it powered up and running for at least
two days before taking any readings.
You might be tempted to interpret
5V
4
Tx
3
2
Rx
1
USB CONNECTOR
TYPE A MALE
GND
DC PLUG
DC INPUT
SOCKET
(ON END OF BOX)
4-PIN FEMALE
HEADER
CONNECTOR
(OR DUPONT
POWER CABLE)
MICROMITE
CON 1 POWER
AND CONSOLE
CONNECTOR
Fig.6: here is our suggested method for powering the Air Quality
Monitor from a USB port or charger. You can make up the
USB-to-DC-plug cable, or you can buy one from Altronics (Cat P6701) or Jaycar (PP1985). Alternatively, use a 5V DC
regulated plugpack which will most likely already have a concentric plug with the right polarity (+ to centre).
36
Practical Electronics | February | 2021
Screen1: the main display shown
at power-up, with the current VOC
reading at the top and a graph of VOC
over time at the bottom. The graph’s
vertical scale can be configured from
500 to 64,000ppb, while the horizontal
scale can be adjusted to cover 15
minutes to 32 hours.
Screen2: touching the main screen takes
you to this setup screen. Here you can
adjust the graph parameters, set the VOC
baseline (the zero point for the CCS811
sensor), upgrade the CCS811’s firmware
and set the screen brightness. The raw
data from the CCS811 and HDC1080
sensors is shown at the top of this screen.
its readings during this period, but it
will be meaningless until the burn-in
period has run its course.
Another requirement of the CCS811
is that it needs a 20-minute warm-up
period every time power is applied.
This is different from the initial burnin period and applies whenever the Air
Quality Monitor is turned on.
During this period, the BASIC program displays a countdown. You can
skip it if you wish, but like the original
48-hour burn-in, it is much better to
let the sensor stabilise. Otherwise, the
readings could be nonsense.
The temperature reading made by
the HDC1080 is supposedly accurate
to within ±0.2°C, but we found that in
practice, it was high by a few degrees.
This is likely due to its proximity to
the CCS811 sensor, which has an onboard heater.
Despite this, it is accurate enough for
its primary purpose, which is to allow
the CCS811 to compensate for variations in temperature and humidity.
Setup screen
To access the setup screen from the
main screen, touch anywhere on the
LCD panel.
This will take you to a display where
you can see the raw readings from the
sensor and configure things like the
graph’s parameters (see Screen2).
Raw data from the sensor module
is shown at the top of this screen.
The VOC reading is the same as that
on the main screen, but there is also
a CO2 reading. This is an estimate of
the amount of CO2 in parts-per-million
(ppm) that would be present in the air
if the measured VOCs were created by
human respiration.
The CCS811 sensor calculates the
CO2 reading, but it does not necessarily relate to the actual level of CO2,
because the VOC reading used for this
estimate could be partly or wholly
due to other processes (eg, paint drying). Regardless, the CCS811 sensor
produces this reading so we display
it on this screen for you.
The temperature (°C) and humidity (%RH) readings come from the
HDC1080 temperature/humidity
sensor that is included on the sensor
module. They are used by the CCS811
to give an accurate VOC reading, as
mentioned earlier.
Practical Electronics | February | 2021
Graph parameters
There are two buttons below the raw
readings on the setup screen that allow
you to change the parameters for the
graph on the main screen.
The ‘Vert Scale’ button shows the
current vertical scale for the graph
in parts-per-billion (ppb). Repeatedly
touching this button will step you
through a sequence of full-scale values
from 500ppb to 64,000ppb.
This setting is automatically saved
by the BASIC program and will be
reloaded when the Air Quality Monitor
is next powered up.
Similarly, the ‘Time Scale’ button
selects the horizontal time scale for
the graph. Repeatedly touching this
button will step you through various
time scales from 15 minutes (full scale)
to 32 hours. This setting is also saved
for the next power-up.
There are also buttons on the setup
screen to set the baseline (zero)
reading, update the firmware in the
CCS811 and set the screen brightness. Finally, to exit the setup screen,
touch the ‘Exit’ button to return to
the main screen.
Setting the baseline
The CSS811 documentation refers to
‘Manual Baseline Correction’, which
in effect means determining the zero
point for the VOC reading.
The MOX sensor used in the CCS811
(see the earlier panel for a description)
Screen3: this screen allows you to
set the baseline (zero point) for the
CCS811 sensor. Initially, this should
be done once a week, but after a
couple of months, the baseline will
only need to be set once a month.
can be contaminated over time, causing
the zero point to drift.
The manufacturer recommends that
the baseline should be set once a week
for the first couple of months of use,
and from then on, the baseline will
only need to be set once a month.
To set the baseline, place the device
outside in clean air and touch the
‘Baseline’ button on the setup screen
(see Screen3).
The BASIC program will step
through this process which involves
waiting for the sensor to stabilise from
the power-on condition (20 minutes),
then allowing the sensor to determine
the baseline over a 10-minute period.
This baseline is saved in non-volatile
memory by the BASIC program and
copied to the CCS811 every time the
power is turned on.
This is necessary because, without
this bit of information, the CCS811
will essentially be forced to ‘guess’
the baseline.
At the conclusion of this process,
the Air Quality Monitor will return to
the main screen showing the reading
and graph.
Updating the CCS811 firmware
The CCS811 sensor is quite a complicated device, and it includes a
microcontroller, which is used to
measure the resistance of the MOX
sensor, control the heater and many
other functions.
At the time of writing, the latest
version of the firmware for the CCS811
is V2.0.1. However, many modules
manufactured in China are still using
sensors running V1.1.0 firmware or
even earlier versions.
The V2.0.1 firmware incorporates
an improved algorithm for the VOC
calculation, and the range of readings
has been extended to 64,000ppb VOC
(the old firmware limited the sensor to
a maximum of 1187ppb VOC).
This firmware can be updated by
the BASIC program running on the
37
If you have an earlier version of the
Micromite LCD BackPack, you will
need a separate USB-to-serial converter
(they are cheap). All the details on this
are also in the Micromite User Manual.
Screen4: you can update the CCS811
sensor firmware to the latest version
(V2.0.1) using this screen. Touching the
‘Update’ button initiates the upgrade
(takes under 30s). You don’t need a
firmware file or anything else for this
operation; everything is contained within
the Micromite BASIC program.
Screen5: this screen allows you to set
the display brightness and also the
auto-dimming feature, which has the
benefit of reducing the unit’s power
consumption. If your BackPack only
supports manual display brightness
adjustment (ie, using a trimpot) then
these settings will do nothing.
Micromite. This is done by touching the
‘Firmware’ button on the setup screen.
You will then be taken to a screen
which displays the current version of
the firmware running on the CCS811
and an offer to update it (see Screen4).
Touching the ‘Update’ button will
initiate the upgrade process, which
takes less than 30 seconds. Note that
you do not need a firmware file or anything else for this operation; everything
is contained within the BASIC program
running on the Micromite.
After this process, the Air Quality
Monitor restarts with the new firmware
running in the CCS811.
you can set a time period and a second
brightness level which applies after
no activity.
This is useful if you are using the Air
Quality Monitor in a bedroom at night,
or if you are running it from a battery.
The auto-dimming function operates
when the main screen (with graph)
is displayed and if it has dimmed,
touching anywhere on the screen will
restore full brightness. A second touch
will then take you to the setup screen.
Setting the screen brightness
As mentioned above, recent versions
of the Micromite LCD BackPack (V2
onwards) include the ability to control the brightness of the screen from
within the BASIC program.
You can control this by selecting
the ‘Brightness’ button on the setup
screen. If your LCD BackPack only
supports manual adjustment of the
brightness (ie, a trimpot), this setting
will do nothing.
On the brightness screen (shown
in Screen5), repeatedly pressing the
‘Brightness’ button will step you
through a range of brightness levels
from 10% to 100% in 10% steps. If you
enable the ‘Auto Dimming’ checkbox,
Updating the BASIC program
One of the great features of the Micromite is that it is easy for you to get in
there and modify or update the BASIC
program that provides this instrument with its unique functions. This
program is stored on the chip in clear
text, so you can do things like change
colours, menu choices and other features as you wish.
If you are using V2 or V3 of the Micromite LCD BackPack, this is as easy
as plugging your desktop PC or laptop
into the USB socket and running a
terminal emulator on your computer.
Typing CTRL-C into the terminal editor will interrupt the running program
and display the command prompt at
which point you edit the program using
the EDIT command. This is covered in
detail in the Micromite User Manual,
so we will not go into detail here.
Micromite LCD BackPack versions
There are three generations of the Micromite LCD BackPack, and all will work in the Air
Quality Monitor using the same software. The main difference in this application is that
Version 1 only has manual brightness control, so the Air Quality Monitor firmware can
not control its brightness.
The others (V2 and V3) have optional software control of the LCD backlighting, so if
the appropriate components are installed, you can adjust its brightness via the settings
screen. This also enables the auto-dimming feature.
The V2 and V3 BackPacks also have an onboard USB/serial and PIC32 programming
interface called the Microbridge.
38
Battery operation
You might want to power the Air
Quality Monitor from a battery, so it’s
truly portable. This would allow you
to make a quick survey of a large office
space or house.
The best option for this is to use a
USB ‘power bank’ as sold for recharging mobile phones while on the go.
These have everything that you need
in a portable power source, including
a charging circuit, protection circuits
and a regulated 5V output.
Even better, because they are a common item in mobile phone shops, they
are quite cheap. They cost much less
than the parts that you would need to
build a similar device yourself!
The most significant power drain
in the Air Quality Monitor is the LCD
screen backlighting. That alone can consume up to 250mA at full brightness.
This is one of the reasons for the
auto-dimming feature described earlier; with that enabled, you can reduce
the brightness of the display to (say)
10% after a short period of inactivity.
This reduces the current drawn by
the backlight to about 25mA, essentially
halving the unit’s power consumption.
For the record, the Micromite draws
about 26mA and the CCS811/HDC1080
sensors combined about the same. So,
with the displayed dimmed to 10%,
the total drain on the battery should
be about 80mA, or about 2Ah/day. A
5000mAh power bank should last for
two days of continuous operation.
However, consider that the actual
energy delivered is lower than rated,
due to the difference between the average battery voltage of 3.7V and the
output voltage of 5V, and the voltage
conversion is less than 100% efficient.
Don’t forget that many cheap power
banks grossly overstate their capacity!
For truly portable use, you would
ideally incorporate the power bank
into the case. That would require you
to use a larger box and to add an on/
off switch.
Some of the smaller cylindrical
power banks could fit into the UB3 box
and still provide sufficient capacity for
many hours of use. The details of these
modifications are something that we
will leave as an exercise for the reader.
Firmware updates
For firmware updates for the Micromite
and the BASIC program for the Air
Quality Monitor, check the author’s
website at http://geoffg.net
Practical Electronics | February | 2021
|