This is only a preview of the June 2015 issue of Silicon Chip. You can view 33 of the 96 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. Articles in this series:
Items relevant to "Bad Vibes Infrasound Snooper":
Items relevant to "Audio Signal Injector & Tracer":
Items relevant to "The Multi-Role Champion Preamplifier":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
Final part of our quality Weather Station based on
System designed
by Armindo Caneira*
Built and written
by Trevor Robinson
*www.meteocercal.info
The Wireless
Display Unit
In the last part, we built the RX unit and configured Cumulus to collect,
record and display your weather data. Now we are going to complete the
Weather Station by building the handy little Wireless Display unit (WDU).
T
he Wireless Display unit actually evolved from the
RX unit (which, incidentally, can also be used as a
WDU with some minor mods).
It receives wireless data on a 433MHz link from the RX
unit (see part 3), which in turn has received data from the
outside weather sensors via the TX unit (see part 2).
It also sends data from its own DHT22 temperature and
humidity sensor. The main differences between the two is
the barometer sensor and the run/program pullup switching
has been omitted.
And of course, it has its own
firmware file.
Beside having a display
screen, it only has one
push-button switch (the Display Mode switch) and a LED.
The LED blinks when data is received over the 433MHz link.
The WDU is powered through its Mini-B USB connector,
so you will need a 5V DC power pack with a mini-B USB
connetor or a Mini-B USB cable to connect it to a suitable
power supply like a USB phone charger.
Once again, like the RX unit, you have the option of one
of the following five different displays:
TFT – ILI9341 2.4” or 2.2” (320x240) or the ST7735 1.8”
(160x128)
Alphanumeric LCD: 20x4, or 16x2 with I2C module
Constructing the Wireless Display Unit
The WDU PCB purchased from Meteocercal will al-
A completed WD
unit with a 2.4”
TFT display
siliconchip.com.au
June 2015 81
(Above): reverse side of the WD PCB; the “top” side at right has the Arduino Nano and
433MHz modules fitted.
ready have the surface mount components soldered on, as
shown above (there is also an SMD on the opposite side).
These can be a bit tricky without the correct tools.
Once again, like all electronic kitset projects, it’s easiest
to install and solder in the smallest components first: the
resistors and capacitors.
Next install the LED, observing the polarity, followed by
the header and antenna connectors.
Like last month, it’s best to install the Nano using a
suitable socket. But if you are soldering the Nano directly
to the PCB, it’s good practice (as with all heat sensitive
components) to stagger the soldering of the pins to help
avoid localisation of heat build up.
Finally install the BX-RM06 ASK OOK RF receiver module vertically on the WDU board. Ensure that the component
side of this board goes to the outside of the WDU board
pin – its easy to install this component back-to-front if care
isn’t taken. Not only will it not work, it will quite likely be
damaged (and it’s a pain to desolder!).
The WDU board is now complete but before moving on,
double check your work, looking for solder bridges (especially between module and header pins) and cold solder
joints. A jeweller’s loupe or magnifying lamp are great tools
for getting a good close-up view.
the Dupont female to female wires to make
life easy. The backlight jumper needs to
remain in place, but you may need to
tweak the contrast potentiometer.
LCD
Connecting the display screen
Both of these are dependent on what sort of case you get.
The momentary action pushbutton switch should be
connected by soldering wire to the contacts and then the
other end to the contacts of the header connector plug. The
LED can be soldered into its position on the PCB, though it
would be better to use a suitable length of cable to connect
it to the PCB from somewhere visible on the case. The push
button changes the display mode as per the table below:
Much of the following information is repeated from last
month’s (Part 3 – The Receiver) issue because the Wireless
Display Unit and Receiver Unit share a common heritage
and indeed, most parts
TFT pin assignment
are interchangeable.
TFT display
Use nine of the Dupont female to female
wires to connect PCB
pin headers to TFT pin
headers.
Currently the SD card
and touch overlay are
unused.
Alphanumeric LCD
PCB TFT Display
2.4” TFT –
ILI9341 320x240
SCLK SCLK
MOSI
SDA
CS CS
RST
RESET
SDI(MOSI)
PCB LCD
GND
GND
This is the same as what we did for
5V
the RX unit. We’ll cover it briefly again, 5V
just in case your dog ate your homework SDA
SDA
last article.
Solder four header contact pins to SCL SCL
one end of whatever
length of cable you
DHT22 Temp. Sensor
require. The maxiPCB Schematic Pin DHT 22 pins
mum length this cable
can be is five metres. GND
1 (GND)
3 OR 4
Solder and heatshrink
2 (D6)
2
the other end to the DAT
four legs of the DHT22 5V
3 (5V)
1
sensor.
Ensure the pin assignment matches the table above.
Push button (display mode switch) and
LED (data received indicator)
SCK
Display Mode Switching
LCD
TFT
CS
Short press
Nothing
Toggles the Display off/on
RESET
Long press
Nothing
Toggles the big font size screen
DC A0
D/C
5V VCC
VCC
GND GND
GND
The LCD connection
LED
process is simpler as it LED+ LED+
only uses four wires. LED-
LED-
No connection
You can also use four of
needed
82 Silicon Chip
Connecting the DHT22
temperature sensor
Pinouts
Button Action
Double press Toggles the information screen
The information screen shows the firmware version, TX
unit voltage and case temp from the TMP36 sensor.
Programming the WeatherDuino Pro2 Nano
Since you are now an old hand at programming Arduinos,
we shouldn’t have to go into too much detail here. If you
siliconchip.com.au
Another view of
the completed
WDU PCB, this time
showing the method of
mounting the 433MHz
wireless link. Take care
with this – with four pins
at each end it’s not difficult
to solder it in the wrong way
. . . but rather more difficult to
unsolder it and fix your mistake!
need a refresher, part two had an in-depth guide to setting
up the IDE and part three covered reading and altering of
the WeatherDuino code to suit that application; maybe
read those again.
Acquire the required firmware
Download the required firmware file from here: www.
meteocercal.info/forum/Thread-WeatherDuino-Pro2-WDSoftware-Latest-Release
Save the file to wherever, then extract the contents into
your Arduino sketch folder which should be in the \users\
your_username\Documents\Arduino folder. Click “OK”
on any merge or overwrite dialog boxes.
Now go into that folder and double click the folder
WeatherDuino_WD_vxxx_bxxx (the “x”s change by release
version). Then in that folder there should be a file called
WeatherDuino_WD_vxxx_bxxx.ino – double click that to
open it in the Arduino IDE.
Configuring the code
Now we need to tweak a few lines to suit our WDU setup.
Scroll down to around line 44.
We need to start by changing the code to suit our display
type, so pick your display type number from the comment
section: 0= TFT 160x128 ST7735, 1= TFT 320x240 ILI9341,
4= 20x4 LCD, 5= 16x2 LCD
Say your have the big LCD display, you would change
the line to read this:
#define DisplayType 4 // 0= TFT 160x128 ST7735, 1=
TFT 320x240 ILI9341, 4= 20x4 LCD, 5= 16x2 LCD
The big TFT display is set to the default so you would
just leave that line as is.
Next is the Backlight timeout:
byte BackLight_Timeout = 0; // Timeout for TFT backlight
in minutes (1 to 255). 0= Always ON
siliconchip.com.au
You have the option of having it on continuously (though
a short button press turns it off) or setting the timer to turn it
off automatically some time after the last button press. Your
choice. If you want to just manually turn off the backlight
then just leave the default setting.
Next is the Temperature sensor type. Since we when
with the good old DHT22 you can left this line alone also.
The next line you also leave at the default setting of 1
#define Board_Type 1 // 0= Standard Boards, 1= Extended version Wireless Display Boards
Pretty simple configuration on this unit isn’t it?
Save it with a filename that reflects your setup so if
you wish to tweak/change it in the future, you will know
what it is.
Compile and upload it to the Nano by pressing the right
arrow in the Arduino IDE. After a short period of time the
WeatherDuino Pro2 Wireless Display unit should reboot
and a little while later the inside temperature should be
displayed and after a little more time the outside data
should display.
If the IDE produces errors its usually one of two things:
1: File too big. Your are not running the Arduino IDE
version 1.5.8 or greater.
2: The library files are not where the IDE is expecting
them. Double check they are in the sketch folder or manually import them in the IDE (Sketch/Import Library).
That’s all folks!
We hope you enjoyed creating this project and find the
data this weather station creates is more reliable and accurate than your previous station may have produced, or
even the weatherman on the radio.
We certainly did!
When you get you weather station online, please leave a
post on the Meteocercal forum so you can have your station
added to the WeatherDuino user map here:
www.meteocercal.info/forum/misc.php?page=
WeatherDuino_Users_Map
SC
June 2015 83
|