Silicon ChipAdvanced GPS Computer - July 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions
  5. Publisher's Letter: The importance of repair
  6. Feature: Mixed menu by Mark Nelson
  7. Feature: The Fox Report by Barry Fox
  8. Project: Net Work by Alan Winstanley
  9. Project: Single-Chip Silicon Labs FM/AM/SW Digital Radio Receiver by Charles Kosina
  10. Project: Model Railway Level Crossing by LES KERR
  11. Project: Advanced GPS Computer by Tim Blythman
  12. Feature: Make it with Micromite by Phil Boyce
  13. Feature: Max’s Cool Beans by Max the Magnificent
  14. Feature: Flowcode Graphical Programming by Martin Whitlock
  15. Back Issues: Flowcode Graphical Programming by Martin Whitlock
  16. Feature: Circuit Surgery by Ian Bell
  17. Feature: AUDIO OUT by Jake Rothman
  18. Feature: Electronic Building Blocks by Julian Edgar
  19. PCB Order Form
  20. Advertising Index

This is only a preview of the July 2022 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Advanced GPS Computer Part 2 – construction and use Our new GPS Computer has host of useful features. In Part 1 we described how it works, so this month we’ll move onto the construction and instructions for use. We’ll also delve into how the software works, for those who are interested. by Tim Blythman W e have a lot to cover in this article – after describing the assembly of the custom board, putting it all together and fitting it into its case, we also need to explain how to use its many features. Since the software is quite complicated and we had to solve some interesting problems to make it work, we also have a separate panel explaining some of the code’s trickier details, including the CFUNCTIONs that do most of the hard work. You can read that one if you are interested, or skip it if you aren’t. So without further ado, let’s move on to putting the Advanced GPS Computer together. Construction You will need to build the Micromite V3 BackPack module with a 3.5-inch LCD touchscreen. Its construction was detailed in the August 2020 issue. If you haven’t already done so, you need to fit the DS3231 RTC IC and its accompanying passive components to the V3 BackPack (see photos overleaf). This is a surface-mounting part, so the usual cohort of SMD gear will be required. There are also a few SMDs on the GPS Computer PCB. 32 A fine-tipped temperature-adjustable soldering iron is highly recommended, along with fine solder wire, flux paste, tweezers, a magnifier and solder-removal wicking braid. The flux releases smoke when soldering, so good ventilation and/or fume extraction is needed. Start by applying flux to the pads for the DS3231, then carefully tack one lead in place, ensuring that its pin 1 matches the dot marked on the PCB. If necessary, adjust its position to centre the chip on its pads and ensure it is sitting flat on the PCB, then solder the remaining pins. Remove any bridges between pins by applying extra flux and then pushing the braid against the bridge with the iron. Allow it to draw up the excess solder before carefully pulling it away. Fit its bypass capacitor next, followed by the two resistors, and trim their leads short. When fitting header socket CON9, ensure it is placed on the PCB’s underside and soldered from the top. Check that it is square and vertical so it will mate properly with the matching socket on the board underneath. You might like to leave this for later, and line up all the headers at the same time by sandwiching them between Practical Electronics | July | 2022 One tile which we are sure will be popular is a simple, clear, large, easy-to-read speed readout. The units can be changed between many common road, nautical and aeronautical options. There’s even enough room left over to add a handful of other tiles below this. the two PCBs for alignment. This will guarantee that the headers will match. Also make sure to fit female headers to the underside of the V3 BackPack for the standard Micromite I/O pin connections. GPS Computer PCB assembly Refer to the PCB photos and overlay diagram, Fig.2, during construction to assist with component placement and orientation. Start with the surface-mounted components on the GPS Computer PCB. This includes Q1, Q2, IC3 and IC4. Apply flux to the pads and rest the parts in place. Take care not to mix up Q1 and Q2. Q1, Q2 and IC4 should only fit one way, but you’ll need to check IC3’s orientation. Its pin 1 should be towards the centre of the PCB. Tack one lead of each component and check the remaining pins are flat and square within their pads, adjusting if necessary. Then solder the remaining pins and remove any bridges, as described above for the DS3231 on the V3 BackPack PCB. Once the surface-mounted parts are fitted, clean the PCB with a flux cleaner and allow it to dry before continuing. Through-hole parts Continue by fitting the fixed resistors. The values are marked on the PCB silkscreen; check each batch with a multimeter to confirm their values. After soldering, trim the leads close to the PCB so it will fit in the enclosure later. Fit the two diodes next. The larger 1N5819 type (D1) is near CON2, while the smaller 1N4148 is near CON4. Observe their polarity and match the cathode bands to the PCB silkscreen. IC1 and IC2 go near the middle of the PCB, with their pin 1 markings facing away from the other. Carefully bend the leads so that the pins will slot into the PCB. Tack one lead in place and confirm the parts are flat before soldering the remainder. Practical Electronics | July | 2022 Fit CON1 and CON2 next. We found that these needed to be pressed quite firmly to snap into place, but this means that you can confirm their position before soldering. VR1 is next; ensure that its wiper goes to the topmost pin and that it sits flat against the PCB. The 220µF electrolytic capacitor is mounted on its side, so install it next, right near VR1. Check that the negative-striped lead is closest to CON1. It’s easiest to bend the leads 90° before soldering it in place. There are six 1µF ceramic capacitors; four near IC1 and two near IC2. Their values are marked on the PCB. Follow with the two 4.7µF ceramic caps near IC4. None of these are polarised. Then mount the four 100nF MKT capacitors, then the solitary 10nF capacitor. Again, none are polarised. The Advanced GPS computer PCB fits to the rear of a stack consisting of a Micromite V3 BackPack and a 3.5in LCD. A tactile switch can be mounted to the rear at the pads labelled SW2 (S2) to allow operation from the rear of a UB3 Jiffy Box. An integrated Li-ion battery and holder fit into a cutout within the rear PCB. 33 Fig.2: the GPS Computer add-on board has four SMDs plus quite a few through-hole components. Of the surface-mounted devices, only IC4 has pins that are relatively close together, but there are only six of them. Ensure IC3 and IC4 are fitted with the correct orientation, then solder Q1 and Q2 and move onto the through-hole parts. The large rectangular cut-out is sized to fit a standard Li-ion rechargeable battery, either soldered directly to the board or in a holder. 220mF We’ll leave off some parts for now, including JP1, JP2, LDR1, LED1, the battery holder and tactile switch, so that we can align them correctly as part of the mechanical assembly after the headers are fitted. Headers and mechanical assembly Space in the UB3 Jiffy Box is tight, especially if you will be fitting the speaker and GPS module internally. Thus, we mount header sockets on the Micromite board and then solder individual male pins to the GPS Computer PCB, to save 2mm in height. We’ve made a custom front panel for this project (rather than reusing the existing 3.5-inch BackPack laser-cut panel) for two reasons. First, it needs holes for the LDR and LED. Second, we have reverted to a design that sits ‘on top’ of the UB3 Jiffy Box, rather than slotting into the top cavity. This gains us another 3mm of usable space inside. This also allows us to add another hole above VR1 to enable adjustments to be made after the unit is fully assembled. The battery holder, LDR1 and LED1 all need to be fitted carefully to ensure they align neatly within the enclosure; that’s why we’ve left them until now. The battery holder needs to clear both the BackPack PCB and the case. There’s a bit of wiggle room, but it’s easier to judge when all the parts are present. As a rough guide, the battery holder’s centre axis should be in line with the PCB. Similarly, the LDR and LED are fitted to be near-flush with the top of the enclosure, and this is another thing that’s easier to do with everything present. It’s also easier to check and judge the holes that need to be made in the enclosure now. Everything is effectively fitted to the back of the front panel, which is then installed into the enclosure. So start with the front panel, with the matte side facing out. The LCD module fits with its 14-way header at the opposite end to the LDR and LED openings. Note from our photos how the silver connections at the touch panel’s edge align with the front panel. The LCD module is mounted using four 12mm M3 machine screws, and is stood off the front panel with M3 nylon washers, which provide space for the soldered ends of the LCD module headers. Secure the LCD module to the front panel with four 12mm tapped spacers. If you haven’t fitted the header sockets to the underside of the Micromite V3 BackPack already, then do this now. You can use the GPS Computer PCB as a jig by slotting (but not soldering) the corresponding headers in place, to align the female headers squarely with their PCB. Now slot the Micromite V3 BackPack onto the LCD module, using its 14-way header. Then secure the GPS Computer PCB to the BackPack using 15mm machine screws threaded through the GPS Computer PCB, through the shorter spacers and BackPack into the previously installed tapped spacers. Check that the pads on the GPS Computer PCB line up with the sockets on the BackPack. Then remove the pins from their plastic spacers (eg, pull them out with pliers) and slot them into the headers through these pads. There are 24 in total; one 18-way, one four-way and one two-way. Ensure they are down firmly and level before soldering. When all are soldered, trim their ends. Fit the LED and LDR next. Align each component with its front panel hole and the GPS Computer PCB pads. A piece of masking tape over the holes in the front panel is a simple way to hold the parts flush against it. The LDR is not polarised, so can be fitted either way, but the LED orientation will matter. Set a DMM to diode test mode and connect its probes to the LED leads so that it lights up red. Failing that, use a 5V supply and a 470Ω current-limiting resistor. The lead to the red DMM probe (+) or positive supply lead is then inserted into the LED hole on the PCB nearest CON2. Slip small-diameter heatshrink tubing over the LDR and LED leads to prevent them from contacting anything if something comes loose. Before fitting the battery, check that the charging circuit is working correctly. Apply power to the USB socket The V3 BackPack should look like this when fitted with the DS3231 RTC IC and its associated passives. The 5V USB power jumper is required too, as seen in the lower left corner. Also note the two-pin header (CON9) soldered to the underside of the BackPack PCB. 34 Practical Electronics | July | 2022 When constructing the PCB, note that the Micromite and GPS headers are individual pins that are installed without their plastic shrouds by fitting them into their matching headers before soldering. The LED and LDR (shown with yellow heatshrink on their leads) are installed last to ensure they align with the front panel; SW2 with the back panel. on the BackPack PCB; the voltage at the battery terminals should settle around 4.3V. The LED should also briefly light up green (perhaps after showing red), indicating that the charge IC has reached its ‘full’ voltage. If it is showing red, try reversing the LED. If it is near 5V, then there might be a fault which is connecting USB power directly to the battery. Do not connect the battery if this is the case! Fix the problem before proceeding, as such a fault could damage the battery or cause a fire. Disconnect USB power and unplug the GPS Computer PCB. Connecting the battery If you have a battery with tabs, you should take great care not to bridge any parts to the battery except the terminal you are working on. Beware that your iron may be earthed and there may be a path for current through it if it touches anything else. And of course, double-check the polarity! Fitting a holder is preferred, as we don’t have to worry about working with the live battery, and can pop it out before working on anything. It will also be much easier to change in future should it fail. Note from our photos that the battery faces outwards, allowing it to be changed if needed. In the unlikely event of it falling out, it will be held against the plastic enclosure rather than being thrust against the sharp edges of the BackPack PCB. Bend the leads so that the battery holder can be fitted to the PCB, then slot the leads into their pads. Then reattach the GPS Computer PCB to the BackPack to check locations and clearance. You might even like to use a plastic spacer to provide positive separation. Check the polarity, then use a generous amount of solder to secure the battery holder. When finished, remove the GPS Computer PCB. You can now fit JP1 and JP2, using a similar technique to the other headers, removing the pins from the plastic housing to reduce their height. If you have a spare fourway header socket, this can be used to secure and align the pins as they are soldered. Alternatively, if you intend to have a permanent setting for JP1 and JP2, these can be replaced with small wire loops soldered directly to the PCB pads. Press the PCBs together to check that JP1 and JP2 do not foul the BackPack PCB. Then fit the battery and reattach the PCB to the stack. Now is a good time to trim the short lead stubs at the back of the GPS Computer PCB. Installing the GPS module As we noted last month, we found that the POWER LED on the VK2828 GPS module drew about 2mA, even with the ENABLE pin taken low. Removing the LED brought this down to 40µA, so we suggest you do the same before fitting it. Next, solder the GPS module and speaker to their terminals. Note there are only four connections needed. Since the VK2828 modules have two spare leads, these can be terminated to either of the spare pads on GPS1 to stop them from floating around. We attached the GPS module and speaker to the PCB’s rear using double-sided tape during testing. Once everything is working, they can be secured with neutral-cure silicone sealant. We wouldn’t use hot-melt glue as it could loosen if the unit is inside a hot vehicle parked out in the sun. The assembly should slot into the UB3 case comfortably. If not, check your clearances before proceeding. Case cutting There are four holes to cut in the case – refer to the cutting diagram, Fig.3. It’s a good idea to check this against your assembled board, to ensure that everything is aligned and any minor variations in construction are accounted for. The 3.5mm sockets are set behind the panels to prevent the PCBs from catching on the case. Thus, you might need to enlarge these holes if you have bulky 3.5mm leads. This is easily done with a larger or stepped drill bit, or a tapered reamer. We have fitted the V3 BackPack with female headers (like the RCL Substitution Box from June and July 2021). This allows shortened male headers to be installed on the GPS Computer PCB, making the final assembly more compact, to better fit into the box. Practical Electronics | July | 2022 35 to draw guidelines on the enclosure before cutting. A simple wipe with a finger is enough to remove pencil marks. The diagram also shows the location for a hole if you have a PCB-mounted tactile switch fitted to the S2 pads. A button with its actuator top 12mm above the PCB will sit just behind the panel (requiring a pen or similar to operate), while one that is around 15mm will sit just proud of the enclosure and be more accessible. So you should choose a height that suits how accessible you want the switch to be. Alternatively, any momentary switch can be run back to the terminals marked S1. This will allow you to fit a panel-mount pushbutton to the side or top of the case if the back is not suitable. We haven’t included any speaker vent holes; these will depend on your speaker’s size and location. Programming the chips There are a few ways to program the microcontrollers for this project. You can use the in-circuit serial programming (ICSP) interface to upload a HEX file (using either the Microbridge or an external programmer such as a PICkit 4), but remember to detach the GPS Computer PCB so that its connections do not cause a conflict. Use your programmer’s instructions to upload the HEX file (GPS COMPUTER V30 (0510221A).hex), which you can find on the July 2022 page of the PE website. If you have a V3 BackPack that is already running MMBasic, you don’t need to worry about ICSP programming. We usually use MMEdit to work with BASIC files, but the process is much the same if you use TeraTerm instead. We’ve used MMBasic version 5.5.3, and we recommend you do the same, especially if you are installing MMBasic from scratch. We have not tested our code with other versions. Load the GPS Computer Library.bas file into the Micromite. Then, via the terminal, run the commands: LIBRARY SAVE CPU RESTART The Micromite will reset and load the ILI9488 display driver. Now you can run: OPTION TOUCH 7, 15 GUI CALIBRATE These commands are noted in the comments at the start of the library file. You can test the touch and LCD with these commands: GUI TEST LCDPANEL GUI TEST TOUCH Fig.3: there are just three holes in the sides of the box (two round holes for the 3.5mm jack sockets and a rectangular one for USB) plus a 4mm hole in the rear of the case to access the tactile power-on switch. Or you can fit a chassis-mounting switch instead. To create the square hole for the USB lead, we suggest drilling a 10mm hole within the outline. Then open out the corners with a needle file or similar. You can use a pencil 36 Next, load the main GPS COMPUTER V30.bas file and run it. If you have trouble with the GPS COMPUTER V30. bas file, try the crunched version (with a ‘c’ suffix: GPS COMPUTER V30C.bas). This has had all the extraneous whitespace and comments removed. We found that our program was so large that even the ‘crunch on load’ option does not remove enough whitespace; it appears to leave some behind to maintain line numbering. This will get the Micromite to the same state as if it were programmed with an ICSP programmer and HEX file. Setup and basic use Reassemble the stack if it is not complete, and supply power via the USB socket. A splash screen will appear for a few seconds, after which the MAIN MENU page (Screen1) should be displayed. If not, you might need to run the MMBasic program from the prompt, using a serial terminal program at 38,400 baud. Practical Electronics | July | 2022 Code in depth Since we have had so many requests for tweaks and updates to the Boat Computer, we will provide a bit more background on the inner workings. We are pretty much at the limits of what MMBasic can store in the Micromite’s Flash memory, so some things have been done in terse and non-obvious ways to save Flash memory. The following is detailed. It isn’t critical to understand it; you certainly won’t need it to operate the GPS Computer with its default programming, but rather if you’re interested in making code changes. As with many Micromite projects, the colour scheme is set by several CONST values near the start of the program. Altering these is one of the simplest ways to personalise the GPS Computer. The chime sound heard alongside messages is defined just after the splash screen is displayed and is held in the BELL variable. Although declared as an integer type to allocate memory, it is processed as an array of bytes. It is created by a formula which generates a decaying sinewave which goes for 8000 samples, or one second. Changing this formula is the easiest way to customise this sound. The click sound (when buttons are pressed) and voice warning are stored in Flash memory as part of the library file. The tile feature works through the TILE function, which calls individual functions based on each tile type. These specific functions can draw the tile graphics (using the coordinates they are set to), report their width or height (so the COMPOSE page can display them), or react to a button press. Creating new tiles will require other tiles to be replaced. The tile name is stored in the T_TYPE string array. Many tiles depend on other functions that return strings representing numerical values adjusted for and suffixed with the currently selected units. Any time the Micromite is not busy, it calls the IDLE subroutine, which attends to background tasks such as receiving and processing GPS data. It behaves like MMBasic’s PAUSE, but does other activities and can return control to the main program if a touch is detected on the touch panel. It also periodically updates the top right of the display, and adjusts the volume and backlight as needed. The number of pages, tiles and POIs are limited by the amount of available VAR SAVE Flash memory; for the Micromite, this is 2kB. If you wish to adjust the balance of these items, the PG_CNT, ITEM_COUNT and POI_COUNT constants can be changed. We have already pushed these number to their limits, so increasing any one will require another to be decreased. Note that the MAIN MENU page only has room for up to six pages, so any more than this will not be accessible through the existing interface. Library and CFUNCTIONs For example, function 0 (CONST AUDIO_INIT) starts the timer interrupt in preparation for other functions. If you are using the LPC samples, then the CFUNCTION needs to know the location for some constant parameters. These can be set by pointing them to one of the data CFUNCTIONs noted earlier using API function 11, thus: JUNK=COMBINED(LPC_SET_CONST_PTR, PEEK(CFUNADDR LPC_CONST)) With this done, we can play audio samples. API function 4 (AUDIO_ GET_STATE) reports the current state to avoid interrupting playback in progress. API function 1 (AUDIO_SET_PTR) sets the PCM data pointer, while API function 2 (AUDIO_PLAY) starts playback, like this: IF COMBINED(AUDIO_GET_STATE)=0 THEN JUNK=COMBINED(AUDIO_SET_PTR, PEEK(CFUNADDR CLICK)) JUNK=COMBINED(AUDIO_PLAY) ENDIF Replacing API function 2 with API function 6 (AUDIO_LOOP) will cause the sample to loop, while API function 7 (AUDIO_END_ LOOP) will cause a looping sample to revert to non-looped playback. This means that it will complete the current cycle instead of being cut off abruptly. We’ve written a small program in C which can convert WAV files into MMBasic CFUNCTION data; this is in the software collection as sample.c, compiled for Windows as sample.exe. Playback of LPC data works similarly, using API functions 8 (AUDIO_LPC_PTR) and 9 (AUDIO_LPC_START) respectively. We’ve included a spreadsheet document which can translate Arduino LPC sample definitions into CFUNCTION data. GPS decoding works similarly. API number 48 (GPS_SET) sets a pointer to a string variable which is filled with data from the GPS module by the MMBasic code. The MMBasic string variable format consists of one byte indicating the length, followed by up to 255 data bytes containing the string contents, eg: JUNK=COMBINED(GPS_SET, PEEK(VARADDR GPS_DATA)) API numbers 50-55 (GPS_PARSER0 – GPS_PARSER5) set pointers to string arrays. The first element of each array is filled with the sentence signature that is scanned for: GPRMC_PARSE(0)=“$GPRMC” The ILI9488 display driver is not new, and is based on code by Peter Mather at the Back Shed Forum (an excellent resource for Micromite-related discussion). See: www.thebackshed.com/ forum/ViewTopic.php?TID=11419 Apart from the GPS and audio CFUNCTION, we’ve also incorporated some CFUNCTIONs as wrappers for data to be stored in Flash. These aren’t actual executable code, but can be stored compactly without the overhead of MMBasic. The COMBINED CFUNCTION incorporates the audio and GPS features that we use in this project. Each sub-function is invoked by calling the COMBINED function with a different first parameter. These parameters are listed near the start of the MMBasic code as the API (application programming interface) numbers paired with named constants. When API number 49 (GPS_PARSE) is executed and finds a valid sentence, it reports the matching parser’s API number and copies the sentence elements (which are simply separated by commas) into the remaining array elements. Since certain items are always found at certain sentence locations, the appropriate array elements always contain the necessary data. Note that the string array dimensions and lengths are hard-coded into the CFUNCTION and must match. Once the elements are copied, the array elements containing latitude and longitude can be decoded into degrees, minutes and fractional minutes by using API numbers 61, 62 and 63, respectively. These return integers as there is much more overhead required for CFUNCTIONs to work with floating-point numbers. While the splash screen is displayed, the Micromite is busy generating audio data for later playback. It requires less Flash memory to generate these into RAM than to hard-code them, so we put up with the brief delay while this happens. Since the Flash memory is quite full, but barely half the RAM is used, this is to our advantage. All screens will display the information seen at top right. You can quickly check the time, GPS status (a red or green G) and battery state at a glance. Practical Electronics | July | 2022 37 The five top items down the left-hand side (Screen3) are the settings for display units; pressing each button cycles between three and six options. These include three styles for latitude and longitude, including degrees, minutes and seconds, decimal degrees and the decimal minutes mode which GPS modules use. The latitude and longitude sign can be displayed as N/S or E/W, negative sign only (with implied positive sign) or explicit positive and negative signs. Both horizontal distance and vertical distance units can be set independently. The choices are metres, feet, kilometres, miles, nautical miles or flight level. Flight level is measured as multiples of 100ft and is often used for altitude Here’s a side view to show how tightly everything is packed into the stack of PCBs, in aviation. allowing room for a GPS module and speaker inside the UB3 Jiffy Box. Speed offers the choice of The time can be set to 12-hour or 24-hour format; the metres per second (m/s), kilometres per hour (km/h), miles 24-hour format shows seconds as it does not need room to per hour (mph) or knots (equal to nautical miles [NM] per show the AM/PM indicator. hour). None of these options are stored permanently until At first start, the red ‘G’ will be displayed until the GPS the SAVE button is pressed. This reduces wear on Flash receiver is outputting valid data, which could take 15 min- memory, and allows you to test settings before commitutes for the first time, even under good conditions. The ting to them. battery icon should show a green charging symbol when The bottom item at left is for adjusting some numericonnected to USB power. cal values. The ← button cycles between time zone, backPressing any button will trigger a short click to let you light high, backlight low, speed high, speed low, volume know that the button press has been detected, while a short high and volume low. You can adjust each value with the chime accompanies messages and errors. The volume of + and – buttons. these can be adjusted using VR1. A short press increments or decrements each value by The RAW DATA page (Screen2) helps with checking the a small amount, while holding the button down allows GPS state. Check the satellite count; if you don’t see at least it to change quickly. The time zone changes by 15-minfour after 15 minutes, and you have good sky visibility sky, ute increments. there might be a problem with the GPS module. Zero satellites The backlight high and low settings set the brightness in may mean that the GPS module is not receiving signals at all. high and low light conditions, respectively; the GPS ComThe EXIT button will always return to the MAIN MENU. puter interpolates between these. Set the high level to be The SETTINGS page sets most user preferences such as comfortable in daylight, and the low level to be comfortunits and GPS Computer behaviour. able at night (or when the sensor is covered). Screen1: on power-up, and whenever the EXIT button is pressed, the GPS Computer displays the MAIN MENU screen. Four custom pages are accessible through the buttons at left, while the buttons at right provide options to change settings and customise pages. 38 Screen2: this page allows some troubleshooting of the GPS Computer. The satellite count is a good indicator of any problems the GPS module might have; we typically saw 1112 satellites using a VK2828 GPS module. Practical Electronics | July | 2022 Speed-based volume control Similarly, the high-speed setting corresponds to the speed at which the high volume setting is used, and the low-speed setting to low volume. Note that the displayed units will match the currently selected units. Internally, all speeds are in m/s and converted as needed. See Fig.4 for a graphical explanation of this. We suggest leaving the low and high speeds around these values, then getting a passenger to adjust the volume levels to be comfortable when travelling around the low and high speeds. This is because there won’t be much road or engine noise below 30km/h, and not much change above 80km/h. If you find this isn’t the case, then you can try tweaking these values too. Remember that both brightness and volume are programmed to ramp quite slowly (around 10% per second), so give the unit time to respond to significant changes. The RTC always keeps track of coordinated universal time (UTC), and the local time to display is calculated from that, based on current time zone and daylight savings settings. Turning daylight saving mode on and off is done by pressing the DST button. A ‘+’ indicates that daylight savings is in effect and one hour is added to the current offset; a ‘–’ means no adjustment from the set time zone. In practice, if you live somwhere which uses DST, you should only need to adjust the time twice a year by merely pressing the DST button to turn daylight savings on or off. When the GPS Computer displays a green ‘G’ icon, pressing the TIME button will save the current GPS time to the RTC. If you get an error message, it might be that the RTC IC is not connected or not working correctly. The 12HR or 24HR button toggles how the time is displayed; the style shown on the button is currently active. The button marked ‘S<’ or ‘S–’ indicates whether the synthesised audio output is activated; again, the button shows the current state. Battery sensing The six buttons at top right of the SETTINGS page control battery behaviour. The HI voltage is the threshold below which it is assumed that USB power is not available, while the LO voltage sets the lower limit for battery operation, below which the unit will shut down. In use, the battery icon will be green above HI and yellow between HI and LO. A bar-graph showing rough stateof-charge and a percentage are shown in the yellow phase. Screen3: we have crammed a lot onto this screen to cater to most users’ preferences. The SAVE button is needed to save any parameters to Flash memory (to be saved through power-down), including POIs (points of interest) and custom page layouts. Practical Electronics | July | 2022 Below LO, the TO timer starts counting, and this is shown in red next to a red battery icon. When the timer expires, the software takes pin 9 low, meaning that the unit will power off if running from battery power. Any time the voltage rises above LO, the timer will reset. The defaults of 3.8V for LO and 4.4V for HI mean that the GPS Computer should run for as long as practicable from a Li-ion battery. The MAIN MENU page also shows the state of pin 9 as POWER(1) or POWER(0). Pressing the button will toggle the pin state. You can use this to force the GPS Computer to shut down even if it has some remaining battery life. The MAIN PAGE also has a SLEEP button, which turns off the backlight and puts the Micromite into its lowest power mode. The GPS module is still fully powered, so should be able to maintain a satellite fix. This is handy for conditions where you wish to save power but also require the GPS Computer to start up again with minimum delay. Pressing the screen for around one second will cause the GPS Computer to leave sleep mode. The long press is needed as the Micromite can only test for touches once per second in its low-power sleep mode. Points of Interest (POIs) The POI EDITOR feature (Screen4) is accessed from the POI button on the MAIN PAGE. Five POIs are displayed Fig.4: if you are using the speed-sensitive volume control feature, this is how it works. The volume is fixed from stationary up to the low-speed threshold, after which it rises until reaching the maximum volume setting at the high-speed threshold. Screen4: the POI (point of interest) EDITOR allows the current coordinates to be quickly saved with the ADD HERE button. Any POI can be activated by scrolling up or down and then pressing the SET button at right. 39 Screen5: the ADD HERE button provides a default name based on the coordinates; You can alter it by pressing the cancel button and using the keyboard. You will be prompted to confirm the name before it is stored. Screen6: custom coordinates can be entered in either degrees/minutes/seconds or decimal degrees. They are confirmed in the currently selected display units for latitude and longitude before being displayed in the POI list. from a larger list, and the complete list can be accessed by pressing the scroll buttons at left. One POI is marked in green; this is the currently active POI and is activated by one of the SET buttons at right. The current POI is used in any of the screens that provide POI tracking. Each non-empty entry shows a custom name, an absolute compass heading toward the POI, as well as its latitude, longitude, altitude and distance away. Pressing the ADD HERE button creates a POI with the current GPS coordinates; a default name based on the latitude and longitude is offered, but can be altered by pressing CANCEL. The ADD POI button allows all this data to be entered manually, such as creating POIs from a map or GPS coordinates. Screen5 and Screen6 show the relevant entry displays. Latitude and longitude can be entered in either decimal or degrees/minutes/seconds format; the value is converted to the currently set units for confirmation. Both ADD buttons will always look for an empty slot, so there is little risk of overwriting an existing POI. The DELETE button needs to be used to clear a slot, and an error message is provided if there are none. Finally, the REFR button refreshes the display. This is necessary as the headings and distances do not automatically refresh. Composing your own displays The COMPOSE page (Screen7) shows why the GPS Computer is so much more flexible than the Boat Computer. With so many people asking for specific combinations of information to be displayed, it made sense to make this as versatile as possible. So we’ve designed 23 different ‘tiles’, each capable of displaying a small amount of information. There are four pages which can each be customised with up to six tiles each. The restriction here is mainly due to the limited amount of Flash memory available to save variables. As for other settings, the page composition is not saved until the SAVE button is pressed on the settings page. So you can easily experiment with layouts without committing to them. The COMPOSE page shows an overview of each page, allowing it to be edited as needed. The NEXT and PREV buttons cycle between the pages. The page and item number is shown at the top of the page, with its title below. You can edit the title by pressing the TITLE button; this title is used on the MAIN PAGE. On each page, the currently selected tile is marked in yellow, the others in grey. Pressing inside the display area will move the selected tile, if it doesn’t conflict with anything else. Screen7: the COMPOSE page displays a mockup of the customisable pages, allowing the layout to be viewed before use. Note that each page also has an EXIT button at lower right. Screen8: there are 23 different tiles to choose from, so pretty much any combination of data can be displayed. A large speed display allows the GPS computer to be set up as a highly accurate speedometer. 40 Practical Electronics | July | 2022 Tiles: a brief overview of each tile’s features Heading: Shows a dial with top fixed at north and an arrow indicating the current track (absolute bearing direction of travel, in degrees). Compass: Shows a dial with the current track fixed at top and compass points rotating around to indicate the bearing. The track is also shown numerically inside the dial. Small Speed: This text box displays the speed in text format using the current speed format and units. Latitude/Longitude/Bearing: Similarly, these tiles display GPS data such as latitude, longitude and altitude, also using the appropriate selected display format. Large Speed: A text display of speed (using current units) which takes up most of the available screen. PAGE 1–PAGE 4: These add a shortcut button to the specified page. Their title will change if the page title changes. POI Compass/Distance to POI/Altitude difference to POI: Show the direction (in dial format)/horizontal distance/vertical distance to currently selected POI. POI Page/Settings Page: Shortcut buttons to the specified pages. To align a tile, you can hold your finger on the touch panel and move it slowly in the desired direction. It's not quite drag-and-drop, but it’s fairly intuitive. Screen9: the larger 3.5-inch LCD and touch panel allow us to provide a full-sized keyboard to enter just about any ASCII character, except that the backtick is replaced by a degree symbol (not shown). Practical Electronics | July | 2022 Sleep: Adds a button to put the GPS Computer into sleep mode, the same as the SLEEP button on the MAIN PAGE. School Time: A small banner that flashes and makes a warning announcement during school hours (internally set to 8:00-9:30am and 2:30-4:00pm) according to current local time. Volume: A bar graph showing the current volume level; coloured green under 100%, yellow up to 200% and red above 200%. Each bar is around 8%. Current POI name: Displays the name of the currently selected POI. POI heading: Shows direction to currently selected POI in text format. Average Speed: A digital average speed display. The button shows the time over which the average has been accumulated; pressing this button resets this. In other words, the average speed is measured from the time when the button was last pressed. Naturally, this doesn’t accumulate during sleep or shutdown. Reproduced by arrangement with SILICON CHIP magazine 2022. www.siliconchip.com.au Pressing CLEAR will delete the selected tile and ADD will bring up a menu of the available tiles (Screen8). The GPS Computer will attempt to fit it in the current screen, and will report an error if it can’t. The algorithm does not try all possible locations, so you might have luck retrying if a tile doesn’t fit the first time. Pressing SEL<> cycles between the tiles on each page. Screen10: a number of useful messages are provided when something interesting occurs. These are accompanied by a brief chime through the speaker to attract your attention. 41