Silicon ChipDead-Accurate 6-Digit GPS-Locked Clock, Pt.1 - May 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: High-speed broadband network could be a white elephant
  4. Feature: Tech Support: Terror Tales From The Front Line by Barrie Smith
  5. Feature: HID Lamps: Out Of The Car & Over Your Shoulder by Ross Tester
  6. Project: Dead-Accurate 6-Digit GPS-Locked Clock, Pt.1 by Jim Rowe
  7. Project: 230VAC 10A Full-Wave Motor Speed Controller by John Clarke
  8. Project: Precision 10V DC Reference For Checking DMMs by Jim Rowe
  9. Feature: Why Calibrate Your Test Equipment? by Tony Tong
  10. Feature: How To Draw Circuit Schematics In Protel Autotrax by Rick Walters
  11. Project: UHF Remote 2-Channel 230VAC Power Switch by Branco Justic & Ross Tester
  12. Project: Input Attenuator For The Digital Audio Millivoltmeter by Jim Rowe
  13. Vintage Radio: The Astor Football GR/GRP 3-Valve TRF Receiver by Rodney Champness
  14. Book Store
  15. Advertising Index
  16. Outer Back Cover

This is only a preview of the May 2009 issue of Silicon Chip.

You can view 31 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.

Articles in this series:
  • Tech Support: Terror Tales From The Front Line (May 2009)
  • Tech Support: Terror Tales From The Front Line (May 2009)
  • Tech Support: The View From The Other Side (June 2009)
  • Tech Support: The View From The Other Side (June 2009)
Items relevant to "Dead-Accurate 6-Digit GPS-Locked Clock, Pt.1":
  • 6-Digit GPS Clock Autodim Add-On PCB [04208091] (AUD $5.00)
  • 6-Digit GPS Clock Driver PCB [07106091] (AUD $15.00)
  • 6-Digit GPS Clock Main PCB [04105091] (AUD $25.00)
  • PIC16F877A-I/P programmed for the 6-Digit GPS Clock [0410509E.HEX] (Programmed Microcontroller, AUD $20.00)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • PIC16F877A firmware and source code for the 6-digit GPS Clock [0410509E.HEX] (Software, Free)
  • 6-Digit GPS Clock Autodim Add-On PCB pattern (PDF download) [04208091] (Free)
  • 6-Digit Clock GPS Driver PCB pattern (PDF download) [07106091] (Free)
  • 6-Digit GPS Clock main PCB pattern (PDF download) [04105091] (Free)
Articles in this series:
  • Dead-Accurate 6-Digit GPS-Locked Clock, Pt.1 (May 2009)
  • Dead-Accurate 6-Digit GPS-Locked Clock, Pt.1 (May 2009)
  • GPS Driver Module For The 6-Digit Clock, Pt.2 (June 2009)
  • GPS Driver Module For The 6-Digit Clock, Pt.2 (June 2009)
Items relevant to "230VAC 10A Full-Wave Motor Speed Controller":
  • 230VAC 10A Full-Wave Motor Speed Controller PCB pattern (PDF download) [10105092] (Free)
  • 230VAC 10A Full-Wave Motor Speed Controller front panel artwork (PDF download) (Free)
Items relevant to "Precision 10V DC Reference For Checking DMMs":
  • Precision 10V DC Reference PCB pattern (PDF download) [04305091] (Free)
  • Precision 10V DC Reference front panel artwork (PDF download) (Free)
Items relevant to "Input Attenuator For The Digital Audio Millivoltmeter":
  • Digital Audio Millivoltmeter Input Attenuator front panel artwork (PDF download) (Free)
  • Input Attenuator PCB for Digital Audio Millivoltmeter [04205091] (AUD $7.50)
  • Digital Audio Millivoltmeter Input Attenuator PCB pattern (PDF download) [04205091] (Free)
Articles in this series:
  • Build A Digital Audio Millivoltmeter (March 2009)
  • Build A Digital Audio Millivoltmeter (March 2009)
  • Input Attenuator For The Digital Audio Millivoltmeter (May 2009)
  • Input Attenuator For The Digital Audio Millivoltmeter (May 2009)

Purchase a printed copy of this issue for $10.00.

Pt.1: By JIM ROWE Build A 6-Digit GPS clock Looking for a digital clock that’s always dead accurate? This one derives its time signals from the GPS (Global Positioning Satellite) system, so it never needs setting or adjusting. It features big, bright 58mm-high digits for the hours and minutes, plus smaller digits to indicate the seconds. 20  Silicon Chip siliconchip.com.au The main board uses 58mm-high 7-segment displays for the hours and minutes readouts plus smaller 13mm-high digits to indicate the seconds. The GPS time signals are derived either from a small add-on module to be described next month or from the GPS-Based Frequency Reference (see text). I N THE March 2009 issue, we featured a GPS-controlled analog clock that’s proving very popular. Strictly speaking though, this wasn’t a GPS clock but a “GPS-corrected” clock. Basically, an external module carrying a PIC processor and an EM-408 GPS module was used to replace the clock’s own crystal oscillator drive. The PIC processor provides the timing signals for the clock and the GPS module is then used to re-synchronise the clock once every 44 hours. By contrast, this digital clock is permanently locked to the GPS time signals and always displays the correct time. It can display UTC time (Universal Time Co-ordinated), local standard time or local daylight saving time, all at the touch of a button. The digital clock display described here can derive its GPS time signals from the GPS-Based Frequency Reference described in the March-May 2007 issues of SILICON CHIP. However, you don’t have to go to the expense of building the GPS-Based Frequency Reference. Instead, you can use the siliconchip.com.au above-mentioned EM-408 GPS module on a small PC board which can be housed in the same case as the display board to form a self-contained clock. This will be described in Pt.2 next month. GPS Frequency Reference The GPS-Based Frequency Reference described in the March-May 2007 issues already displays UTC time on its small LCD readout. In order to get your local time, you have to mentally add (or subtract) the appropriate offset for your particular time zone and also add another hour if your state or region is currently observing daylight saving. As it turned out, many readers were more interested in the timekeeping aspects of the GPS-Based Frequency Reference, rather than its very accurate frequency outputs. They also wanted a much larger display that could be read at a distance. And they wanted the display to automatically show both local standard time and local daylight saving time. The GPS-corrected clock in the March 2009 issue only added to the interest, with more readers asking for a GPS Digital Clock. So here it is. It uses a microcontroller to calculate both standard and daylight saving times and display the result on a bright 6-digit LED display. “Jumbo” 7-segment 58mm-high digits are used for the hours and minutes indication, while 13mm-high digits provide the seconds indication. In operation, the circuit is designed to accept the “NMEA 0183” data stream output from the external GPS receiver module. The microcontroller then extracts the UTC time information and uses it to work out the local standard and daylight saving times. You decide whether UTC, local standard time or daylight saving time is displayed simply by pressing one of the three time-select buttons. The two remaining buttons are used only once, to initially set the UTC-local time offset. How it works Refer now to Fig.1 for the circuit May 2009  21 22  Silicon Chip siliconchip.com.au 2009 SC  A K B D3 Q21 BC338 4.7k E C 26 RB1 RB2 RB3 RB4 RB5 RB6 RB7 RB0 Vdd 11,32 Rx (RC7) Tx (RC6) RC1 RD7 12,31 OSC2 OSC1 RA2 RA1 RA0 RC5 RC4 RC3 RC0 RD5 RD6 RC2 RD2 Vss IC1 PIC 16F877A-I/P RD3 RD4 RD1 MCLR RD0 1 14 13 4 3 2 24 23 16 15 18 17 34 35 36 37 38 39 40 33 100 µF 16V 22pF E C B Q7 22pF E C C Q8 E K 10k B 22k λ LED1 UTC 6 x 1.8k A Q1 10k B 22k (Q2-Q6 NOT SHOWN) B X1 4MHz 7x10k IN K A Q14 f 470Ω λ LED2 LOCAL TIME a c b e d K A B e d dp c b λ LED3 Q16 d E C g K A K 1N4004 A D2,D3: 1N4148 B e f a DISP2 +11.4V HOURS LOCAL DLS TIME E C g a DISP1 Q15 f 100 µF 16V g 7x56Ω C E (Q9-Q13 NOT SHOWN) 6-DIGIT GPS CLOCK/TIME READOUT 22k A K 25 30 29 28 21 22 27 20 19 100nF 2.2k GND OUT REG1 78L05 dp c b Q17 d E C g dp c b S1: S2: S3: S4: S5: d B e K A LEDS E C g d Q19 f a DISP5 A DISP1–DISP4 = ZD-1850 DISP5, DISP6 = ZD-1855 dp c b 7x 330Ω E B C BC328, BC338 DISPLAY UTC DISPLAY LOCAL STD TIME DISPLAY LOCAL DLS TIME INCREMENT UTC–LOC TIME HOURS OFFSET INCREMENT UTC–LOC TIME MINUTES OFFSET E C g a DISP4 Q18 B e f MINUTES Q1–Q7 = BC338 Q8–Q14 = BC328 Q15–Q21 = BC338 B e f a DISP3 470 µF 25V K D1 1N4004 IN OUT 78L05 E C g d Q20 f B e GND dp c b a DISP6 CON2 SECONDS – + Fig.1: the circuit is based on a PIC16F877A microcontroller. This processes the NMEA 0183 serial data from the GPS receiver module (at its pin 26 input) and drives six 7-segment LED displays in multiplex fashion. Switches S1-S3 select the time format, while S4 & S5 are used to initially set the offset from UTC time. 5 2 1 D2 +5V 470Ω 22 µF NMEA DATA INPUT CON1 DB9M S5 S4 S3 S2 S1 5x 10k 2x 100nF +5V dp c b 12V IN details. It employs the microcontroller (IC1), six 7-segment LED displays, 21 transistors, five pushbutton switches and a handful of other parts. Virtually all of the work is done by the programmed PIC16F877A-I/P microcontroller (IC1). This accepts the NMEA 0183 serial data stream from the GPS receiver module (via CON1) and processes the data’s GPRMC sentences to extract the UTC time information. From this information it works out the equivalent local standard and daylight saving times and continuously updates all three times in its memory. When you select which time you want to display (using switches S1, S2 or S3), it displays that time continuously on LED displays DISP1-DISP6. The PIC runs from its own internal clock oscillator which has its frequency set by a 4MHz crystal (X1) connected between pins 13 & 14. The two 22pF capacitors provide the correct loading for the crystal, to ensure reliable starting of the oscillator. The displays are driven by the microcontroller in multiplex fashion via transistors Q1-Q20. Q1-Q14 are driven by outputs RB1-RB7 and in turn drive the display segments (a-g). Q15-Q20 drive the common display cathodes. These transistors are switched by IC1’s RC0-RC5 outputs. LEDs1-3 indicate which time mode is currently being displayed. These LEDs are directly driven by IC1’s RA0RA1 outputs and have a common 470Ω current-limiting resistor. In greater detail, the NMEA 0183 serial data stream from the GPS receiver module arrives at pin 2 of DB9M connector CON1. Because it has the same polarity as normal RS-232C data, it’s passed through a simple inverter stage based on transistor Q21 and then fed into pin 26 (RC7/Rx) of the microcontroller. This pin is the data input for the micro’s USART module. By the way, if you want to see what the NMEA 0183 data stream from a GPS receiver looks like, a sample is shown in Fig.2. This shows three of the sentences sent out by a typical GPS receiver every second, at 4800bps. The sentence which begins with the ID “$GPRMC” is the one we are interested in here. It’s provided by just about all GPS receivers and contains the UTC time data we want right “up front” (ie, in the first field following the ID code). In the GPRMC sentence shown, the UTC time field is 231034, siliconchip.com.au Building A Self-Contained Clock You don’t need to build the GPS-Based Frequency Reference described in the March-May 2007 issues of SILICON CHIP. Instead, you can derive the required NMEA 0183 data from a low-cost GPS receiver module and use that to drive the display readout. In particular, the GlobalSat EM-408 receiver module is ideal for this application. This GPS module was also used by Geoff Graham in the GPS-Synchronised Analog Clock described in the March 2009 issue and is readily The GlobalSat EM-408 available. GPS module. It’s quite easy to use the EM-408 GPS module. Accordingly, we have produced a compact add-on board containing this module which connects directly to the display unit. It can either fit inside the same case as the display board (and be wired directly to it) or installed in a separate case and connected via the DB9 connector. An advantage of the EM-408 GPS module is that it has a self-contained antenna and is extremely sensitive. As a result, it works perfectly well indoors without the need for an external antenna and associated cabling. The add-on GPS module will be described in Pt.2 in the June 2009 issue of SILICON CHIP. which indicates that the UTC time at that instant was 23 hours, 10 minutes and 34 seconds. The current date information is also visible near the end of the sentence, ie, “120309”, indicating March 12, 2009. In this project the program running in the PIC extracts this UTC time information from each GPRMC sentence and saves it in memory. It then works out the equivalent local standard time, by adding the time offset for your time zone (this information is initially fed in via switches S4 & S5) and this is also saved. And finally, it works out the corresponding daylight saving time and saves this as well. Once all three times have been updated, the program in IC1 then checks to see which time standard is currently being displayed. It then displays this time on displays DISP1-DISP6, driving the display segment lines from its RB1RB7 PORTB via transistors Q1-Q14. As indicated earlier, the individual 7-segment displays are switched on and off in sequence via transistors Q15-Q20. These are driven by IC1’s RC0-RC5 PORTC pins. As part of its operation, the program also scans switches S1-S5. If a switch has been pressed, it pulls its correspond input (RD0-RD4) low and this is detected by the program. As a result, IC1 either changes the display mode setting (S1-S3 pressed) or changes the stored time offset setting (S4-S5 pressed). The new settings are then saved in the PIC’s EEPROM memory, so they are not lost if the power is removed. Power supply Power for the circuit is derived from a 12V DC plugpack supply and this is applied to the circuit via DC connector CON2 and reverse polarity diode D1. The resulting 11.4V (nominal) rail is then filtered using a 470μF electrolytic capacitor and used to power the 7-segment displays DISP1-DISP6. The PIC microcontroller and inverter stage Q21 operate from a +5V rail. This is derived from the +11.4V NMEA 0183 DATA STREAM $GPRMC,231034,A,3356.3399,S,15108.2790,E,000.0,010.0,120309,012.6,E*63 $GPGGA,231034,3356.3399,S,15108.2790,E,1,10,1.0,57.3,M,19.6,M,,*65 $GPGSV,3,3,11,23,45,051,43,25,60,156,45,28,18,320,36*4F Fig.2: three of the sentences sent out each second by a typical GPS receiver. The one starting with “$GPRMC” has the UTC time information. May 2009  23 Construction As shown in the photos, all the dis- LED1 e d CON2 LED2 12V DC IN 4004 D1 470Ω LOCAL BC338 d g 100 µF REG1 78L05 LED3 D/S TIME dP b Q21 BC338 e f d 4148 NMEA 0183 INPUT CON1* DB9M 100nF D2 c 1 BC338 g c 22uF b d 10k 22k 100nF 4MHz X1 PIC16F877A-I/P 100nF IC1 dP b 2.2k c c Q4 BC338 * INSTALL CON1 FOR EXTERNAL NMEA 0183 SIGNALS ONLY DISP2 HOURSx1 56Ω 4.7k Q16 BC338 a d 10k 22k e f SELECT UTC S1 e Q11 a 56Ω e Q12 Q6 b Q17 SELECT LOCAL STD S2 1.8k 1.8k dP SELECT LOCAL DLS S3 BC338 Q18 c TU ODAER E MIT SP G f 19050140 9002 © BC338 g DISP3 MINSx10 d BC338 1.8k 1.8k 1.8k 1.8k Q5 f Q13 Q7 d a g DISP6 DISP4 MINSx1 a c + Q14 BC328 g 56Ω 100 µF S4 BC338 Q19 SECSx10 DISP5 INCREMENT MIN OFFSET S5 BC338 Q20 SECSx1 88 f b INCREMENT HRS OFFSET e g BC338 Fig.3: install the parts on the PC board as shown in this layout diagram. Make sure that all parts, including the displays, are correctly orientated and install CON1 only if you intend deriving the GPS time signals from an external unit such as the GPS Frequency Reference. 470 µF UTC Q15 BC338 DISP1 HOURSx10 c 10k 22k BC328 a b 56Ω Q10 BC328 Q3 56Ω Q9 10k 22k Q2 dP b 88 88 e f a V21+ D3 56Ω Q8 22k 56Ω + BC338 4148 10k 22k BC328 470Ω BC328 10k 10k 10k 10k BC338 10k 22k 10k 10k 22k Q1 BC328 10k 22pF BC328 330Ω 330Ω 330Ω 330Ω 10k 10k 10k 10k 10k 22pF That’s all there is to it. Now let’s look at the construction. 10k 24  Silicon Chip 330Ω 330Ω 330Ω line via 3-terminal regulator REG1, a low-power 78L05 device. A 100μF capacitor filters the output of the regulator, with additional filtering provided by a 100nF capacitor. + play circuitry is mounted on a single PC board. This fits snugly inside the a standard plastic enclosure with a clear lid. The PC board measures 211 x 135mm and is coded 04105091. siliconchip.com.au This view shows the completed display board for the GPS Clock. It’s powered using a 12V 300mA DC plugpack. Table 1: Resistor Colour Codes o o o o o o o o o No. 7 19 1 1 6 2 7 7 Value 22kΩ 10kΩ 4.7kΩ 2.2kΩ 1.8kΩ 470Ω 330Ω 56Ω Fig.3 shows the parts layout. Begin by carefully inspecting the PC board for any etching defects. Check also that the four corner mounting holes are drilled to 3mm. That done, the next step is to fit the 12 wire links and the resistors. Table 1 shows the resistor colour codes but check each one with a digital multimeter before installing it, just to make sure. Follow these parts with the capacitors – first the non-polarised ceramics and the MKT unit, then the four larger siliconchip.com.au 4-Band Code (1%) red red orange brown brown black orange brown yellow violet red brown red red red brown brown grey red brown yellow violet brown brown orange orange brown brown green blue black brown electrolytics. The latter are polarised, so make sure you fit them with the polarity shown on Fig.3. Crystal X1 can then be installed, followed by diodes D1-D3 (watch their polarity!). CON1, CON2 and the five mini pushbutton switches S1-S5 are next on the list. However, note that you will only have to install CON1 (the DB9 connector) if you are using an external source for the GPS time signals (eg, the GPS-Based Frequency Reference). If you build the add-on GPS module to be described next month, it can fit 5-Band Code (1%) red red black red brown brown black black red brown yellow violet black brown brown red red black brown brown brown grey black brown brown yellow violet black black brown orange orange black black brown green blue black gold brown inside the same case as the display board and be wired directly to it. Next, install the 40-pin socket for IC1. Make sure you fit the socket with its “notched” end to the left, to guide you when you later plug in the micro itself. Regulator REG1 can then be installed, taking care to orientate it exactly as shown. The 21 transistors are next on the list. Note that these are a mixture of BC338 NPN and BC328 PNP types, so take care here. The BC338s are used for Q1-Q7 and Q15-21, while the BC328s May 2009  25 If you intend using an external source of GPS time signals, then the display board can be installed in the bottom of the case as shown in the top photo. Holes are drilled/cut along one side (see photo above) to provide access to the switches, DC power socket and DB9 connector. are used for Q8-Q14. If you accidentally swap any of these transistors you’ll get some strange results, like missing segments or digits. After the transistors, fit the four Jumbo displays DISP1-DISP4, followed by the two smaller displays DISP5 & DISP6. These are all polarised and it’s important to fit each one with 26  Silicon Chip its decimal point LED at lower right. We don’t actually use the decimal points in this design but if you don’t fit each display correctly, it simply won’t work. Make sure that each display is sitting flush against the PC board before soldering its pins. The three indicator LEDs (LED1- LED3) are next on the list. These are mounted vertically, with their cathode leads towards the bottom of the board and their bodies about 10mm above the board so that they’re clearly visible. Use a red LED for LED1, a green LED for LED2 and an orange/yellow LED for LED3. Once the LEDs have been fitted, siliconchip.com.au siliconchip.com.au HOLES B: 5.0mm DIAMETER B 22 HOLE A: 10.0mm DIAMETER (SIDE OF LOWER SECTION OF ENCLOSURE) B B 16 10 ALL DIMENSIONS IN MILLIMETRES A 27.5 No adjustments are required – it’s just a matter of feeding in the serial data from the GPS module described next month (or from the GPS-Based Frequency Reference) and applying power. You’ll need a standard DB9MDB9F serial cable to make the connection to CON1. In addition, a 12V DC plugpack capable of supplying at least 160mA will be necessary to power the unit (eg, a 12V DC 300mA unit). As soon as power is applied, the displays should begin indicating UTC time (this can take anywhere from a few seconds up to about 40s), with LED1 lighting to show that this is the current display mode. This is the default start-up mode when the unit is powered up for the very first time. Assuming that it’s working so far, try pressing S2. LED2 should now begin glowing instead of LED1 and the displays should swing over to NOTE: USE ONLY IF MOUNTING DISPLAY BOARD IN BASE B 15.5 20.5 15.25 15.5 Putting it to work 34 Fig.4 shows the drilling details for the case. Note, however, that this diagram applies only if you are mounting the unit in the base of the case and feeding in the GPS time signals via CON1 (the DB9 connector) from an external source. If you elect to build the add-on GPS module (described in Pt.2) and install it in the same case, this will require a slightly different mounting arrangement for the display board (details next month). As shown in Fig.4, all the holes are along one side of the base. You have to drill five 5mm holes for the switches plus a 10mm hole to provide access to the DC power socket. In addition, a 34 x 16mm cut-out is necessary to access the on-board DB9M connector. You can either use Fig.4 to mark out the case for drilling or it can be copied and temporarily attached to the side of the case for use as a drilling template. Use a small pilot drill to drill each hole first, then carefully enlarge it by stepping up the drill size. The 10mm hole is best enlarged to size (from about 5mm) using a tapered reamer. The square cut-out is made by drilling a series of small holes around the inside perimeter, then knocking out the centre piece and carefully filing the job to a neat finish. The PC board can now be installed in the case. To do this, first position 24 Preparing the enclosure four M3 x 6mm untapped spacers on top of the four corner mounting pillars moulded into the bottom of the enclosure. That done, you then have to slowly lower the board into the case without disturbing these spacers. Note that you will have to angle the switch side of the board down as its lowered into the case, so that the switch actuators go through their holes. Once it’s in position, secure the board in place by fitting an M3 x 10mm machine screw to each corner position. Fig.5 shows the details. All that remains now is to attach the clear top of the enclosure, using the six screws supplied. There’s no real need to fit the supplied rubber sealing strip between the two halves of the enclosure but you can fit it if you wish. 29 all that remains to finish your GPS time display board is to plug the programmed PIC micro (IC1) into its socket. Take care to plug it in with its notched pin1 end towards the left, as shown on the parts layout diagram. The completed board assembly can then be placed aside while you prepare the enclosure. 39.5 It’s not long ago that a really accurate time display based on a caesium-beam “atomic clock” was something only standards labs could consider. The rest of us had to rely on time signals from shortwave or VLF radio stations, which gave only “reasonable” accuracy. This all changed when the US military set up its Global Positioning System (GPS). That’s because every GPS satellite contains two caesium-beam clocks, which are used to ensure the system’s navigational accuracy. These satellites broadcast an updated digital UTC (Universal Time Co-ordinated) time signal every second, which means that you can obtain an extremely accurate time display simply by decoding the time information from a GPS receiver. This includes the receivers used inside GPS navigator devices. As a result, many such units can either display the time continuously or on demand. B Atomic Clock Standard Via GPS Fig.4: follow this case drilling diagram only if you intend feeding in the GPS time signals from an external source – see text. May 2009  27 Parts List 1 PC board, code 04105091, 211 x 135mm 1 polycarbonate enclosure, 222 x 146 x 75mm with clear lid (Jaycar HB-6258 or similar) 5 PC-mount 90° momentary mini SPST pushbutton switches (S1-S5) 1 4MHz crystal (X1) 1 PC-mount DB9M connector (CON1) – see text 1 PC-mount 2.5mm concentric DC plug (CON2) 1 40-pin DIL IC socket, 0.6-inch spacing 4 M3 x 6mm untapped Nylon spacers 4 M3 x 10mm screws, pan head 1 300mm length of 0.7mm tinned copper wire (for links) Semiconductors 4 7-segment displays (CC) with 58mm high digits (Jaycar ZD1850) (DISP1-4) 2 7-segment displays (CC) with 13mm high digits (Jaycar ZD1855) (DISP5-6) 1 PIC16F877A-I/P microcontroller programmed with 0410509E.hex (IC1) 1 78L05 +5V regulator (REG1) 14 BC338 transistors (Q1-Q7, Q15-Q21) 7 BC328 transistors (Q8-Q14) 1 5mm red LED (LED1) 1 5mm green LED (LED2) 1 5mm orange LED (LED3) 1 1N4004 1A diode (D1) 2 1N4148 diodes (D2,D3) Capacitors 1 470μF 25V RB electrolytic 2 100μF 16V RB electrolytic 1 22μF 16V RB electrolytic 1 100nF MKT polyester 2 100nF multilayer monolithic 2 22pF NPO disc ceramic Resistors (0.25W 1%) 7 22kΩ 6 1.8kΩ 19 10kΩ 2 470Ω 1 4.7kΩ 7 330Ω 1 2.2kΩ 7 56Ω local standard time. Initially, this will be local standard time for eastern Australia (EAST), because that is also the default setting (ie, an offset of +10 hours). However, this offset can be easily changed to suit your own time 28  Silicon Chip 10mm x M3 SCREW LED2 LED1 LED3 (DISP1) (DISP2) PC BOARD Fig.5: the display board is mounted inside the case on 6mm untapped Nylon spacers and secured using M3 x 10mm machine screws. 6mm UNTAPPED NYLON SPACER MOULDED MOUNTING PILLAR WITH THREADED INSERT (LOWER PART OF ENCLOSURE) zone, as detailed shortly. For the present, just try pressing S3. This should bump the time forward by an hour to show local daylight saving time. Of course, this third time variant may or may not be of any interest to you, depending on both the time of year and whether your region observes daylight saving. If you live in Queensland or the Northern Territory, for example, you won’t need to worry about daylight saving time. What if you live in a state or region of Australia other than the eastern states, or in another country altogether, where the time zone is quite different? In that case, how do you set the display’s offset so it will display the correct local standard and daylight saving times for your location? In practice, it’s quite easy – just briefly press switch S2 (so that the unit shows local standard time), then press S4 a number of times until the hours indication is correct for your local time (NOT daylight saving time). You’ll find that each time you press S4, the display will blink and the hours indication will increment by one – up to a maximum of 23, when the hours display will drop back to 00 and then begin climbing again. In most cases, repeatedly pressing S4 (to get the correct hours indication for local time) is all you need to do to set the offset from UTC. However, if you live in places like South Australia or the Northern Territory, where the offset has a 30-minute component as well, you’ll also need to press S5. This increments in 30-minute steps, so you’ll only have to press it once. As a matter of interest, we’ve prepared a table (Table 2) showing the offsets for all states and regions of Australia plus those for New Zealand, various countries in Asia, regions in the USA and Canada and a few others. Alternatively, look up your timezone on http://worldtimezone.com UTC-LOCAL STD TIME OFFSETS STATE, REGION OR COUNTRY New South Wales (except Broken Hill) OFFSET (HOURS) +10 Queensland, Victoria, Tasmania, ACT +10 South Australia, NT, Broken Hill +9.5 Western Australia +8 Papua New Guinea +10 New Zealand, Fiji +12 Indonesia (West, East) +7, +8 China, Hong Kong, Taiwan, Singapore +8 Japan, Korea +9 India +5.5 Pakistan +5 Saudi Arabia, Dubai +3 Russia (West – East) +3, +4 – +11, +12 South Africa +2 France, Spain, Italy, Scandinavia +1 United Kingdom, Portugal 0 USA and Canada (West – East) –4, –5, –6, –7, –8 Mexico –6 Argentina, Brazil –3 Columbia, Ecuador, Peru –5 For further information visit http://worldtimezone.com Table 2: this table shows the offsets from UTC time for various regions throughout the world. In most cases, the offset is simply a certain number of hours, depending the longitude east or west of the Greenwich meridian which is used to reference UTC. Only in a small number of cases does the offset involve minutes as well as hours (eg, South Australia and the Northern Territory, where the offset is 9 hours and 30 minutes). Saving the settings Each time you press any of the five switches S1-S5, the micro not only responds in the desired way but also saves the current settings in its nonvolatile EEPROM memory. This means that once set, you don’t have to reset the offset again even if the power is lost. The only time you do have to reset the offset is if you move to a location in a different time zone. Next month, we’ll describe the addSC on GPS module. siliconchip.com.au