Silicon ChipTouch-Screen Boat Computer With GPS - April 2016 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Arduino, Raspberry Pi or Maximite – which will gain the ascendancy?
  4. Feature: Gravitational Waves: Einstein Was Right . . . Again by Ross Tester
  5. Project: Touch-Screen Boat Computer With GPS by Geoff Graham
  6. Project: Microwave Leakage Detector by Nicholas Vinen
  7. Subscriptions
  8. Project: Fridge/Freezer Alarm by John Clarke
  9. Product Showcase
  10. Serviceman's Log: Odyssey Stratos amplifier voltage conversion by Nicholas Vinen
  11. Review: Keysight U1282A & U1242C Multimeters by Nicholas Vinen
  12. Project: Arduino Multifunction 24-Bit Measuring Shield by Jim Rowe
  13. Feature: Digital TV & MPEG-4: The Current State Of Play by Alan Hughes
  14. PartShop
  15. Vintage Radio: The Westinghouse H-618 6-transistor radio by Ian Batty
  16. Market Centre
  17. Notes & Errata: Universal Speaker protector Mk3 / High Visibility 6-Digit LED GPS Clock
  18. Advertising Index

This is only a preview of the April 2016 issue of Silicon Chip.

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

Items relevant to "Touch-Screen Boat Computer With GPS":
  • Micromite LCD BackPack PCB [2.8-inch version) [07102122] (AUD $5.00)
  • PIC32MX170F256B-50I/SP programmed for the Micromite-based Touch-screen Boat Computer [BoatComputerFullV7.hex] (Programmed Microcontroller, AUD $15.00)
  • MCP1700 3.3V LDO (TO-92) (Component, AUD $2.00)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • CP2102-based USB/TTL serial converter with 5-pin header and 30cm jumper cable (Component, AUD $5.00)
  • Matte/Gloss Black UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $5.00)
  • Clear UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $5.00)
  • Gloss Black UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $4.00)
  • Modified software for the Micromite Boat Computer (Free)
  • Firmware (HEX) file and BASIC source code for the Micromite-based Touch-screen Boat Computer with GPS [V7] (Software, Free)
  • Micromite LCD BackPack PCB patterns (PDF download) [07102121/2] (Free)
  • Micromite LCD BackPack/Ultrasonic sensor lid cutting diagrams (download) (Panel Artwork, Free)
Items relevant to "Microwave Leakage Detector":
  • Microwave Leakage Detector PCB [04103161] (AUD $5.00)
  • Microwave Leakage Detector SMD parts (Component, AUD $12.50)
  • Microwave Leakage Detector PCB pattern (PDF download) [04103161] (Free)
Items relevant to "Fridge/Freezer Alarm":
  • Fridge/Freezer Alarm PCB [03104161] (AUD $5.00)
  • PIC12F675-I/P programmed for the Fridge/Freezer Alarm [0310216A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (HEX) file and source code for the Fridge/Freezer Alarm (Software, Free)
  • Fridge/Freezer Alarm PCB pattern (PDF download) [03104161] (Free)
  • Fridge/Freezer Alarm panel artwork (PDF download) (Free)
Items relevant to "Arduino Multifunction 24-Bit Measuring Shield":
  • Arduino Multifunction Meter (MFM) PCBs [04116011/2] (AUD $15.00)
  • SMD resistors, capacitors and diodes for Arduino Multifunction Meter (MFM) (Component, AUD $25.00)
  • Arduino sketch, Windows installer & source code for the Arduino Multifunction Meter (MFM) (Software, Free)
  • Arduino Multifunction Meter (MFM) PCB patterns (PDF download) [04116011/2] (Free)
  • Arduino Multifunction Meter (MFM) cutting details and panel label artwork (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Arduino Multifunction 24-Bit Measuring Shield (April 2016)
  • Arduino Multifunction 24-Bit Measuring Shield (April 2016)
  • Arduino-Based Multifunction Measuring Meter, Pt.2 (May 2016)
  • Arduino-Based Multifunction Measuring Meter, Pt.2 (May 2016)

Purchase a printed copy of this issue for $10.00.

Touch-Screen Boat Computer With GPS Would you like an accurate digital speedometer for your boat? One with a large clear display? This low-cost unit with touch control is just the shot. It can also display a raft of other information, including your heading, location and the relative bearing to a point of interest, which can be anything from the harbour entrance to a great fishing spot. A S WITH THE Garage Parking Assistant described last month, this project is based on the Micromite LCD BackPack. However, for this project, we’ve deleted the ultrasonic sensor and substituted a low-cost GPS module. By adding a suitable BASIC program, it now functions as a boat 22  Silicon Chip computer which will display your speed as well as a selection of other data on its colourful LCD panel. Most SILICON CHIP readers will be familiar with the Micromite LCD BackPack which was featured in the February 2016 issue. It combines a low-cost, touch-sensitive colour LCD panel with the Micromite, a cheap but powerful microcontroller programmed in the BASIC language. It uses less than a dozen components and can be built in under half an hour. The only extra component required for our Touch-Screen Boat Computer is a GPS module and these are now very siliconchip.com.au Fig.1: this is the main display shown on the Boat Computer when it first powers up. The top half of the screen shows the speed in knots, while the bottom half shows the current heading. The data in both halves can be configured by touching either the top or bottom half of the screen. Fig.2: touching the top half of the screen shown in Fig.1 switches the speed indication from knots to km/h. Fig.3: touching the top of the screen again displays the speed in mph. Another touch brings it back to knots. This photo shows the list of data that can be shown in the lower half of the main display. Touching any option switches the unit back to the main display, with the relevant data displayed in the lower half of the screen. Touching a SET button allows you to configure a particular entry (ie, to set the clock or configure a point of interest (POI). By Geoff Graham cheap – as low as $10 or even less. The “special sauce” which makes these two parts work together as a boat computer is the BASIC program which takes the data from the GPS module and formats it for display on the LCD. As emphasised in the original Micromite Backpack article, the advantage of BASIC is that it is easy to understand and it is written in plain text. So if you do not like how the program works, you can jump in and change it to suit your own needs. Even if you have no intention of building the Touch-Screen Boat Computer, you might find some of the BASIC program useful for other projects. For example, the keypad routines siliconchip.com.au can be used in many other applications and you are welcome to copy this part of the program (or any other part) for your own designs. Information display Because the Boat Com­puter makes extensive use of its graphical display for setting the various options, its operation is intuitive. On power-up, the display is divided into two “panels”. The top half of the screen shows your speed while the lower half can be used to display a selection of other information, including the current heading, latitude/longitude, time and more. The photo on the facing page shows a typical display. When the top half of the screen (showing the speed) is touched, the speed display will switch from knots to km/h. A second touch will then change the reading to mph, while touching it again brings the reading back to knots. The selection will be remembered (as will any other changes that are made), even if the power is removed. Conversely, when the bottom half of the screen is touched, a listing of all the possible display modes will be shown (see above photo). Touching an item in this list will select it and the Touch-Screen Boat Computer will then revert to the main display, with the newly selected data shown below the speed. April 2016  23 is follow the pointer and watch the distance as it counts down to zero. Each POI entry has a SET button which allows you to set the name for the POI (using an alphanumeric keyboard) and its latitude and longitude. You can also set the POI to your current location – which is handy if you have found a good fishing spot and may want to return. Demonstration mode This photo shows the display after the SET button has been pressed for the time entry. It allows the time zone to be set, as well as the format for displaying the time (12 or 24-hour). It also allows you to select for daylight saving, in which case one hour is added to the displayed time. This is what the main screen looks like when a point of interest (POI) has been selected for the lower half. It shows the distance and the direction to the selected POI, in this case one named HARBOUR. To navigate to the POI, all you need do is steer in the direction of the pointer and watch the distance as it counts down to zero. Some entries have a SET button alongside them. When touched, this will allow you to customise the settings associated with that particular display. All settings are saved in nonvolatile memory and will be reinstated on power up. The various items that appear in the list when the bottom half of the screen is touched are as follows: Heading: this will show the boat’s current heading both in degrees and as a compass rose with a pointer. The GPS module uses forward movement to calculate the heading, so the boat needs to be moving for this display to work. Latitude/longitude: this will display the current latitude and longitude in 24  Silicon Chip degrees, minutes and seconds. Clock: this will show the time accurate to within a second. The SET button allows you to change the time zone, the format (12 or 24-hour) and to enable daylight saving compensation (one hour is added when this is on). POI 1 to POI 4: four different points of interest (POI) can be saved in the Touch-Screen Boat Computer. When one of these is selected, the bottom half of the main display will show the distance to the POI and the relative bearing as a pointer. The POI can be anything that you might want to navigate to. Typical examples include a harbour entrance, a boat ramp or a good fishing spot. To navigate to the POI, all you need do There might be occasions when you would like to use the Touch-Screen Boat Computer without a GPS module or without a lock on sufficient satellites to get a display. For example, you might to explore the menu system without a working GPS module. To enable this, you can put the unit into demonstration mode and that’s done by touching the centre of the screen while the power is applied. The LCD will then display “Demo Mode” as the unit powers up. The device will then display an artificial speed, location, time, etc. This data is static (ie, it does not change as you might expect) but it is useful for exploring the menus and features of the Touch-Screen Boat Computer. Because you don’t need a GPS module in demo mode, you can try the software on any Micromite LCD Backpack, even if you’re not planning on building the Touch-Screen Boat Computer. Exploring the software may give you ideas for your own projects and you can then extract sections of the BASIC program for your own use. Selecting a GPS module It’s difficult to specify a particular GPS module for the unit, as manufacturers are constantly discontinuing older models and introducing new versions. To counter this, we have made the unit as flexible as possible, so that it can accommodate almost any GPS module on the market. Most GPS modules require either a 3.3V or 5V power supply and the Micromite LCD Backpack can provide both, so that isn’t a problem. Depending on the particular module, the speed of the serial interface can vary from 4800 baud to 38,400 baud. To accommodate this, the BASIC program automatically detects the speed that the module is using (within that range) and sets the interface speed accordingly. Another variation between modules siliconchip.com.au REG1 MCP1700-3302E +5V CON1 POWER AND CONSOLE USB CONNECTOR TYPE A MALE GND 10 µF 10 µF 100nF 100nF 5V RED 13 GND DATA OUT 11 DATA IN 12 RESET CON2 MICROMITE I/O (CERAMIC PATCH ANTENNA) RxD ILI9341 BASED LCD DISPLAY Tx Rx BLACK GPS RECEIVER MODULE +3.3V OUT IN 1k D1 A K TxD Vdd 15 3 3 4 4 5 5 9 9 10 10 14 14 16 16 17 17 18 18 21 21 22 22 24 24 25 25 26 26 T_IRQ T_DO T_DIN 7 1 T_CS T_CLK SDO (MISO) MICROMITE MK2 LED IC1 PIC32MX170F –256B SCK SDI (MOSI) 2 D/C 23 RESET 6 CS BACK LIGHT VR1 14 25 20 8 19 27 47 µF TANT GND +5V 3 PINS ON IC1 +3.3V +5V GND 28 GND VCC CON3 ICSP 1 +3.3V 4 1 – MCLR 2 – Vcc 5 3 – GND RESET 5 – PGC 4 – PGD S1 6 – NC 10k D1 = 1N4004 CON4 +3.3V +5V MC P1700 1N4004 SC  20 1 6 TOUCH-SCREEN BOAT COMPUTER A K IN OUT GND Fig.1: most of the work in the Touch-Screen Boat Computer is done by IC1 which receives data from the GPS module and formats it for a touch-screen colour LCD connected to CON3. Power comes from a 5V DC USB charger and this directly powers the LCD, while 3-pin regulator REG1 provides 3.3V to power IC1. The GPS module is powered by either 5V or 3.3V (depending on the module), while diode D1 and the 1kΩ resistor in series with the GPS module’s Tx lead are there to protect IC1 if the GPS module uses RS-232 signalling (rather than TTL). is that some use TTL-level signalling while others use RS-232. Again, the BASIC program will automatically adjust for whatever standard the module uses. Note, however, that some GPS modules have a USB interface and the Touch-Screen Boat Computer cannot work with these. TTL signalling means that the data will swing from 0V to about 3V, while the output will be at 3V at idle (ie, when there is no signal). RS232 uses the same signalling sequence as TTL but the voltage swings from -12V to +12V, with idle being -12V (ie, it is inverted with respect to TTL). GPS modules can also vary in the messages that they send and many of these messages are unique to a particular manufacturer. To avoid this issue, siliconchip.com.au the Touch-Screen Boat Computer uses only the RMC message. This message (and its format) is specified as mandatory in the NMEA 0183 standard for GPS hardware, so all GPS modules will produce this signal (the unit will ignore any other messages). Our prototype used a Fastrax UP501 GPS module (mostly because we had one in our parts box). Another suitable module is the USGlobalSat EM-408 which has been used in many SILICON CHIP projects in the past. Unfortunately, both these modules can be difficult to obtain these days. More readily-available GPS modules include the Ublox NEO-7M-C and NEO-6M , the Skylab MT3329/SKM53 and the V.KEL VK16HX. In summary, when selecting a GPS module, look for these characteristics: 3.3V or 5V supply rail, 4800 to 38,400 baud rate and a TTL or RS-232 serial interface. In most cases, you will want to choose a module with an inbuilt patch antenna. This takes the form of a flat square ceramic object on the top of the module. Having an inbuilt antenna makes it simpler to use the module and in most installations, this antenna will gather enough signal to do the job. If the module does not include an antenna, you then have the flexibility of choosing a separate waterproof antenna which could be mounted externally with an unobstructed view of the sky. Some modules have other peculiarities. For example, the UP501 that we used requires an external 3V battery to April 2016  25 47µF 10k ICSP CON4 (UNDER) 10 µF + + 100nF 1 CON1 + (UNDER) 5V TX RX GND RESET 3 4 5 9 10 14 16 17 18 21 22 24 25 26 3V3 5V GND CON2 10 µF REG1 MCP1700-3302E IC1 PIC32MX170F256B-50I/SP http://geoffg.net/micromite.html 07102122 CON3 LCD 100nF 1 2.8-Inch Micromite LCD BackPack The GPS module can be mounted on a piece of strip-board & flying leads run to an 8-way pin header to plug into CON2 on the BackPack PCB. S1 RESET Backlight 100Ω VR1 1 Fig.2: repeated from the February 2016 issue, this parts layout diagram shows how to build the BackPack PCB for the 2.8-inch LCD. Note that pin headers CON1 & CON2 are mounted on the rear of the PCB, while CON3 & CON4 are mounted on the top (see photos). a 5V DC USB supply, while low-power voltage regulator REG1 provides a 3.3V rail for IC1. Diode D1 and the 1kΩ resistor in series with the GPS module’s transmit (TxD) pin are there to protect IC1 if the module uses RS232 signalling. However, if you are sure that your GPS module uses TTL signalling, then D1 can be dispensed with and a link used instead of the 1kΩ resistor. The circuit has provision for powering the GPS module from either 5V DC or 3.3V DC (from REG1), depending on the module’s supply requirements. Construction The colour LCD is mounted on the clear acrylic lid before being plugged into the BackPack PCB. Be sure to fit the LCD to the lid with the correct orientation. keep its memory alive when the power is removed. Most other GPS modules have this battery incorporated inside them, so this is a rare requirement. In addition, some GPS modules have an enable input and this must normally be connected to the supply voltage (ie, pulled high). In some cases though, this input should be left floating or even grounded, so check the specifications for your particular module when connecting it to the circuit. Many modules also feature a 1pps (pulse per second) output but this can be safely ignored. 26  Silicon Chip To make things simple, you can purchase a suitable module from the SILICON CHIP Online Shop. Circuit details Fig.1 shows the circuit diagram for the Touch-Screen Boat Computer, including the Micromite LCD BackPack. IC1 is the Micromite which is based on a PIC32MX170F256B microcontroller. It does all the work of taking the data from the GPS module and formatting it for display on the colour LCD which connects to CON3. Power for the circuit is derived from Building the Touch-Screen Boat Computer mainly involves building the Micromite LCD BackPack, as detailed in the February 2016 issue of SILICON CHIP. Assembling the BackPack PCB is quite simple; just follow the parts layout diagram shown in Fig.2 (as originally published in the February 2016 issue) or the silk screen overlay on the PCB. The 2.8-inch version is the one to build and the job should only take about half an hour. All GPS modules have a different mounting method, so this is something that you will have to figure out, depending on the module that’s being used. The main consideration when mounting the GPS module is that it should be positioned so that the antenna is horizontal, with its top surface facing the sky, when the boat computer is being used. This will ensure maximum sensitivity. As stated, our prototype used a Fastrax UP501 GPS module and this was mounted on a scrap piece of stripboard. The module was first soldered to a 6-way pin header and this was then plugged into a 6-way female header. This header was then connected via siliconchip.com.au Right: the GPS assembly mounted in position on the BackPack PCB. flying leads to an 8-way female header mounted along one edge of the board and positioned so that it could be plugged into CON2 (ie, between pin 21 and GND) on the Micromite. The accompanying photos show the details. As mentioned above, this particular GPS module also needed a back-up battery for its internal memory and this can also be seen in the photographs. Loading the firmware Loading the firmware and the BASIC program is basically a 4-step process: Step 1: program the MMBasic firmware into the chip using a PIC32 programmer (eg, a PICkit 3). Step 2: connect to the Micromite’s console and, using the OPTION commands, configure MMBasic for the LCD display and the touch function. Step 3: load two fonts into the Micromite and save them in the library. Step 4: load the Boat Computer program. Saving the two fonts into the library is something that needs explaining. The library is a special memory area in the Micromite where fonts and program modules can be stored. When these are saved to the library they are, for all intents and purposes, added to the MMBasic language. Loading BASIC If you are going to load the BASIC program yourself or edit it later, you will need to make up a cable with a USB-to-serial converter as described in the February 2016 issue (or in the Micromite User Manual). This is powered from a 5V USB supply via a cable fitted with a micro-USB connector. After you have the program running to your satisfaction, you can then unplug the converter and use the power siliconchip.com.au They do not show when a program is listed and they are not deleted when a new program is loaded. However, they are available to any program, just the same as the features of MMBasic are always available to any program that is loaded. One very useful feature of the library is that anything saved into it is compressed. That’s why it’s necessary to load the two fonts separately from the BASIC program and save them to the library. The fonts are quite large and there is not enough memory in the Micromite to load both the fonts and the program at the same time. This means that we must first load the fonts and save them to the library, where they will be compressed. We can then load the main program (which relies on the two fonts being available) into main memory. As with last month’s Garage Parking Assistant, you have a few choices when it comes to loading the firmware. You can combine all of the above steps into one by downloading the file BoatComputerFull.hex from the SILICON CHIP website and programming it into a blank PIC32 chip using a PICkit 3. This file has the Micromite firmware, the settings for the LCD panel, the two fonts and the BASIC program all combined into one hex file. Using this method of loading the firmware makes the job easy because the one operation will completely set up the microcontroller to be a boat computer. Pre-programmed chip An even easier option is to purchase a pre-programmed PIC32 microcontroller from the SILICON CHIP Online Shop. Then, all you have to do is plug the chip into its socket and it will be ready to go (no programming needed). Programming in steps Yet another option is to go through all four steps individually. First, download the file Micromite_V5.1.hex from the SILICON CHIP website and program it into the PIC32 microcontroller using a PICkit 3. That done, connect a USBto-serial converter to the console of the Micromite (see panel below) and configure the chip to work with the LCD panel and touch input. Next, load the file BoatComputerFonts.bas into the Micromite using either the XMODEM protocol or the AUTOSAVE command. Once the fonts have loaded, execute the command LIBRARY SAVE. This will save The USB-to-serial converter should be connected via colour-coded flying leads to a 4-way header socket, so that it can be plugged into CON1 on the underside of the BackPack PCB. Use a red wire for +5V, white for TX, yellow for Rx and black for GND. cable shown in Fig.4 instead. This is because the program is designed to start running automatically whenever power is applied and after the program has been run once you should never need to use the console again. April 2016  27 The prototype used stacked M3 washers between the LCD module and the lid but a single spring washer at each corner is a better solution (see text). Be sure to run a thin bead of silicone around the edge of LCD before fitting it to the lid, to ensure a water-tight seal. the fonts in the library and remove them from main memory. You can confirm this by running the command MEMORY, which will show that about 12KB of memory has been allocated to the library and there is nothing in the main program memory. Finally, load the BASIC program BoatComputer.bas using either the XMODEM protocol or the AUTOSAVE command. All the files listed above are available from the SILICON CHIP website. The process for loading MMBasic, configuring the interpreter and loading BASIC programs was detailed in the article describing the Micromite LCD BackPack in the February 2016 issue. It’s also explained in the Micromite User Manual, which is included in the Micromite firmware zip file. When you have run through all four steps described above, the result will be exactly the same as if you had programmed a blank chip with the combined file BoatComputerFull.hex (or purchased a pre-programmed chip). Be aware, however, that the touch calibration in the combined firmware file (and in pre-programmed PIC32s) was done with a reasonably standard LCD panel. Most panels require similar The GPS module used in the prototype required a separate back-up battery and this was also mounted on the strip-board. If you don’t need a separate battery, you can simply glue the GPS module to the top of the case and run flying leads to an 8-way pin header to connect to CON2 on the BackPack PCB. 28  Silicon Chip parameters for calibrating the touchsensitive screen but yours might require re-calibration if it is significantly different from the “standard”. If you use the combined firmware file and find that the touch calibration is inaccurate, you can correct this by connecting a USB-to-serial converter to the console, halting the program with CTRL-C and re-running the calibration as described in the original Micromite LCD BackPack article in February 2016. Don’t worry if you don’t have this article. The Micromite User Manual (included in the firmware zip file available from the SILICON CHIP website) also contains a full description of the calibration procedure. In fact, you should download the manual in any case, as it fully documents the Micromite and what you can do with it – and that’s a lot. Testing the GPS module In most cases, you will be able to connect the GPS module to the Micromite Backpack and it will just start running without drama. When the Boat Computer is first turned on, you will see the message “Waiting for GPS” on the LCD panel. This means that the BASIC program is searching for the baud rate being used by the module. If after 10 seconds you see the message “GPS Module Not Found” it means that the BASIC program has tried all the possible baud rates and TTL/RS232 combinations and did not find the module. The software will then keep searching but you obviously need to diagnose the issue. In most cases, the cause will be incorrect wiring or an enable input to the GPS module that needs to be permanently connected to the supply voltage or to ground (check the specifications for your module). To investigate what is going on, connect the unit to a PC via a USB-to-serial converter, enter the following program into the Micromite via a terminal emulator (eg, Tera Term) and run it: OPEN “COM1:9600” AS #1 DO PRINT INPUT$(1, #1); T$ = INKEY$ IF LEN(T$) THEN PRINT #1, T$; LOOP Replace the 9600 with whatever baud rate you want to use. If you suspect that the module is using RS-232, siliconchip.com.au Helping to put you in Control SparkFun Inventor’s Kit for Photon Control your devices through the cloud. The kit provides you with the Photon RedBoard and everything you need to hook up and experiment with multiple electronic circuits! SKU: SFC-026 Price: $165.00 ea + GST Wind Direction Sensor This is the set-up screen for a point of interest (POI). The title of the POI and its latitude and longitude can be changed by touching the CHANGE button beside each entry. A useful feature is the SET TO HERE button which will set the coordinates to your current location – handy if you have found a good fishing spot. The sensor scales the wind direction to a 0 to 5 VDC output. It can be easily connected to a PLC/ SCADA system to provide monitoring and control of systems according to wind direction. 12 to 30 VDC powered. SKU: FSS-012 Price: $170.00 ea + GST Compact Ultrasonic Rangefinder 5 m range, compact, IP67 ultrasonic rangefinder with 1 mm resolution. Analog voltage, pulse width and RS-232 serial outputs. SKU: MXS-103 Price: $149.95 ea + GST Digit-TL Battery powered temperature logger that can store up to 260k readings. Up to 3 year battery life. 7 log intervals, 2 programmable alarm thresholds. Download to .csv files over USB to Windows based computer. IP68 enclosure included. SKU: LAJ-060 Price: $72 ea + GST Back To Back Digital I/O This photo shows the display after touching the CHANGE button for a POI Title. It allows you to change the title given to a POI. Touching a button will insert that character while touching the red left/right triangles will scroll through the alphabet. you should tack ,INV on the end of the baud rate, eg: OPEN “COM1:9600,INV” AS #1 When you run this program, anything that the GPS module outputs will be echoed on the console, so you can see exactly what the unit is receiving. The accompanying panel “Understanding A GPS Module’s Output” provides further information on the content of the messages that you should be seeing. Using the above program, you can also send commands to the module. Anything that you type on the console’s keyboard will be sent to the siliconchip.com.au module. For example, the following will reset a module using the SIRF chipset to its factory default settings: $PSRF104,00,00,00,00,00,00,12, 08*29 All commands sent to the module (including the above) must be terminated with a Ctrl-M character, followed by Ctrl-J (ie, carriage return/line feed). Use Ctrl-C to exit the test program. Finding satellites When the Touch-Screen Boat Computer receives valid data from the GPS module after power-up, the displayed message changes from “Waiting For Two wireless I/O cards in a pair. 2 x digital inputs trigger two relays over the wireless link. Additional output to indicate comms link status. 24 VDC powered SKU: KTA-307 Price: $299.00 ea + GST Wireless MiniPixel Controller. Based around the PICAXE18M2 microcontroller, this programmable controller features include wireless control, 3 analog/ digital inputs, 2 relays, a 4 position DIP switch and 2 potentiometers. SKU: PIX-0042 Price: $99.50 ea + GST High Accuracy Digital Compass HCM508B digital magnetic compass. Course accuracy better than 0.5 degrees at 0.1 degree resolution. Housed in a rugged IP67 aluminium enclosure. SKU: SRS-220 Price: $949.00 ea + GST For OEM/Wholesale prices Contact Ocean Controls Ph: (03) 9782 5882 oceancontrols.com.au Prices are subjected to change without notice. April 2016  29 M3 x 20mm MACHINE SCREW CLEAR ACRYLIC LID WITH CUT-OUT FOR LCD (REPLACES ORIGINAL UB3 BOX LID) TOUCH-SCREEN LCD M3 SPRING WASHER 2.8" LCD PCB M3 x 12mm TAPPED SPACER MICROMITE BACKPACK PCB M3 x 12mm TAPPED SPACER M3 x 6mm MACHINE SCREW Fig.3: here’s how to attach the LCD & Micromite BackPack PCB to the clear acrylic lid. The LCD goes through a cutout in the lid and sits flush with its top surface. STRIP-BOARD WITH GPS MODULE & 8-WAY PIN HEADER – SEE TEXT Enclosure 5V 4 Tx 3 2 Rx 1 MALE TYPE A USB CONNECTOR GND 4-PIN FEMALE HEADER CONNECTOR MICROMITE CON1 POWER AND CONSOLE CONNECTOR Fig.4: the Touch-Screen Boat Computer is powered from a 5V USB charger that’s either plugged into a 12V cigarette lighter socket or wired permanently into the boat’s power supply (see text). To make a suitable power cable, cut off one end of a USB cable, thread the cut end through a cable gland in the side of the case and solder it to a 4-pin female header connector. GPS” to “Searching for Satellites”. This means that the GPS module is working and is scanning for satellites in order to get a fix (this requires at least four satellites). You could be waiting for a while here so don’t panic if nothing happens immediately. When a GPS module is first turned on, it must download details of the satellite’s orbits which are encoded on the GPS signal. Receiving the full set of data takes 12.5 minutes and if there is a corruption in the signal, it could take a lot longer. The answer is to take the unit outside with a long power lead, place it so that it has an uninterrupted view of the sky and give it half an hour or more. When this data has been received, the module will save it in its batterybacked memory so that, at next powerup, the module finds the satellites This view shows the unit with the latitude and longitude option select­ed for the lower half of the display. Changing the displayed data is easy. 30  Silicon Chip much faster (normally within 10-15 seconds). However, this data does change with time so if you have not used your Touch-Screen Boat Computer for some time, it might have to go through the whole process of loading fresh orbital data again (with a corresponding delay). You will know when the module has found sufficient satellites to locate your position because the “searching” message will disappear and the display will switch to showing your speed and heading. Building the unit into an enclosure is left until after the LCD BackPack assembly and GPS combination has been thoroughly tested. Once that’s done, it can be housed in a UB3 plastic enclosure fitted with a clear laser-cut clear acrylic lid. This lid is available from the SILICON CHIP Online Shop and is supplied with all the necessary mounting holes and a precision cut-out for the touch-screen LCD panel. An important feature of the enclosure is that, while the LCD touchscreen must be accessible, it must prevent salt spray (or even salt-laden air) from reaching the interior. The fit between the edges of the LCD and the cut-out in the acrylic lid is very close and this is the secret to spray-proofing the enclosure. Before mounting the LCD panel, the idea is to run a thin bead of transparent silicone sealant around the edge so that when it’s mounted on the acrylic panel, the sealant will fill this small gap and render the front spray-proof. Once the sealant has cured it will be difficult to remove the LCD panel so make sure that the Touch-Screen Boat Computer is working properly and that the LCD panel and the Micromite BackPack correctly fit in the box before taking this final step. It may be necessary to trim the row of 14 solder joints on the top of the LCD module, so that they don’t interfere with the lid. Fig.3 shows the how it all goes together. The first step is to attach the LCD panel (without the BackPack PCB) to the acrylic lid at each corner using an M3 x 10mm machine screw, an M3 spring washer and an M3 x 12mm tapped spacer. The spring washers must be placed between the acrylic lid and the display’s PCB so that the LCD panel will be flush with the surface of the lid. Note that the cut-out in the lid siliconchip.com.au Understanding A GPS Module’s Output One of the difficulties when troubleshooting a project using a GPS module is understanding what the data coming from such a module should look like. The following is the output that we recorded from the Fastrax UP501 module. These six lines are repeated every second. First, this is the output when the module was searching for satellites (ie, it did not have a “lock” on our position): $GPGGA,232048.764,,,,,0,3,,,M,,M,,*41 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,3,1,10,19,76,148,20,17,49,140,18,06,41,044,24,24,40,226,*7A $GPGSV,3,2,10,15,28,286,,13,27,331,,28,25,106,,12,22,249,*7B $GPGSV,3,3,10,02,18,001,,30,09,043,*7F $GPRMC,232048.764,V,,,,,0.27,0.00,150216,,,N*43 And this is the output when it did have a lock and was producing valid data: $GPGGA,231719.000,3411.5204,S,14135.6619,E,1,9,0.90,3.2,M,5.1,M,,*75 $GPGSA,A,3,02,13,17,30,15,24,06,12,28,,,,2.43,0.90,2.25*03 $GPGSV,3,1,11,19,77,147,,17,51,140,16,06,40,043,29,24,39,226,10*74 $GPGSV,3,2,11,13,28,330,16,15,28,284,14,28,26,107,21,12,21,251,14*7A $GPGSV,3,3,11,02,16,001,19,30,11,043,15,01,01,148,*48 $GPRMC,231719.000,A,3411.5204,S,14135.6619,E,9.62,302.03,150216,,,A*75 Each line (called a message) provides a set of data such as the current location, the number of satellites being used, etc. For the Touch-Screen Boat Computer, we only use the RMC message which is the last line in the above listing. RMC stands for “Recommended Minimum Specific GNSS Data” and is specified in the NMEA standard as mandatory; therefore, all modules from any manufacturer should generate at least this message. Each message line is broken down into fields, with each field separated from the next by a comma. Using the above capture as an example, this is the meaning of each field: $GPRMC: The header designating that this is an RMC message 231719.000: The UTC time in the format hhmmss.sss A: A flag indicating if the module has a satellite “lock”. A = lock or V = searching 3411.5204: The current latitude in the format ddmm.mmmm S: North/South indicator 14135.6619: The current longitude in the format dddmm.mmmm E: East/West indicator 9.62: Current speed in knots 302.03: The current heading in degrees 150216: The UTC date in the format ddmmyy ,,,: These two fields are for specialised data not used (ie, empty) in most modules A: Another specialised field indicating the mode of the GPS module *75: The * character marks the end of the data and the following two digits are the checksum for the LCD is offset to the left so that the active area of the LCD is centred horizontally. The easiest way to go about the assembly is as follows: Step 1: run a very thin bead of silicone around the outside top edge of the LCD; Step 2: sit the LCD panel on a horizontal surface and carefully place the four spring washers in position. They can each be held in place with tiny blob of silicone; Step 3: place the lid in position over siliconchip.com.au The power cable connects to CON1 on the BackPack PCB via a 4-way header. We fitted a DC socket to the prototype but it’s preferable to run the cable through a cable gland and seal it with silicone (see text). April 2016  31 Parts List Micromite LCD BackPack Unit 1 PCB, code 07102122, 86 x 50mm (for 2.8-inch LCD) 1 ILI9341-based LCD, 320 x 240 pixels, 2.8-inch diagonal 1 UB3 ABS box, 130 x 67 x 43mm (Altronics H0153 or H0203, Jaycar HB6013 or HB6023) 1 laser-cut clear acrylic lid to suit UB3 box 1 4-pin tactile switch, through-hole 1 100Ω vertical-mount side adjust trimpot (Altronics R2579, element14 9608044 or similar) 1 28-pin DIL low-profile IC socket 1 4-pin 0.1-inch male header (CON1) 1 18-pin 0.1-inch male header (CON2) 1 14-pin 0.1-inch female header socket (CON3) 1 6-pin 0.1-inch right-angle male header (CON4) 1 4-pin 0.1-inch female header 1 8-pin 0.1-inch female header 4 M3 x 12mm tapped spacers 2 M3 x 6mm machine screws Semiconductors 1 PIC32MX170F256B-50I/SP microcontroller programmed with BoatComputerFull.hex (IC1) – see text. Note: a PIC32­ MX170F256B-I/SP can also be used but will be limited to 40MHz 1 Microchip MCP1700-3302E/TO voltage regulator (REG1) Capacitors 1 47µF 16V tantalum or SMD ceramic (3216/1206) 2 10µF 16V tantalum or SMD ceramic (3216/1206) 2 100nF monolithic ceramic Resistors (0.25W 5%) 1 10kΩ the LCD and feed the four M3 x 20mm mounting screws through the holes; Step 4: secure the assembly by screwing on the four M3 x 12mm tapped spacers. Because of the need to fit the washers, this procedure is a bit fiddly. Take your time and be careful to ensure that you don’t get silicone everywhere. Once the LCD panel has been mounted and sealed, the Micromite BackPack 32  Silicon Chip Cable Parts 1 USB cable with a male type A connector (length to suit) 1 4-pin 0.1-inch female header Additional Parts For The Boat Computer 1 3.3V or 5V GPS module (available from Online Shop – see below) 1 1N4004 silicon diode (D1) 1 1kΩ resistor (0.25W, 5%) (see text) 1 USB cable with a male type A connector on one end 1 4-pin 0.1-inch female header 1 3-6.5mm cable gland (Jaycar HP0720, Altronics H4304A) 4 No.4 x 10mm self-tapping screws 2 M3 x 12mm tapped spacers 4 M3 x 20mm machine screws 2 M3 nuts 4 M3 spring washers Where To Buy Parts A kit for the Micromite LCD BackPack is available from the SILICON CHIP Online Shop. This includes a 2.8-inch touch-screen LCD panel, the BackPack PCB, a PIC32 microcontroller programmed with BoatComputerFull.hex, a clear acrylic lid with a cut-out to suit the LCD and mounting holes to suit a UB3 Jiffy box, plus all other on-board parts. We are also offering two different GPS modules with internal battery back-up – see the SILICON CHIP Online Shop for more details. The Micromite BackPack PCB and a programmed microcontroller can also be purchas­ed separately. Note that the kit does not include the box, mounting hardware, power supply, cable gland, off-board headers and connectors or cable parts. PCB can be plugged into CON3 on the LCD board and secured in place using M3 x 12mm tapped spacers. As mentioned earlier, the GPS module will need to be mounted separately according to the needs of the module that you are using. This could involve mounting the module on a scrap of strip-board as we did or perhaps simply attaching it to the top of the case using silicone sealant and running Firmware Updates For firmware updates for the Micromite and the Touch-Screen Boat Computer, please check the author’s website at geoffg.net/ micromite.html flying leads to a header that plugs into CON2 of the Micromite Backpack. Power supply The Touch-Screen Boat Computer is powered from a 5V USB charger with an output of 500mA or more. Versions which plug into a 12V cigarette lighter socket are fine in this role. If you wish to permanently connect the unit to your boat’s 12V or 24V wiring, you can use one of the many stepdown power supply modules available on eBay for just a few dollars (search for “Buck Converter”). Alternatively, use one of our USB Charger Regulators described in the July and September 2015 issues. To make a cable for a USB charger, cut off one end of a USB cable (retaining the type A male connector on the other end) and thread the cut-off end through a cable gland fitted to one side of the UB3 ABS box. The red wire is then soldered to one pin of a 4-pin female header connector, while the black wire goes to the other end – see Fig.4. The other two wires in the USB cable (generally green and white) can be cut short as they are not needed. Once the cable has been completed, plug the header into CON1 on the BackPack PCB, making sure that the red wire goes to the +5V pin. The cable gland can then be tightened to make a moisture-proof seal. As an added measure, some silicone sealant can also be smeared around the cable gland inside the case. Note that the cable gland must be fitted close to the rear of the case, so that it doesn’t interfere with the BackPack PCB. Note also that you will need to secure the lid using four No.4 x 10mm self-tapping screws (the original case screws are too short with the new lid). Finally, for the sake of convenience and to allow us to use the power cable made for the Garage Parking Sensor, we fitted a DC socket to the prototype. However, this arrangement is not moisture-proof and we strongly recommend running the power cable through a cable gland, as described above. SC siliconchip.com.au