Home

Electronic Projects
  • Micromite Microcontroller
  • Micromite Plus
  • DDS Signal Generator
  • Super Clock
  • Boat Computer MkII
  • Parking Assistant
  • Micromite LCD Backpack
  • ASCII Video Terminal
  • GPS Controlled Clock
  • GPS Tracker
  • Colour Maximite Computer
  • The Original Maximite
  • The mini Maximite
  • Intelligent Fan Controller
  • GPS Synchronised Clock
  • GPS Boat Computer
  • GPS Car Computer
  • Making the GPS Computer
  • Energy Meter Firmware
  • ISM Band Scanner
  • Utility Power Supply
  • Precise Voltage Reference
  • Game of Pong
  • Water Level Meter


  • General Articles
  • Problems in Open Source
  • The Maximite Story
  • Programming PIC Micros
  • MMBasic on the UBW32
  • The TFT Maximite
  • Surface Mount is Easy
  • Measuring Capacitor ESR
  • EM-408 GPS Module
  • SG12232A LCD Driver
  • Custom PC Boards
  • The Gerber Format


  • Reviews
  • Hantek DSO-2250 Scope
  • Rigol DS1000 Scope
  • PIC C Compilers
  • Brickbats


  • PC Software
  • Weather Station
  • Mazing


  • About

     

     

     

    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia (CC BY-NC-SA 3.0)

    Making the Car/Boat Computer

     

    The GPS Car Computer and the GPS Boat Computer described elsewhere on this website both rely on the same hardware - it is only the firmware running on the microcontroller that gives them their different personality. This article provides a common description of the design and construction details for both.

    In this page you will find everything that you need to know to build the unit.  This includes the design, schematic, parts list, PC board layout and construction details. Even if you do not want to build one of these gadgets the concepts and design will hopefully prove interesting to a technically orientated reader.



    Because this page covers both versions of the computer it is rather generic.  For details specific to the GPS Car Computer go to my page here and for details specific to the GPS Boat Computer go to the separate page here.

    Both the GPS Car and Boat Computers were described in Silicon Chip magazine.  The magazine articles were able to go into much more detail so it is worth reading them if you are going to build one.  Electronic copies of the magazine can be purchased for about the price of the printed version.  The links are:

    You can also purchase a complete kit of parts for the GPS Boat Computer from Altronics.

    Design

    The GPS Computer consists of just three main parts, the microcontroller, LCD display and GPS module.

    The microcontroller's main job is to get the data from the GPS module, build it into an easy to view graphic image and send it to the LCD display.  It also has some other duties (checking switches and other inputs) but mostly it just presents the data received from the GPS module.

    The design uses the Microchip PIC18F4550 microcontroller.  This is a 40 pin chip that can be plugged into a socket and has plenty of I/O pins - which is handy as we need 15 of these just to drive the LCD display. The 18F4550 also has a built in USB interface which is used to communicate to a laptop. The implementation of USB in the 18F4550 is especially well done, all you need to do is wire the USB cable directly to the chip - everything you need (the USB transceiver, pullup resistors and other hardware) is integrated inside the chip.

    The GPS module used in this design is the EM-408 which does all the hard work of tracking the satellites, working out what our location is, calculating speed, etc.  The EM-408 uses a standard 8 bit serial protocol running at 4800 baud to communicate with the micro.  This is the same serial protocol as used in a PC or dial up modem except that the voltage levels are 0 to 3V and the signal is inverted.  My page here describes the module in more detail.

    Because the GPS module runs at 3.3V we must convert its output to 5V levels that are suitable as an input to the 18F4550.  This is achieved by comparing the signal from the module with a 1.35V reference giving a resultant 5V signal level as illustrated in the diagram on the left.

    Both the comparator and voltage reference are integrated in the 18F4550 so we do not need any additional components (another handy feature of this chip).  Sending data to the GPS module is much easier, we just use a couple of resistors to reduce the micro's 5V data levels to 3V for the module.

    The LCD display is a graphics display with 122x32 pixels and we can turn on and off any pixel.  This is both a benefit and a curse - we have complete freedom to display whatever we want but we also need to provide our own fonts when we want to display ordinary alphanumeric characters.  To handle this, the firmware includes three fonts ranging from huge numbers for easy reading to a small font for use when space is limited.  The firmware is responsible for looking up the bit image for each character and copying this data to the LCD.

    The firmware does this by building the graphic image (122x32 bits) in its internal RAM.  When it is complete the firmware copies the data at high speed into the LCD controller's memory.  This double buffering means that the update of the display is snappy with no visible glitches while the image is being built.

    Circuit Diagram

    Referring to the circuit diagram below (click on it for a larger image) the EM-408 connects to the micro on pins 5 and 25.  Moving further around the chip in a clockwise direction, the USB is connected to pins 23 and 25.  The 220nF capacitor on pin 18 provides smoothing for the micro's internal 3.3V regulator (you should be able to measure that voltage on that pin).

    Further on, the pushbutton switches connect directly to the micro which uses internal pullup resistors to hold these inputs at 5V.  When a button is pressed the corresponding input is pulled low and the micro will detect this and cary out what ever action is indicated.  The 20MHz crystal on pins 13 and 14 provide the main clock to the microcontroller.  Internally within the chip this is divided by 5 then multiplied by 12 in a phased locked loop to give the 48MHz required by the USB interface and the CPU.

    Click on the diagram for a large image

     

    Continuing up the left hand side of the chip the LCD is next with its 15 control lines.  To reduce interference to the GPS module (which is a sensitive radio receiver) the LCD is mounted upside down (the connector strip is normally on the top) and to compensate for this the graphic image is inverted by the firmware before it is sent to the display.  Another output from the microcontroller drives transistor Q1 with a pulse width modulated (PWM) signal.  The firmware will vary the duty cycle of this signal to control the brightness of the backlight. 

    The piezo buzzer is used in the Car Computer to make a beep when you have gone overspeed (it is not used in the Boat Computer so you can leave it out if you are building that version). Pins 10, 9, 39 and 40 on the microcontroller are the inputs from the outside world and connect to the mini DIN connector.  These inputs have slightly different uses depending on the firmware loaded.

    The power supply consists of two standard regulators IC2 and IC3.  IC2 is a fixed 5V regulator designed for use in the automotive environment and can withstand spikes, voltage reversal and other automotive abuse.  Diode D2 is placed in its common leg to raise its output voltage to 5.6V, this is then reduced to 5.3V by the voltage drop through diode D1.  The reason for this unusual arrangement is threefold.  It isolates the regulator from the 5V supplied on the USB connector when the device is plugged into a computer, it gives a slightly higher voltage for the LCD which in turn gives the contrast control a better range of control and finally it provides a higher voltage for the backlight which makes it easier to drive it at full brightness.

    The last part of the power supply is IC3 which is a simple 3.3V regulator used just to provide power to the GPS module.

    Finding the Parts

    You can purchase a complete kit of parts from Altronics and Photonage but if you want to source the parts yourself there is a parts list included in the construction pack (which you can download from the bottom of this page). Most parts are easy to find however a few need explanation.

    The EM-408 GPS module is available from SparkFun in the USA, their shipping is cheap and they always have plenty in stock.  In Australia Altronics stock it as part number K1131 and if you Google for “EM-408” you will find many more suppliers.

    The LCD display is sold by Altronics as part number Z7052.  You can also buy it from Digi-Key and Crystalfontz.  If you search the Internet for "122x32 LCD" you should find a few more suppliers.

    The design files for the PC board (called Gerbers) are included in the construction pack and you can send them off to a PCB fabricator who will make the board for you. The design has also been registered with BatchPCB (you do not need to upload the files - this has already been done) and you can purchase a board from them for about US$33 including delivery. Follow this link. They made the prototype PCB and did an excellent job so I am happy to recommend them.

    The push button switches have a long shaft (22mm) which enables them to protrude through the front panel.  The only supplier of these that I know of is Altronics (part S1119 for the switch and part S1482 for the pushbutton cap) but you could replace them with panel mounting switches and wires connecting to the PCB as used in the GPS Boat Computer design.  This is discussed further below.

    All the semiconductors, connectors, crystal, buzzer, etc can be purchased from Futurlec and other standard suppliers.

    Assembly

    Assembly of the PCB is straightforward as the board is silk screened and all you need to do is follow the legend on the board.  In case your board is not silk screened the construction pack also contains an image of the board showing the component placement. 

    The LCD display needs to have a row of of header pins soldered onto its line of 20 connecting solder pads.  This row of pins will plug into the 20 pin female socket strip on the main PC board.  The row of header pins will have a side with short pins and the other with long pins, you should insert the long side into the holes in the LCD PCB from the bottom so that the insulating strip is on the bottom and you can solder the pins on top.  When this is completed you can lever off the insulating strip so that the LCD module, when plugged into the main PCB, sits flush on top of the spacers separating it from the main board.

    The GPS module connects to CON5 on the PCB.  It comes with a connecting cable that has connectors on both end.  Cut off one of the connectors and solder the wires to the solder pads on the PCB with the gray wire on pad number 1 and the rest of the wires soldered in the order that they emerge from the connector.  Don't plug the module in yet, this can be done during final assembly.

    When you assemble the board there are a few options for you to consider.

    The first is the clearance between the PCB and the LCD display.  The original design used 9mm untapped spacers between the PCB and the LCD display.  If you refer to the diagram below you can see that this allows the push button switches (with the 22mm shaft) to protrude through a small hole in the front panel so that the button cap could be placed on the end (where it would hide the hole) and there would still be clearance when the button was pushed. The disadvantage of this design is that there is not much space for the components on the PCB and in particular you will not be able use an IC socket for the microcontroller, so you will have to solder it in.  This is not good as you might need to pull the chip out if you are fault finding.

    An alternative approach is to use a longer spacer (12mm) between the PCB and LCD and that will give you more clearance allowing you to use an IC socket.  The downside is that you will have to drill large and very neat holes in the front panel to accommodate the button caps which will now sit in the front panel rather than above it.  All in all I recommend the second approach as you can easily damage the micro and and it would be nice to be able to easily replace it (it is very hard to unsolder a 40 pin chip from a board with plated through holes).

    Of course, the above discussion is moot if you use panel mounted switches with flying leads, in that case just use the longer spacers.

    The control of day/night brightness is another decision that you will need to make.  The micro decides if it is night or day by the voltage on its pin 40 - if the voltage is high it must be night and if it is low it must be day.  In the user setup screens you can separately adjust the brightness for the day and night conditions.  Control of the day/night state can come from a LDR mounted on the PCB or an external 12V input normally wired to the lights circuit.  For LDR control you should install the LDR in the position marked LDR and an 8.2K resistor in R1 (leave R2 empty).  For external control install a 47K resistor in the position marked LDR and an 82K resistor in R2 (leave R1 empty).

    Finally, if you are building the GPS Boat Computer version you will also need to insert a couple of extra resistors on the PCB so that the micro can detect if the engine is running.  To do this an 82K resistor should be installed in R4 and a 47K resistor in R5.

    Programming the Microcontroller

    The microcontroller must be programmed with the HEX file contained in the GPS Computer firmware download pack (available at the end of this page).  This version of the firmware has both a bootloader and the first version of the GPS Car Computer firmware and must be loaded onto the chip using a PIC programmer such as the PICKit 3 (available from Microchip).  The kit from Altronics will contain a pre programmed microcontroller so you can skip this step if you have purchased the kit.

    Once the bootloader has been programmed into the chip you can load further updates via USB from your computer.  The pages on the GPS Car and Boat computers both have updated firmware and you should consider updating your device to the latest version (it only takes 20 seconds).

    Putting It In A Box

    You have three options when it comes to packaging the device. These are to put it in a UB3 "jiffy" box, mounting it in the dash of your car/boat or creating your own packaging solution (which will probably be needed if you are going to use the device on a boat).

    UB3 Jiffy Box

    This was the original packaging design.  The PCB fits neatly in a UB3 box (130mm x 67mm x 43mm) which is available from Altronics (part H0203) or Jaycar (part HB6023).  The PCB and LCD assembly is mounted onto the lid of the box and the LCD and switch shafts protrude through the bottom of the box (which becomes the front of the GPS Computer).  The drawing above and the photograph on the right illustrate this approach.

    The front (was the bottom) of the box needs to have holes drilled for the pushbuttons and a cutout made for the LCD screen to protrude through.  If you have got the spacers right (they may need padding with washers) the LCD bezel should be flush with the front panel.  I made the front label from a large sized heavy duty adhesive laser label (Avery 936067) on which I printed the front panel details using a computer printer.

    I then covered it with clear plastic of the type used to cover school books, trimmed it to fit and stuck it on the front.  The beauty of this scheme is that you can make the cutout for the LCD slightly smaller than the size of the LCD bezel, this covers any roughness in the cutout that you made in the plastic and results in a neat appearance.  The diagram below illustrates this approach.

    The GPS module is intended to be positioned as shown in the photograph above where it will be sandwiched between the two PC boards and the inside wall of the box.  To do this you will have to cut away some of the plastic moldings inside the box and drill a hole in the base of the assembly (the removable lid of the box) for the external antenna connector of the GPS module.  When the assembly is lowered into the box the GPS module will then be held tight in position.

    Finally, you need to drill holes for the connectors and LDR on one end of the box and ventilation holes (for the voltage regulator which gets quite hot) on the other end.

    Mounting In A Dashboard

    Following this option you can fully integrate the GPS Computer into the dashboard of your car or boat.   The whole assembly (PCB and LCD) is designed to fit in the space used by a standard car radio and also the new mini car radios that are appearing in some new vehicles.  Often there is a spare space of this size in the dashboard of a car or boat and, with a suitable front panel, the GPS Car/Boat Computer would look part of the original equipment.

    Special Box

    Finally you can also use a special enclosure of your own design.  The GPS Boat Computer is an example of this where the electronics need to be protected against salt spray.  In that case you will have to design your own box, probably with push buttons and waterproof connectors on the end of flying leads soldered to the PCB where the original push components were intended to sit.  The following diagram shows such an assembly that was made by Nigel Hall of Dee Why in Sydney for his boat.

    Downloads

    Firmware Version 1.1 - Original version and source code.
    Requires a programmer and a blank 18F4550 chip
    DOWNLOAD
    Construction Pack (schematic, parts list, PCB design files, etc) DOWNLOAD