This is only a preview of the November 2022 issue of Silicon Chip. You can view 43 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 "Christmas LED Icicle Decoration":
Items relevant to "LC Meter Mk3":
Items relevant to "DC Supply Transient Filter":
Items relevant to "Active Monitor Speakers, Part 1":
Items relevant to "WiFi-Synchronised Analog Clock":
Items relevant to "Particulate Matter (PM) Sensors":
Items relevant to "30V 2A Bench Supply, Part 2":
Purchase a printed copy of this issue for $11.50. |
Using WiFi with the
GPS-Synchronised Analog Clock
By Geoff Graham
ur new GPS-Synchronised Analog
O
Clock Driver featured in the September issue has been a great success,
it with the new GPS Synchronised
Clock. If you want the full details, read
the original article at siliconchip.au/
Article/15466
The recommended WeMos D1 Mini
WiFi module is available from many
sources, including Altronics (Cat
Z6441) and Jaycar (Cat XC3802), as
well as on eBay, AliExpress etc.
The original module is made by a
Chinese company called Lolin, but
many clones exist. While they may
look different, they have the same
form-factor and pinout and work just
as well.
When buying the module, make sure
it is the D1 Mini version. There are
other variations called D1 but without
the Mini suffix; they are much larger
and will not fit in the space reserved
for the GPS module.
with hundreds built. It was so popular
that there was a two-week backlog of
kits until early October (kits are now
back in stock).
However, some constructors have
reported difficulties with the GPS
module being unable to get a signal.
This is usually because the GPS signal is blocked or heavily attenuated
when used in a multi-level house or
building, a building with a steel roof
or even heavy rain.
The solution is Tim Blythman’s
“Clayton’s GPS”, described in the April
2018 issue (siliconchip.au/Article/
11039). This is a WiFi module that
emulates a GPS module, but it gets the
time from a public time server on the
internet using the network time protocol (NTP).
Besides the WiFi module, it does
not require any extra components and
is a drop-in replacement for the GPS
module specified in the September
article. You could swap back and forth
between the two, and the clock would
not notice the difference.
This article briefly describes how
to set up the WiFi module and use
Loading the firmware
To make the D1 Mini emulate a
GPS module, you need to load the
appropriate firmware, which can be
downloaded from siliconchip.com.
au/Shop/6/52 The following description is based on the Windows operating system.
You can load the firmware using
other operating systems, but that will
require the Arduino IDE software.
That process is described in the original Clayton’s GPS article from April
2018.
First, plug the D1 Mini into a USB
port on your Windows computer.
It will connect as a serial-over-USB
device. No device driver is required
for Windows 10 or 11. Open Device
Manager and you should see it listed
as “USB-SERIAL CH340” – see Fig 1.
Note the COM port number, which is
COM23 in this example.
Next, run the program file named
“ESP8266Flasher.exe”, which is
included in the firmware download.
This is an easy-to-use programmer for
ESP8266 devices developed by www.
nodemcu.com
When you start the programmer,
it will guess the COM port number
(see Fig.2), so the first thing that you
should do is check that it has selected
the correct number for the D1 Mini.
Then you need to click on the Config
tab and enter the path to the firmware
file, “ NTP_client_for_ESP8266_GPS_
OUTV12.bin”.
Leave the starting address at
0x00000 (hexadecimal value) and do
not change any of the settings in the
Advanced tab. Finally, return to the
Fig.1: when you plug the D1 Mini into a computer running Windows, Device
Manager will show the COM port allocated to it.
►
Fig.2: ESP8266Flasher.exe is an easy-to-use programmer for the D1 Mini. It has
correctly guessed the module COM port here, but you should still check it.
76
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
Operation tab and click the Flash(F)
button.
The programmer will load the firmware. While that is happening, the blue
LED on the D1 Mini should flicker rapidly. When the programmer has finished, it should show a green tick on
the bottom left corner of the program,
indicating that it was successful. If
you do not see that, click on the Log
tab and scroll to the end of the log to
view any error messages.
NTP GPS Source Setup:
Current Baudrate:9600
1.Set 4800 Baudrate
2.Set 9600 Baudrate
3.Set SSID. Current:SSID
4.Set Password. Current:PASSWORD
5.Set NTP Server. Current:pool.ntp.org
6.Set Dummy Coords. Current:3351.000,S,15112.000,E
9.Exit and save
Enter a number:
❚
Fig.4: the WiFi
module fits neatly
in the space
usually occupied
by the GPS module,
and only three
connections are
required.
Configuring the firmware
After successfully loading the firmware, disconnect and then reconnect
the USB cable. That will reboot the
module, and the blue LED on the top
of the module should illuminate and
stay on.
Open a terminal emulator like Tera
Term (https://tera-term.en.lo4d.com),
set the baud rate to 9600 and connect
to the COM port used by the D1 Mini.
You will see the output of the module,
which will be emulating a GPS module that cannot find a signal.
Using the terminal emulator, enter
the tilde (~) character on your keyboard and you should see the setup
menu as shown in Fig.3.
Change the SSID and Password to
suit your network, then save and exit
the configuration menu by pressing
9. None of the other settings need to
be changed.
Finally, disconnect and reconnect
the USB cable, and the D1 Mini module should start up with the blue LED
coming on solidly. That indicates the
firmware is connecting to your WiFi
network, accessing the internet and
contacting a public time server. The
blue LED will change to a brief flash
every second when the firmware has
received the current time.
If you reconnect with your terminal
emulator, you will see that the module is now producing GPS-compatible
messages indicating the correct (UTC)
time.
Installing the module
The module fits neatly into the
space reserved for the GPS module
on the clock controller PCB, as shown
in Fig.4.
Only three wires are needed: the
pin labelled 5V on the module connects to the solder pad labelled “RE”
on the controller board; pin G on the
module to pad “BK” on the main PCB;
Inductor part code mix-up
The 10 × 10mm inductor (L1) used to build the prototype, RS Components 496-0401,
fit the PCB nicely and worked well. As such, we provided the part code from that item’s
description in the parts list (EPCOS B82462-A4).
We now know that the correct part code is B82464-A4 (that code appears on the RS
page, just further down). By the time customers clued us in, we had supplied hundreds
of EPCOS B82462-A4 inductors in kits from another supplier.
They are electrically compatible, just smaller at 6 × 6mm. If ordering that part from
RS, you will need to use the part code we gave in the parts list, as that is what they use,
but from any other supplier, use the correct part code (B82464-A4-472M).
If you already have the part (eg, you got it as part of a kit), we recommend you solder one side to a pad on the PCB, then use a component lead off-cut to bridge the gap
between the other side and the opposite PCB pad. Many constructors have successfully built the kit that way.
To make construction easier, we will be supplying a redesigned PCB that will accept
either size of inductor. Those new PCBs should be available by the time you are reading
this and will be included in future kits.
siliconchip.com.au
Fig.3: this is the
configuration menu
for the module. You
need to change the
SSID and Password
entries, but the
remainder of the
settings can be left
as they are.
Australia's electronics magazine
and pin TX on the module to pad “BU”
on the PCB.
Finally, attach the D1 Mini to the
controller board using double-sided
tape.
When you insert cells into the clock,
you should see the module’s blue LED
illuminate for a few seconds while
it accesses the internet, changing to
a flash when it gets the correct time.
Almost immediately, the clock controller’s microcontroller will power
down the module (because it has the
correct time) and the LED on the controller board will start a long flash
every second. That indicates that it is
waiting for the next hour or half-hour
to start the clock running.
That’s it! You can hang your clock on
the wall, and it will keep accurate time
for as long as it can reach the internet
via your WiFi network.
Incidentally, your clock will keep
going even if you turn off your WiFi
(for example, if you go on holiday).
Then, when you re-enable your WiFi,
the clock will get the correct time when
it next tries to synchronise (within 24
hours) and immediately correct any
error that accumulated while you
were away.
D1 Mini module kit (SC6472)
We will be offering the D1 Mini as
an option for the current kits instead
of the GPS module – note that the D1
Mini will require programming. SC
November 2022 77
|