Silicon ChipTouchscreen Altimeter and Weather station - December 2017 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Australia's strength in manufacturing
  4. Feature: Rail Guns and Electromagnetic Launchers by Dr David Maddison
  5. Project: Touchscreen Altimeter and Weather station by Jim Rowe
  6. Feature: Interfacing with the Raspberry Pi – for Beginners by Andrew Pullin
  7. Project: The Arduino MegaBox from Altronics by Bao Smith
  8. Product Showcase
  9. Review: Music Hall mmf-1.3 Belt-Driven Turntable by Leo Simpson
  10. Serviceman's Log: Video trials and tribulations by Dave Thompson
  11. Project: Build your own Super-7 AM Radio Receiver – Part 2 by John Clarke
  12. Feature: El Cheapo Modules 11: Pressure/Temperature Sensors by Jim Rowe
  13. Subscriptions
  14. Project: Part 3: Finishing our new 6GHz+ Digital Frequency Meter by Nicholas Vinen
  15. PartShop
  16. Vintage Radio: Roberts R66 4-valve 2-band portable by Marc Chick
  17. Market Centre
  18. Notes & Errata: 50A Charger Controller, Nov16; Deluxe Touchscreen eFuse, Jul17; Universal Battery Valve Power Supply, Aug17; 3-way Active Crossover, Sept & Oct17; Kelvin the Cricket, Oct17; Circuit Notebook: Modifications to Universal Battery Valve Power Supply, Oct17; 6GHz+ Touchscreen Frequency Meter, Oct-Dec17; Super-7 AM Radio, Nov17
  19. Advertising Index
  20. Outer Back Cover

This is only a preview of the December 2017 issue of Silicon Chip.

You can view 38 of the 104 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 "Touchscreen Altimeter and Weather station":
  • PIC32MX170F256B-50I/SP programmed for the Touchscreen Altimeter/Weather Station (Programmed Microcontroller, AUD $15.00)
  • GY-68 Barometric Pressure/Altitude/Temperature I²C Sensor breakout board (Component, AUD $2.50)
  • DHT22/AM2302 Compatible Temperature and Humidity sensor module (Component, AUD $9.00)
  • Elecrow 1A/500mA Li-ion/LiPo charger board with USB power pass-through (Component, AUD $25.00)
  • Micromite LCD BackPack V2 complete kit (Component, AUD $70.00)
  • Firmware (HEX) and BASIC source code for the Touchscreen Altimeter/Weather Station (Software, Free)
  • Altimeter/Weather Station front panel artwork (PDF download) (Free)
Items relevant to "The Arduino MegaBox from Altronics":
  • Firmware (Arduino sketch) for the LC Meter (Mega Box) (Software, Free)
  • Firmware (Arduino sketch) for the VS1053 Music Player (Mega Box) (Software, Free)
Articles in this series:
  • The Arduino MegaBox from Altronics (December 2017)
  • The Arduino MegaBox from Altronics (December 2017)
  • Arduino LC Meter Shield Kit (January 2018)
  • Arduino LC Meter Shield Kit (January 2018)
  • The Arduino Mega Box Music Player revisited (February 2018)
  • The Arduino Mega Box Music Player revisited (February 2018)
  • Altronics New MegaBox V2 Arduino prototyping system (December 2019)
  • Altronics New MegaBox V2 Arduino prototyping system (December 2019)
Items relevant to "Build your own Super-7 AM Radio Receiver – Part 2":
  • Super-7 AM Radio PCB [06111171] (AUD $25.00)
  • Case pieces for the Super-7 AM Radio (PCB, AUD $25.00)
Articles in this series:
  • Build the Super-7 – a single-board AM radio receiver (November 2017)
  • Build the Super-7 – a single-board AM radio receiver (November 2017)
  • Build your own Super-7 AM Radio Receiver – Part 2 (December 2017)
  • Build your own Super-7 AM Radio Receiver – Part 2 (December 2017)
Items relevant to "El Cheapo Modules 11: Pressure/Temperature Sensors":
  • GY-68 Barometric Pressure/Altitude/Temperature I²C Sensor breakout board (Component, AUD $2.50)
  • GY-BM BMP280 module (Component, AUD $5.00)
  • GY-BME280 Barometric Pressure/Altitude/Temperature/Humidity I²C Sensor breakout board (Component, AUD $12.50)
  • GY-BME280 module (6-pin/3.3V version) (Component, AUD $10.00)
  • Software for El Cheapo Modules: GY-68 (BMP180) (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 "Part 3: Finishing our new 6GHz+ Digital Frequency Meter":
  • 6GHz+ Touchscreen Frequency Counter PCB [04110171] (AUD $10.00)
  • Short Form Kit for the Micromite Plus Explore 100 (Component, AUD $75.00)
  • Case pieces for the 6GHz+ Frequency Counter (PCB, AUD $15.00)
  • Software for the 6GHz+ Touchscreen Frequency Counter (v1.01) (Free)
Articles in this series:
  • 0.01Hz - 6+GHz touchscreen frequency meter, Part 1 (October 2017)
  • 0.01Hz - 6+GHz touchscreen frequency meter, Part 1 (October 2017)
  • Touch-screen 6GHz+ Frequency Counter, part II (November 2017)
  • Touch-screen 6GHz+ Frequency Counter, part II (November 2017)
  • Part 3: Finishing our new 6GHz+ Digital Frequency Meter (December 2017)
  • Part 3: Finishing our new 6GHz+ Digital Frequency Meter (December 2017)

Purchase a printed copy of this issue for $10.00.

by Jim Rowe (no, that’s not him flying . . .) Build this Touchscreen Altimeter for hang-gliders, etc With full WEATHER REPORTING on board! This accurate altimeter has a bright colour touchscreen to display altitude in feet or metres, atmospheric pressure, temperature and relative humidity. It can show all readings at once or provide a larger display for altitude – the most important one if you’re flying! I t’s especially useful for hanggliders, where the touchscreen facility is most useful. Some ultralights, too, have a dearth of cockpit instruments – just take this one along with you when you fly! And you can use a solar panel to keep the battery charged on long flights. Our first altimeter was featured back in 1991 and since then sensor technology has changed radically and become much, much cheaper. Apart from being based on our popular Micromite Touchscreen, our Touchscreen Altimeter uses two tiny electronic modules which have been recently reviewed in SILICON CHIP: the Elecrow GY-68 digital barometer mod24 Silicon Chip ule (it’s elsewhere in this issue) and the AM2302/DHT22 temperature and humidity module (February 2017). Of course, even if you have no intention of leaving the Earth’s surface, this project will also provide a useful weather station display with the advantage of Touchscreen control. And if you ever decide to climb Mt Everest, this little unit can even cater for that extreme: the summit of Mt Everest is reckoned at 8848m above sea level (we go up to 9000m!) and our temperature goes all the way down to -40°C (Everest seldom goes this low during the climbing season). Battery charge may be slightly problematical – best take a solar charger Celebrating 30 Years panel with you! By the way, we are well aware that you can purchase various weather stations with colour displays very cheaply. But they don’t have the touchscreen facility nor the ability to simply highlight one reading, such as temperature. Presentation The Altimeter is housed in two small plastic cases, one for the Touchscreen Micromite BackPack and the other for the two sensor modules. The larger UB3 case is 130 x 68 x 43mm (LxWxH) and houses the Touchscreen Micromite BackPack, together with the single 18650 lithium-ion cell which powers the project and the Elecrow charger/ siliconchip.com.au Specifications Altitude range:............................................ 0-9000m (0-29520ft) above MSL or GND, with 1m resolution and ±1m accuracy Temperature range: ................................... -40°C to +80°C, with 0.1°C resolution and ±0.5°C accuracy Relative Humidity measuring range:......... 0 to 100%, with 1% resolution and ±2% accuracy Barometric Air Pressure range: .................. 300-1100hPa (mBar), with 0.1hPa resolution and ±0.12hPa accuracy*       *between 950 and 1050hPa, at 25°C Power requirements: .................................230mA at 5V, (380mA at 3.7V from inbuilt 18650 Li-Ion cell) upconverter module (reviewed in SILICON CHIP, August 2017 – www. siliconchip.com.au/Article/10754). The smaller UB5 case measures 83 x 54 x 31mm (LxWxH) and houses the two sensor modules. The two cases are connected together via multi-way cable, which can be as short or as long as needed to suit your purpose. So why have two cases instead of one? We tried using a single larger case but it had problems with internal heat build-up which compromised the reading accuracy. More on this anon. Circuit details Fig.1 shows how all the modules are connected together. Starting with the DHT22/AM2302 temperature and RH module, we won’t go into its operation in great depth here since we covered this in detail in the February 2017 article (pages 46-48 – www.siliconchip.com.au/ Article/10529). The main things to know are that it has its own dedicated 8-bit microcon- troller, to measure relative humidity via a special polymer capacitor and temperature via a negative temperature coefficient (NTC) thermistor. Each time the micro uses these to take a set of measurements, it calculates the corresponding temperature and relative humidity (RH) and sends them out as a serial 40-bit data package via the DATA line. The data is encoded using a special pulse-width-modulation system and this is decoded by the Micromite and displayed on the touchscreen. Fig.1: the Altimeter is based on two low-cost modules, one measuring barometric pressure and the other temperature and relative humidity. Their readings are monitored by a Touchscreen Micromite BackPack which displays the data on a touchscreen readout. An 18650 cell supplies power, itself kept charged by a mini solar/USB charger. siliconchip.com.au Celebrating 30 Years December 2017  25 Here’s the display in Altimeter mode. The green text shows the altitude units (metres or feet) and the reference level (MSL or GND). Barometric Pressure and Altitude Basically, atmospheric pressure is due to the weight of air immediately above your location. The primary SI unit for pressure is the Pascal (Pa), which is equivalent to a force of 1 Newton per square metre. A column of air one square centimetre in cross section, measured from sea level to the top of the Earth’s atmosphere, has a mass of about 1.03kg and a weight of 10.1325N. This corresponds to a pressure of 101,325Pa or 1013.25hPa (hectoPascals), since 1hPa = 100Pa. So the ‘standard atmosphere’ is defined as 1013.25hPa. The actual barometric pressure at any particular location depends upon its elevation, or altitude, with respect to mean sea level (MSL), because the higher the elevation, the lower the weight of air directly above you and the lower the pressure. It also depends on various aspects of the weather, including the amount of moisture in the atmosphere – ie, the relative humidity (RH). The relationship between air pressure and altitude is usually defined as the Barometric Formula. This can be written as: where altitude is in metres, P is the measured air pressure and Po is the air pressure at MSL, or 1013.25hPa. If you substitute 1013.25 for P in the above formula, the result will be 0 metres which is MSL. 26 Silicon Chip When you touch the button at the bottom of either of the other displays, this ‘Change Settings’ display appears, allowing you to make changes. Here’s the display in Weather Station mode. Again, you can touch the button at the bottom to change any of the settings or switch to Altimeter mode. Every DHT22/AM2302 module is calibrated during manufacture with its calibration coefficients saved in its micro’s one-time programmable memory. These coefficients are used to achieve impressive levels of measurement resolution and accuracy. The RH measurement range is from 0-100%, with rated resolution of 0.1% and an accuracy of ±2%, while the temperature measurement range is from -40 to +80°C with a resolution of 0.1°C and an accuracy of ±0.5°C. The Elecrow GY-68 barometer-altimeter-temperature sensor module is based on the BMP180 device made by Bosch Sensortec, a division of the large German firm Robert Bosch GmbH. (www.boschsensortec.com) The BMP180 is based on piezo-resistive MEMS technology, where MEMS stands for ‘MicroElectroMechanical Systems’. It uses a tiny sensor element which flexes mechanically in response to changes in atmospheric pressure, with the flexing sensed by measuring changes in the element’s resistance. The BMP180 chip is fitted inside a tiny 3.6 x 3.8 x 0.93mm metal package, which has a very small vent hole (about 0.5mm diameter) in the top to allow the sensor element access to the outside air. Apart from the sensor element, there are three other functional blocks inside the device: an ADC (analog to digital converter) to make the measurements, a control unit which also provides the I2C serial interface for communicating with an external micro, and finally an EEPROM which has 22 bytes of storage for the device’s 11 x 16-bit calibration parameters. As with the DHT22/AM2302, every BMP180 device is individually calibrated during manufacture and the calibration parameters are saved in its EEPROM. So the external micro can read these parameters and use them to correct that sensor’s readings for offset, temperature dependence and other factors. With suitable software, the BMP180 can provide high accuracy measurements of barometric pressure, temperature and altitude above mean sea level (MSL). The quoted relative accuracy for atmospheric pressure is ±0.12hPa (hectoPascals) from 950-1050hPa at 25°C, while the absolute accuracy is quoted as -4/+2hPa over the range from 3001100hPa and for temperatures from 0-65°C. All this comes from a chip which only draws about 12µA from the +5V supply! Both sensing modules have the ability to measure air temperature. We’re taking advantage of this in our Altimeter project, as the software for the Micromite takes the average of the two temperatures to achieve optimum display accuracy. Celebrating 30 Years Lithium battery and charging Since its main application is as an altimeter for ultra-light aircraft and hang gliders, we needed a battery power supply which was compact and light in weight, with reasonable battery life. With those factors in mind, we settled on a single 18650 lithium-ion cell as the battery, together with one of the Elecrow Mini Li-Ion Charger/Converter modules. A quality 18650 cell like a Panasonic, Sanyo or similar will have an energy storage capacity of between 1500 and 3400mAh (milliamp-hours) when fully charged. So since the project draws about 230mA at 5V (mainly to power the Micromite and its backlit LCD), which translates into about 390mA drawn siliconchip.com.au Interior view of the main unit, housed in a UB3 Jiffy box. The Micromite Backpack fixes to the box lid with a cutout for its touchscreen display. from the 3.7V Li-Ion cell (allowing for converter efficiency), it should be capable of running the unit for between three and eight hours. Watch those 18650s! As we pointed out in a recent article, there are 18650s . . . and 18650s. Don’t be tempted to use a “bargain” or unknown brand (did someone mention ebay?), especially one labelled higher than 3400mAh – they’re a con, as no such 18650 cell exists yet! Similarly, any 18650 cell you use should have protection circuitry built in – it makes the cell slightly longer but it means it won’t overcharge or overdischarge. However, we’ve seen cheap “protected” cells which contain no more than a spacer to make them look like they’re protected. Our tip is to always buy a reputable brand and preferably, buy here in Australia. At least then you have some recourse if the 18650 turns out to be a dud. Charging The Elecrow Charger module allows charging the 18650 Li-Ion cell from the USB port of a PC or a low-cost USB plugpack or alternatively, from a small solar (photovoltaic) panel. As well, it provides a DC-DC converter to boost the 3.7V terminal voltage of the Li-Ion cell to the 5V level needed to run the Micromite BackPack and the two sensor modules. This second function only comes into operation when power switch S1 is closed. One minor shortcoming of Elecrow’s Mini charger module is that it doesn’t provide any ‘pass through’ of the USB data lines between its USB input and output connectors (CON2 and CON4). But this only affects the initial uploading of the Weather Station/Altimeter software into the Micromite – not normal operation. Luckily, the initial software uploading to the Micromite can be easily done, as shown in the circuit. You will need to connect the 5V/TX/ RX/GND pins of the Micromite to one of the USB ports of your PC via either a Microbridge module or a standard low cost CP2102-based USB/ UART bridge module. If you’re using one of the newer V2 Micromites, it’s even easier since these have a Microbridge built in. So all you need to do for uploading the software is connect the Micromite’s mini USB connector directly to a USB port of your PC or laptop. Why two cases? Now let’s turn to the physical side of the project and explain why the project is split into two small cases, instead of a single case. We started with everything squeezed into a single UB3 case, the smallest practicable size to fit everything in. We soon discovered that the heat Fig.2: this wiring diagram matches the photo above but the wiring is slightly clearer. Note the reversed colour coding on the “Bat Out” terminal – black is positive and red is negative! siliconchip.com.au Celebrating 30 Years December 2017  27 Weatherproofing Because the sensor unit (especially) would normally be used in the open air (where it can read temperature and pressure) we would be inclined to weatherproof it as much as possible, consistent with still being able to make reliable readings. To protect them, a conformal coating, such as HK Wentworth’s “Electrolube HPA”, could be sprayed on the underside of PCBs and also on any soldered joints. Don’t spray the top side of any of the modules! Errata: there is a discrepancy between the circuit diagram (Fig.1) and wiring diagram (Fig.3) Some DHT22/AM2303 modules come attached to a small breakout board as shown in El Cheapo Modules Part 4 (February 2017; www.siliconchip.com. au/Article/10529). If using the breakout board, the 1kW resistor and 100nF capacitor shown in Fig.1 are not needed and the DHT22 can be wired to the DIN socket as shown in Fig.3. Otherwise, if your module comes with no breakout board, solder the resistor and capacitor as shown in Fig.1. from the Micromite and (mainly) its LCD Touchscreen backlighting steadily raised the temperature inside the case, so that the apparent air temperature rose significantly, giving spurious readings. So that’s why we ended up with two separate cases. As shown in the photos, the two sensor modules are mounted in the bottom of the smaller case, which has two 3mm diameter ventilation holes in the bottom of the case to ensure that conditions inside are substantially the same as those outside. Inside the main unit, the Micromite BackPack and its Touchscreen are mounted under the case lid, while the Elecrow Mini Charger module is mounted on the bottom at the lefthand end. The Li-Ion cell holder is mounted on the front side of the case, as low as possible so that it just clears the underside of the Micromite PCB when the lid assembly is attached. In order to do this, the Mini Charger module is attached using only three screws, and in addition part of the cell holder’s ‘side flap’ is cut away at the positive end. Also mounted on the front side of the case to the right of the Li-Ion cell holder is power switch S1, a mini SPDT toggle switch. Construction As shown in the layout/wiring diagram of Figs. 2 and 3, assembling both units is pretty straightforward because we are just linking up prebuilt modules. But before you can begin the assembly, you’ll need to prepare both boxes by drilling and cutting the various holes. To do this, follow the diagram of Fig.4 and 5 closely. You can avoid cutting out and drilling the holes in the UB3 box lid/front panel if you buy one of the laser-cut front panels from the SILICON CHIP online shop. Another point to note is that before fitting any of the components into the larger UB3 case, you’ll need to cut away four of the moulded splines inside the front side of the box, as shown in Fig.4. This is to allow the 18650 LiIon cell holder to be attached to the inside, down low enough to clear both the Mini Charger module and the underside of the Micromite LCD BackPack module. The splines can be cut away with a sharp hobby knife, or a small rotary tool if you prefer. Once the two boxes have been prepared you can fit the two modules into the UB5 box. Here the AM2302/DHT22 module is mounted inside the box at lower right, using three M2.5 x 8mm machine screws and nuts, with three extra M3 hex nuts used as spacers. The GY-68 barometer module is mounted in the same way at upper left, in this case using a single M2.5 x 8mm machine screw and nut, with a single M3 nut again used as a spacer. The cord grip gland can also be fitted Fig.3: photography and wiring diagram for the sensor unit, built into a UB5 Jiffy box. We originally built the whole project in one box but found the heat from the Micromite display compromised the accuracy of readings. 28 Silicon Chip Celebrating 30 Years siliconchip.com.au in the 12.5mm hole at the left-hand end – but don’t tighten up the outer cord gripping nut at this stage (only when you have fed the cable through it). Next cut off two sections of SIL header socket strip: one four clips long, and the other three clips long. After removing any burrs these are slipped over the 4-pin header on the barometer module and the 3-pin header on the AM2303 RH sensor module, ready for soldering the various wires from the connecting cable. To prepare the cable itself, carefully remove about 50mm of the outer plastic sleeve from one end. Then peel back the metal screening foil and twist it together with the bare wire just inside it. Strip away about 4-5mm of insulation from the ends of the main conductors. After these ends are tinned, all of the wires together with the screening foil and wire can be passed through the cable grip gland, until the end of the cable’s outer sleeve is about 5mm past the inner end of the gland. Then the gland’s outer nut can be tightened up to hold the cable in this position. Then solder the various wires to their correct pins of the header sockets on the two modules. We suggest that you use the colour coding shown in Fig.3, to help avoid swapped connections. Two small points to note: if the cable supplied has six wires instead of five, connect the ‘extra’ white wire to the same socket lugs as the black ground wire and the screening foil wire. Also note that the red wire of the cable must connect to the VIN socket lug for the GY-68 module as well as the VCC lug for the AM2302 module, while the black wire must connect to the GND lugs for both modules. This will involve two short lengths (about 40mm) of insulated wire, ideally with red and black insulation respectively. The internal wiring of the UB5 sensor unit should now be complete and you can fit the box lid. All that will then remain is to fit the 5-pin DIN plug to the other end of the cable. To do this, first slip the plug’s outer plastic sleeve over the end of the cable and out of the way. Then carefully remove about 15mm of the cable’s outer sleeve from the end, and as before peel back the screening foil and twist it together with the bare earthing wire. Then strip away about 5mm of the insulation from each of the inner wires. Next, twist the ends of the black and white wires together, and lightly tin siliconchip.com.au the ends of all bared wires before soldering them to the rear of each of the plug’s pins. As shown in Fig.3, the blue wire solders to pin 1, the green wire to pin 4, the black/white/screen wires all to pin 2, the orange wire to pin 5 and the red wire to pin 3. When you’re happy with these connections, squeeze together the cable grip lugs on the rear of the lower part of the plug shell using a pair of pliers, so that they will hold the cable in position. Then fit the upper half of the shell and slide the plug’s outer plastic sleeve back up the cable and over the plug’s metal shell, to hold it all together. Main unit assembly Most of the information you’ll need to assemble everything in the UB3 main unit box can be found in the diagrams of Fig.2, along with the internal photo. The easiest way to do this is in the following order: Main Unit and Sensor Unit Drilling Diagrams Fig.4: the main unit is built in the larger (UB3) Jiffy box, drilled and cut as shown here. These diagrams are shown here close to 2/3 life size (ie, if photo-copying to use as a template, you’ll need to enlarge them to 150%). To save you some effort and at the same time achieve an even more professional result, a laser-cut lid/front panel is available in clear or black Acrylic from the SILICON CHIP Online Store: siliconchip.com.au/ Shop/19/3337 (clear) or siliconchip.com.au/Shop/19/3456 (black). Fig.5 (left): the sensor unit is built in a smaller UB5 Jiffy box, drilled as shown here. Celebrating 30 Years December 2017  29 Fig.6: a side-on “X-ray” view of the main unit assembly. The label is held in place by the acrylic lid but a very fine mist of spray glue will help to keep it in intimate contact. First, fit the 5-pin DIN socket to the right-hand end of the box using a pair of 6mm long M2.5 screws and nuts. Then mount power switch S1 in the 6mm hole in the front side of the box, as shown in Fig.2. Next, mount the Elecrow Mini Solar/LiPo Charger module in the bottom of the left-hand end of the box, using three 9mm long M2.5 screws and nuts, together with three M3 nuts as spacers. The module should be mounted with the USB micro input socket end to the left, just inside the stepped access hole. Slide the Li-Ion cell holder down inside the front of the box as far as it will go, orientated as shown in Fig.2. This should allow you to mark the location of the two holes which need to be drilled in the bottom of the holder, to match the holes already drilled in the box. You should be able to mark the hole locations using a small scriber or needle. Then remove the cell holder again, so that you can easily drill a 2.5mm hole in each of the two marked positions. After drilling remove any burrs with a larger drill or countersink, and if you can manage it also countersink both holes on the inside of the holder. If you slide the prepared holder back down into the box, you should then be able to fasten it in position using two 6mm long countersinkhead M2.5 screws and nuts – with the nuts on the outside as indicated in Fig.2. When the holder is in place, you need to use a sharp knife or rotary tool to cut away a section of the left-hand upper ‘wing’ of the holder, as indicated by the cross-hatched area in Fig.2. This is to prevent it from interfering with some solder joints on the underside of the Micromite BackPack PCB, on the latter’s front left. You can also see this in the internal photo. Solder the ends of the Li-Ion cell holder’s leads to the rear lugs of the JST2.0 socket on the Charger module, after cutting each one to an appropriate length and stripping and tinning about 4mm from the end of each wire. The red wire should be soldered to the lug marked ‘+’, and the black wire to the lug marked ‘-’. Next connect the two wires from the JST2.0 plug lead connected to the socket on the Charger module labelled ‘BAT OUT’, to their designated locations. Note that since many of these plug leads have reversed colour coding, the black positive wire should be connected to the uppermost lug of S1 while the red negative wire connects to pin 2 of CON1. All that remains is to add the rest of the wiring, using Fig.2 and the internal photo as a guide. Note that the three wires from CON1 which are marked as 30 Silicon Chip connecting to pins 17, 18 and 21 of the Micromite should be soldered at their upper ends to the lugs of a 3-way section of SIL socket strip, while the wires marked +5V and GND should be soldered to a 2-way section of the same socket strip. Both sections of socket strip will then be ready to connect to the corresponding pins of the Micromite. The next step is to mount the Micromite BackPack and its LCD touchscreen to the underside of the box lid, or to the replacement laser-cut acrylic lid/panel if you are using this. Parts List – Touchscreen Altimeter & Weather Station 1 1 1 1 1 1 1 1 1 UB3 jiffy box (130 x 68 x 44mm) laser-cut Acrylic front panel to suit above # front panel label to suit ^ UB5 jiffy box (83 x 54 x 31mm) Micromite V2 LCD BackPack + 2.8-inch LCD # Elecrow GY-68 barometer/altimeter module # DHT22/AM2302 temperature/RH module # Elecrow mini LiPo/Li-Ion charger module # 1kW resistor and 1 100nF ceramic capacitor if not using a DHT22 with breakout board 1 18650 rechargeable Li-Ion cell 1 1 x 18650 Li-Ion cell holder 1 SPDT mini toggle switch 1 5-pin DIN socket, panel mounting 1 5-pin DIN plug, inline type 1 1.5m length of 5/6-way screened ‘computer’ cable 1 3-6.5mm cable gland 7 M2.5 x 8mm pan head machine screws & nuts 7 M3 hex nuts 2 M2.5 x 6mm pan head screws and nuts 5 M3 x 6mm pan head machine screws 1 16-way female header (to cut into 1 x 4-way, 2 x 3-way and 1 x 2-way) 4 M3 x 10mm long machine screws 4 M3 Nylon flat washers 4 12mm long M3 tapped Nylon spacers 2 M2.5 x 6mm countersink head screws and nuts 1 120mm length of rainbow ribbon cable (to make interconnections) # Available from the SILICON CHIP Online Shop: siliconchip.com.au/Shop ^ Download from siliconchip.com.au/Shop/11/4482 Celebrating 30 Years siliconchip.com.au End-on views of the main unit (left photo) showing the connections for power in, from either a solar panel or a USB supply/PC port; and (right photo) the 5-pin DIN socket which connects to the sensor unit. Just before you do this, however, you may want to attach the front panel artwork shown in Fig.7 to the lid/panel, to make it look more professional. For more information on assembling and using the TouchScreen Micromite BackPack, refer to the article in the May 2017 issue (www.siliconchip. com.au/Article/10652). You can see how the BackPack and LCD is attached to the rear of the lid/ front panel in Fig.6. The LCD board is attached directly to the panel using four 10mm long M3 machine screws, with 1mm thick Nylon flat washers as spacers and four M3 x 12mm long tapped Nylon spacers underneath as ‘long nuts’. Then the Micromite BackPack PCB is attached to the lower ends of the tapped Nylon spacers, using only three 6mm long M3 machine screws. No screw is used in the front left position, because if fitted the head of this screw would conflict with the top of the Li-Ion cell holder during final assembly. Note that all connections between the Micromite BackPack PCB and the LCD board above it are made via a 14- way SIL header and socket at their right-hand ends. Once the Micromite and LCD boards are secured to the underside of the front panel, you’re almost ready for final assembly of the main unit. Only two things remain to be done: slipping the 18650 Li-Ion cell into its holder (making sure that its positive end is to the left) and then fitting the 3-way and 2-way SIL sockets on the wires from the 5-way DIN socket to the correct pins along the rear of the Micromite PCB. Plug the cable from the sensor unit into CON1, so the two units are linked together. Programming the firmware Your Altimeter is now virtually complete but you need to download the project’s firmware program from the SILICON CHIP website, and then upload it to the Micromite. The firmware for this project is called “Altimeter.bas”, and you can download it (free to subscribers) from www.siliconchip.com.au The three mounting screws for the Elecrow Charger PCB and the 5-pin DIN socket on the end. The 18650 cell holder mounts on the side wall of the case (see nuts). siliconchip.com.au Celebrating 30 Years The next step is to connect the Micromite in your Altimeter/Weather Station to a USB port of your PC, either directly in the case of a Micromite V2 or via a USB/UART bridge module in the case of a Micromite V1. Either way, we suggest that you start up Control Panel>Device Manager to make sure that the Micromite has been recognised as a virtual COM port and to take note of the COM port number and baud rate it has been allocated. Now you should be able to start up the MMEdit program and use it to open the downloaded Altimeter.bas program. Then after making sure that MMEdit can communicate with the Micromite in the Altimeter/WeatherStation, it’s just a matter of getting it to upload the program and then set it running. Since the programming connection to the PC also provides power, you should find that the Altimeter/WeatherStation springs to life as soon as the program is set running. You should see the display on the LCD showing the altitude, air temperature, the relative humidity, the barometric air pressure (see photo of the Weather Station display). If all is well so far, the programming cable can be disconnected from the Micromite. The display will probably go dark again, unless your have turned on power switch S1 and your Li-Ion cell has some initial charge. Now the front panel assembly can be gently lowered into the box and the four small 10mm long self tappers used to fasten the two together. Your Altimeter/Mini Weather Station should now be complete and ready to go. Charge the Li-Ion cell for a few hours (via a USB cable, power supply December 2017  31 Fig.7: a full-size front panel artwork for the Altimeter/Weather Station, ready to photocopy (or download from siliconchip. com.au/Shop/11/4482). We printed ours on heavy, glossy photographic paper. The idea is that this label is mounted behind, and visible through, the clear acrylic laser-cut front panel, so it is fully protected from, especially, the weather (and grubby fingers!). This label will normally be held in place by the front panel; however, a very fine dusting of spray adhesive will hold it in position while you drill the label holes (all 3mm) and cut out the Touchscreen Display rectangle with a very sharp hobby knife. or solar panel) before you turn on S1 again to put the project to work. What it can do When you turn it on for the first time, you should get the weather station display shown in the photos. The device will initially start up in this mode, and will also have its altitude reference set to MSL (mean sea level) and the altitude units set to metres – as indicated in the line of text just below the Altitude reading. At the bottom of the display you’ll see a red button labelled “TOUCH TO CHANGE MODE OR UNITS”. And if you do touch this button, the display will change into a one giving you the options of changing to the alternative Altimeter display, changing the altitude units to feet instead of metres (or back again), or changing the altitude reference level from MSL to the current ground level (or back again). There’s also an “EXIT WITHOUT ANY CHANGES” button at the bottom of this screen. So if you want to change over to Altimeter mode, this is done quite simply by touching the button at upper right, labelled “ALTIMETER MODE”. This will change the display over to one showing just the altitude, in large digits for high visibility. But the altim- eter units and reference level won’t have changed at this stage, so the text just below the altitude digits will still read ‘metres above MSL’. If you’re happy with these settings, fine. But if you’d rather have the altitude in feet rather than metres, simply touch the button at the bottom of the screen to bring up the ‘change options’ display again. Then touch the button labelled “FEET”, and you’ll return to the Altimeter screen with the reading shown in feet rather than metres. Here’s an important point to note, though. If the altitude reference level is still set to MSL, you may be getting a negative altitude reading if the air pressure in your vicinity happens to be significantly higher than the nominal MSL level of 1013.25hPa (hectoPascals). This can be a bit confusing, but the problem is easily fixed by touching the button at the bottom of the screen once again, and then touching the “GROUND REFERENCE” button at lower right on the ‘change settings’ display. This will set the altitude reference level to the current barometric pressure level; ie, the altitude at your current position. This ‘ground reference level’ can be So what is the Micromite – and what will it do for YOU? We’ve made many references to the “Micromite” and the “Micromite BackPack” in this article – after all, that is the platform on which the Altimeter/Weather Station is based. The Micromite was developed in Australia by Geoff Graham and has been used exten- 32 Silicon Chip sively in SILICON CHIP projects and as a microcontroller platform in its own right. It’s similar in some respects to other microcontrollers such as the Arduino, Raspberry Pi etc.The Micromite has developed an enormous following around the world, mainly due to its ease-of-use and the fact that it uses “MMBASIC” Celebrating 30 Years reset at any time, simply by switching to the ‘change settings’ display and touching the “GROUND REFERENCE” button again. By the way whenever you change any of the settings in the ‘change settings’ display, all of the setting parameters are saved in the Micromite’s non-volatile memory. This means that if you turn off the device power, next time you power it up again the same settings will be restored. You can always change back from Altimeter mode to Weather Station mode, simply by touching the button at the bottom of the screen and then the “WEATHER STN MODE” button at upper left. Similarly, you can change the altimeter units to metres and the altimeter reference level back to MSL. One last point: as mentioned earlier, when fully charged, a single 18650 Li-Ion cell of decent quality should be able to power the Altimeter/Weather Station for between 3.8 and 8.75 hours. This should be long enough for most purposes, but don’t forget to charge it up before going on a flight or journey. When the cell’s voltage is falling to the point where it’s no longer capable of powering the unit, you’ll notice that the display starts flickering. Time to turn it off and charge it! SC – a variant of the hugely popular and very easy to understand BASIC language. In past issues, we have prepared several features on the Micromite and its peripherals, including some aimed at first-time users. Log on to siliconchip.com.au, search for “Micromite” – and enjoy! siliconchip.com.au