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":
Items relevant to "The Arduino MegaBox from Altronics":
Items relevant to "Build your own Super-7 AM Radio Receiver – Part 2":
Items relevant to "El Cheapo Modules 11: Pressure/Temperature Sensors":
Items relevant to "Part 3: Finishing our new 6GHz+ Digital Frequency Meter":
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
|