Silicon ChipIndoor Air Quality Monitor based on a Micromite BackPack - February 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: IoT is a security nightmare
  4. Feature: Underground mapping, leak detection & pipe inspection by Dr David Maddison
  5. Project: Remote monitoring station messages or emails by 4G! by Tim Blythman
  6. Review: chipKIT’s new “Lenny” by Tim Blythman
  7. Project: Indoor Air Quality Monitor based on a Micromite BackPack by Geoff Graham
  8. Serviceman's Log: When in doubt, swap it out by Dave Thompson
  9. Project: Low distortion, two-channel DDS audio signal generator by Phil Prosser
  10. Feature: El Cheapo modules: 8-channel USB Logic Analyser by Jim Rowe
  11. Product Showcase
  12. Project: Building the new “bookshelf” stereo speakers, Pt 2 by Phil Prosser
  13. Vintage Radio: 1946 Tecnico-Aristocrat Model 651 by Associate Professor Graham Parslow
  14. Subscriptions
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Digital Lighting Controller, October-December 2010; DSP Active Crossover, May-July 2019; Super-9 FM Radio, November & December 2019
  19. Outer Back Cover

This is only a preview of the February 2020 issue of Silicon Chip.

You can view 38 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Remote monitoring station messages or emails by 4G!":
  • 4G Remote Monitoring Station Power Control Shield PCB [27111191] (AUD $5.00)
  • Firmware (Arduino Sketch) for the 4G Remote Monitoring Station (Software, Free)
  • 4G Remote Monitoring Station Power Control Shield PCB pattern (PDF download) [27111191] (Free)
Items relevant to "Indoor Air Quality Monitor based on a Micromite BackPack":
  • PIC32MX170F256B-50I/SP programmed for the Indoor Air Quality Monitor [AirQuality.hex] (Programmed Microcontroller, AUD $15.00)
  • Micromite LCD BackPack V2 complete kit (Component, AUD $70.00)
  • Firmware (HEX) files and BASIC source code for the Indoor Air Quality Monitor [AirQuality.hex] (Software, Free)
Items relevant to "Low distortion, two-channel DDS audio signal generator":
  • DSP Crossover CPU PCB [01106193] (AUD $5.00)
  • DSP Crossover LCD Adaptor PCB [01106196] (AUD $2.50)
  • DSP Crossover front panel control PCB [01106195] (AUD $5.00)
  • Low-distortion DDS complete PCB set (5 boards) [01106192-6] (AUD $20.00)
  • DSP Crossover DAC PCB [01106192] (AUD $7.50)
  • DSP Crossover power supply PCB [01106194] (AUD $7.50)
  • PIC32MZ2048EFH064-250I/PT programmed for the Low-distortion DDS Signal Generator (Programmed Microcontroller, AUD $30.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • ST7920 driver for PIC32MZ projects (Software, Free)
  • Firmware and source code for the Low-distortion DDS Signal Generator (Software, Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Building the new “bookshelf” stereo speakers, Pt 2":
  • Bookshelf Speaker Passive Crossover PCB [01101201] (AUD $10.00)
  • Bookshelf Speaker Subwoofer Active Crossover PCB [01101202] (AUD $7.50)
  • Bookshelf Speaker Passive and Active Crossover PCB patterns (PDF download) [01101201-2] (Free)
  • Bookshelf Speaker System timber and metal cutting diagrams (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Easy-to-build Bookshelf Speaker System (January 2020)
  • Easy-to-build Bookshelf Speaker System (January 2020)
  • Building the new “bookshelf” stereo speakers, Pt 2 (February 2020)
  • Building the new “bookshelf” stereo speakers, Pt 2 (February 2020)
  • Building Subwoofers for our new “Bookshelf” Speakers (March 2020)
  • Building Subwoofers for our new “Bookshelf” Speakers (March 2020)
  • Stewart of Reading (October 2023)
  • Stewart of Reading (October 2023)
  • Stewart of Reading (November 2023)
  • Stewart of Reading (November 2023)
  • ETI BUNDLE (December 2023)
  • ETI BUNDLE (December 2023)
  • Active Subwoofer For Hi-Fi at Home (January 2024)
  • Active Subwoofer For Hi-Fi at Home (January 2024)
  • Active Subwoofer For Hi-Fi at Home (February 2024)
  • Active Subwoofer For Hi-Fi at Home (February 2024)

Purchase a printed copy of this issue for $10.00.

Putting your Touchscreen Micromite BackPack to work... INDOOR 'POOR AIR QUALITY' MONITOR By Geoff Graham Do you sometimes get the impression that the air in your office or home is rather “stuffy”? That can be rather subjective – but there is an objective way to measure air quality. That is with a volatile organic compound (VOC) meter. The mighty Micromite BackPack and a cheap module make building one of these dead easy! Now you really can find out whether you are being impacted by “Sick Building Syndrome”. 44 44  S Silicon Chip Australia’s Australia’s electronics electronics magazine magazine siliconchip.com.au NOTE : Th specificall is monitor is y volatile for indoor airborn It does NO organic compounds e T me . ticulate asure airborne p Given the s, such as smoke. arhig smoke rec h levels of bushfire e shortly loontly, we hope to ka sensors in t alternative measure p tended to articulates . There are no switches: all controls are based on the Micromite BackPack touch screen, The CCS811 Air Sensor can be seen on the top right of the Jiffy Box. A reading of 53 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 metal oxide (MOX) sensor made by ams AG, Austria, to measure the total VOC level 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 an inexpensive (~$15) fullyassembled 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 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. See the panel 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 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 metal oxide surface to react with this gas. This frees the 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. In a modern sensor, the whole structure siliconchip.com.au Australia’s electronics magazine February 2020  45 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. below which lists which issues these articles appeared in, with links to the online versions and the respective kits. 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.8in 320x240 LCD screen in mind, so if you build V3 with a larger 3.5in 480x320 display, you will have to modify the software to suit. The program controlling the Air Quality Monitor is written in the easy-to-use BASIC programming language, so you are free to get in there and modify it to suit your preferences. But we don’t suggest that you undertake the job of modifying the software for the 3.5in 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. 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 naturallyoccurring 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, 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 are semivolatile 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 by-product 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 LCD DISPLAY MODULE WITH TOUCH SCREEN DC POWER SOCKET RED BLACK CON3 GND RX TX 5V GND +5V VCC GND CCS811+ HDC1080 GAS SENSOR MODULE +3.3V 26 SCL 25 SDA 24 WAKE 22 INT 21 RST 18 ADDR MICROMITE LCD BACKPACK 17 16 14 10 Volatile organic compounds 9 5 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) refers to 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. 46 Australia’s electronics magazine Silicon Chip SC 20 1 9 MICROMITE AIR QUALITY MONITOR 4 3 RESET siliconchip.com.au 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. 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. The Micromite-based Air Quality Monitor before it is put into its Jiffy box, ICSP CON4 47 F 1 http://geoffg.net/micromite.html 07102122 USB CON3 LCD Backlight 100 VR1 S1 10 F 5V TX RX GND CON1 (UNDER) + 100nF 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. siliconchip.com.au 10k 1k CON4 47 F + + A 100nF S1 RESET LED1 10 F + (UNDER) 10 F REG1 MCP1700-3302E IC1 PIC 32 MX170F256B-50I/SP 2.8-Inch Micromite LCD BackPack CON2 10 F 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 (UNDER) + 1 + (UNDER) JP1 CON1 Construction is quite simple and consists of just assembling the Micromite LCD BackPack (which should take less than an hour) then mounting 10k CON2 Construction IC2 PIC16F1455-I/P RESET 3 4 5 9 10 14 16 17 18 21 22 24 25 26 3V3 5V GND 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) 5V TX RX GND Circuit description There are many modules on offer that will match either of the keywords, so you need to make sure that 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. RESET 3 4 5 9 10 14 16 17 18 21 22 24 25 26 3V3 5V GND 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 (WAKE, ADDR etc) 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. 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 orientated 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 2019 issue or just follow the PCB silkscreen. Australia’s electronics magazine February 2020  47 If using the laser-cut lid from the SILICON CHIP ONLINE SHOP (see parts list opposite), 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. and connecting the sensor module. All three versions of the BackPack are available as more-or-less complete kits from the SILICON CHIP ONLINE SHOP: • Original BackPack kit Cat SC3321, $65 + postage: siliconchip.com.au/Shop/20/3321 • V2 BackPack kit Cat SC4237, $70 + postage: siliconchip.com.au/Shop/20/4237 • V3 BackPack kit Cat SC5082, $75 + postage: siliconchip.com.au/Shop/20/5082 (note: comes with 3.5in LCD screen) These kits do not include a box, power supply or cables. But they have everything you need to build the BackPack module. The BackPacks comprise about a dozen components, and in each case, the PCB is printed with the component placement and values. So it is simply a case of populating the board and attaching a suitable LCD panel. We have reproduced the BackPack M3 x 10mm BLACK MACHINE SCREW V1 and V2 PCB overlay diagrams here (Figs.2 & 3) in case you need them. Note that CON1 & CON2 go on the underside of the board. If in doubt when it comes to assembling the BackPack, refer to the relevant constructional article referred to earlier. All three versions of the BackPack fit neatly into a standard UB3 plastic box. All of the kits mentioned above come with a laser-cut lid for the UB3 jiffy box with a rectangular hole for the touchscreen, but you need to purchase the jiffy box itself separately. 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. If you don’t buy one of our kits, you can still get the custom lid from the SILICON CHIP ONLINE SHOP for $5 plus p&p. It’s available in matte/gloss black (Cat SC3456; www.siliconchip. com.au/Shop/19/3456) or clear (Cat SC3337; www.siliconchip.com.au/ Shop/19/3337). The black lid can be fitted either way around, so you can have either a matte or gloss finish on the outside. The kits have the same choice of lid colour. You can cut your own holes in the lid supplied with the UB3 box, but it is tricky to make a clean cut around the LCD screen. If you choose this route, 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. Final assembly Use an M3 x 10mm machine screw on each corner with a 1mm thick plastic ACRYLIC LID WITH CUT-OUT FOR LCD (REPLACES ORIGINAL UB 3 BOX LID) 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 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 x 10mm (or thereabouts) self-tappers. 48 Silicon Chip LASER-CUT LID LCD MODULE 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. Australia’s electronics magazine siliconchip.com.au M3 washer and an M3 x 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 x 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 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. So 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 LCD BackPack. Parts list – Air Quality Monitor 1 Micromite LCD BackPack module with a 2.8in LCD touchscreen (eg, built from a SILICON CHIP kit – see text) 1 CCS811 air quality sensor module with onboard HDC1080 temperature and humidity sensors (see text and photos) 1 UB3 Jiffy box 1 laser-cut lid for UB3 Jiffy box (included with kits or 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 x 10mm self-tapping screws 4 M3 x 10mm tapped spacers 4 M3 x 10mm panhead machine screws 4 M3 x 6mm panhead machine screws 2 M3 x 6mm Nylon panhead machine screws 4 M3 Nylon hex nuts 4 1mm-thick Nylon washers, 3-4mm inner diameter You can get these from Altronics (Cat P1017) or Jaycar (WC6026), or 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 SILICON CHIP website. This is easy if you are using either a V2 or V3 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 BackPack, then you will need a PIC32 programmer such as the PICkit 3 or PICkit 4. If you do not have such a gadget, you can purchase a fullyprogrammed microcontroller from the SILICON CHIP ONLINE SHOP. 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. So 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 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). siliconchip.com.au Australia’s electronics magazine February 2020  49 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 also shown at the top of this screen. 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. 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 the SILICON CHIP website). 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 SILICON CHIP website. 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). Using the device 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 50 Silicon Chip 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 SILICON CHIP articles linked 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. Australia’s electronics magazine 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, in large digits at the top of the screen, with the time-based graph below (see Screen1). The vertical axis of the graph 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 its readings during this period, but it will be futile 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 siliconchip.com.au Screen4: you can update the firmware inside the CCS811 sensor to the latest version (V2.0.1) using this screen. Touching the “Update” button will initiate the upgrade, which takes less than 30 seconds. You do not need a firmware file or anything else for this operation as everything is contained within the BASIC program running on the Micromite. 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 LCD BackPack only supports manual display brightness adjustment (ie, using a trimpot) then these settings will do nothing. 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. 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. The temperature reading made by the HDC1080 is supposedly accurate to within ±0.2°C, but we found that in siliconchip.com.au 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). Repeated- ly 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 (Metal Oxide) sensor used in the CCS811 (see the earlier panel for a description) 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 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 & 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 & V3 BackPacks also have an onboard USB/serial and PIC32 programming interface called the Microbridge. See: • Version 1: February 2016 (www.siliconchip.com.au/Article/9812) V1 kit Cat SC3321, $65 + postage (www.siliconchip.com.au/Shop/20/3321) • Version 2: May 2017 (www.siliconchip.com.au/Article/10652) V2 kit Cat SC4237, $70 + postage (www.siliconchip.com.au/Shop/20/4237) • Version 3: August 2019 (www.siliconchip.com.au/Article/11764) V3 kit Cat SC5082, $75 + postage (www.siliconchip.com.au/Shop/20/5082)                [comes with 3.5in LCD screen] We also published the Micromite Plus LCD BackPack in the November 2016 issue (siliconchip.com.au/Article/10415). However, we have not tried to run the Air Quality Monitor BASIC program on this version of the BackPack. It may work as-is or might require some changes. There are no apparent advantages to using the Plus BackPack for this project. Australia’s electronics magazine February 2020  51 “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 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. Setting the screen brightness As mentioned above, recent versions 52 Silicon Chip 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, you can set a time period and a second brightness level which applies after that long with 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. 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 (downloadable from the SILICON CHIP website), so we will not go into detail here. 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 in the Micromite User Manual. Battery operation You might want to power the Air Quality Monitor from a battery, so it’s truly portable. This would allow you Australia’s electronics magazine 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 itself draws about 26mA and the CCS811 and 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. So a 5000mAh power bank should last for around 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 SC siliconchip.com.au