BASIC on Raspberry Pi Pico
  • BASIC Interpreter
  • BASIC with VGA Display
  • BASIC with WiFi & Internet

  • Maximite Family
  • Colour Maximite 2
  • Original Colour Maximite
  • Monochrome Maximite
  • The Maximite Story

  • Micromite Family
  • Micromite Summary
  • Standard Micromite
  • Micromite Plus
  • The Microbridge

  • Micromite LCD Backpack
  • Micromite LCD Backpack
  • Air Quality Monitor
  • DDS Signal Generator
  • Super Clock
  • Boat Computer MkII
  • Parking Assistant

  • Other Projects
  • Pico Gamer Console
  • Precision Analog Clock
  • Watering Controller
  • Windows/DOS MMBasic
  • ASCII Video Terminal
  • Utility Power Supply
  • Precise Voltage Reference
  • ISM Band Scanner
  • Game of Pong
  • Simple GPS Based Clock

  • Useful Techniques
  • 3D Printed Cases
  • Measuring Capacitor ESR
  • Surface Mount is Easy
  • Programming PIC Micros
  • Custom PC Boards
  • The Gerber Format

  • General Articles
  • Problems in Open Source
  • Hantek DSO-2250 Scope
  • Rigol DS1000 Scope
  • Brickbats

  • WEB Site
  • Home
  • Old or Obsolete Projects
  • About



  •  

     

     

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

    EM-408 GPS Module

     

    The EM-408 is a popular GPS module that suits hobbyist type projects. It comes complete with a built in antenna and connecting cable, is available reasonably cheaply from many sources and, most importantly, just works without too much drama.

    For those who don’t know what it does: It uses the GPS satellite system to report your current latitude, longitude, altitude, speed and much more, all in a small package about one inch square.

    I have used it a number of times and have got to know its characteristics and quirks. One of its few drawbacks is that, like many sophisticated electronic devices from the depths of China (or, in this case Taiwan), it comes with little detailed documentation.

    So, this is the purpose of this article; to impart the knowledge that I have on this device and thereby hopefully help others who want to use it.

    Two Versions

    Amazingly there are two versions of the EM-408 with the same part number.  The standard version uses TTL voltage levels on its serial output (idle is 2.7V, the start bit and logic 0 are zero volts).  The alternative uses RS-232 voltage levels and polarity (idle is -6.8V, the start bit and logic 0 are +6.8V). 

    The only way that you can tell the difference is by physically looking at the module.  The TTL version has the shield extended over the connector as shown in the photo at the top of this page while the RS-232 version does not have this feature as shown in the photo on the right.  The documentation only refers to the TTL version and when you are ordering one of these modules you have no idea of what one you are going to receive as the part numbers (EM-408) are the same.

    It is incredible that a supplier would create such confusion in the market place and unfortunately their crime is compounded by the dreadful documentation that they supply.

    dx.com has a very cheap TTL/RS-232 converter board (link) that you can use to convert from one to the other.

    There is also a later version on the market called EM-408E.  It looks like the RS-232 version (without the extended shield) but what documentation is supplied claims that its output uses TTL voltage levels.  I have not tested this version but it appears to have a few other differences including replacing the enable input with a battery backup input.

    Where To Find It

    The EM-408 is made by GlobalSat Technology Corporation (www.globalsat.com.tw).

    You can buy it in Australia from Altronics (http://www.altronics.com.au) as part number K1131. I like the USA based SparkFun (www.sparkfun.com) as they have good prices, very cheap shipping and always plenty in stock.

    From my past experience both these companies sell the TTL output version while DX Extreme (dx.com) sell the RS-232 version.

    If you Google “EM-408” you will find many more suppliers.

    Documentation

    I have not found a lot of good documentation but what I do have is available for download at the bottom of this page. This includes the official User Manual, SiRF NMEA Reference Manual and the SiRF Binary Protocol Reference Manual. The notes on this web page will not duplicate this data—so you also need to refer to them.

    The EM-408 uses the SiRF starⅢ GPS chip set so any documentation on that should be applicable to the EM-408. It implements a subset of the NMEA 0183 standard and you will also find that standard documented on the Internet. You could also purchase the official NMEA documents but they are not cheap.

    Power Supply

    Amazingly the documentation does not list the supply voltage tolerances. The “user manual” simply states 3.3V while the label on the packet holding the device is a little more informative—it states 3.2 to 3.6V.

    I have found the module to be quite sensitive to the power supply voltage. If it dips much below 3V, even for a millisecond, it will cause the module to reset. So, it seems that a good design target is 3.2V minimum. On the maximum voltage; I had a module that was mistakenly connected to 5V and it happily ran that way for some time without injury. Obviously this is not recommended but it does illustrate how tough the little thing is.

    Einstein’s theory of relativity
    and GPS accuracy

    The satellites used in the GPS system circle the earth at an altitude of 20,000 kilometres and are used to “triangulate” locations on Earth using precise onboard clocks. In their high-altitude orbits the clocks experience a weaker gravitational field, which means that spacetime is warped differently for them compared to similar clocks on Earth.

    The effect is that the clocks speed up at a rate of 45 microseconds each day. Apart from the gravitational effect, the satellites are also whizzing around at pretty high speeds (around 14,000 kilometres per hour) and the time dilation predicted by Einstein’s special theory amounts to a slowing down of the clocks by 7 microseconds each day. Taken together, the two effects amount to a net speeding up of 38 microseconds per day.

    That doesn’t sound like much but ignoring it would lead to a huge inaccuracy in the GPS system within a few hours. Light travels around 30 centimetres in 1 nanosecond, which is 10,000-millionth of a second. Thirty-eight microseconds is therefore equivalent to over 10 kilometres in position per day, which wouldn’t make for accurate navigation.

    The solution is to run the satellite’s clocks slow by a precise amount calculated using Einstein’s theory of relativity so that they match time measured on the Earth’s surface and in turn allows the system to work to accuracies of meters rather than kilometres.

    From:
    Why does E=mc2 by Brian Cox and Jeff Forshaw

    ISBN 978-0-306-81758-8

    The manual is also rather vague on the current draw, it just states 45mA. This is about right for the normal operating current after the module has acquired sufficient satellites but the current does jump around a lot, especially during startup when it is more like 75mA with a peak to about 90mA. With the enable line pulled low the module will go into a sleep mode where its current draw drops to 0.4mA.

    When the module is first connected to the power it also draws current to charge its internal super capacitor which is used to power the memory holding the last location and time information. By keeping this memory alive the module can quickly lock onto the satellites when power is re applied. For a module that has not been used for some time this charging current could peak to as much as 8mA but it drops to zero over a few minutes.

    So, summarising: The power supply should be nominally 3.3V with a maximum range of 3.2V to 3.6V. Current draw is 100mA peak at startup, typically 45mA when running and 0.4mA in disabled mode. A small 3 terminal regulator chip like the LP2950CZ –3.3 easily meets these requirements.

    Connections

    There are 5 connections to the module. These are:

    The Enable signal is active high (ie, pulling it high will enable the module, pulling it low will put the module to sleep). If you are not using Enable you must pull it high with a 4.7K resistor. Letting it float will disable the module.

    Some documentation states that the Receive Data line should also be pulled high for the module to work. This is not necessary as the Receive Data line has an 12K (approx) resistor internally pulling the line up to the Supply Voltage.

    TTL Version Output

    Both the Transmit Data and Receive Data on the more common version (with TTL voltage levels and polarity) use standard serial protocol as implemented in most microcontroller UARTs. In this interface the voltage is inverted with respect to RS232 and uses (almost) standard logic levels but otherwise it is the same serial data standard used by desktop computers.

    It is easy to use the module with a microcontroller running at 3.3V (you can just directly connect the two together) but there are some important considerations if your micro is running at 5V. When sending data to the module’s Receive Data from a 5V system you must be careful not to over drive the input and to avoid this you can use a couple of resistors to drop the voltage. The value of these resistors should take into account the 12K internal resistor between Receive Data and the Supply Voltage pin.

    Another issue with interfacing the module to 5V systems is that the Transmit Data logic high only reaches about 2.7V. Most modern microcontrollers have a Schmitt Trigger input and they typically need a logic high input of 4V when running on 5V. In many cases the data will just scrape through but, because the voltage is marginal, you may get errors in the data stream. These seem to increase the longer the module has been running.

    A micro with TTL inputs or running on 3.3V will be OK as their logic high threshold is much lower.

    For interfacing to 5V systems the solution is to put the Transmit Data stream through a comparator with the comparison voltage set to something like 1.5V. The output from this should then be a clean TTL compatible serial data stream. Fortunately, for users of the Microchip PIC series of microcontrollers, many of these chips have two comparators built in and you can use one of them to clean up the signal before passing it onto the chip’s UART.

    RS-232 Version Output

    If you are connecting this version to a microcontroller you will need to use an interface chip like the MAX232 to convert the output to TTL levels and signaling polarity.  An alternative is to clamp the output to +5V/0V using a resistor and diode then invert the serial data stream in software in the microcontroller.

    Typical Output

    There have been some comments on the Internet that a factory fresh EM-408 defaults to binary mode at a high baud rate. This is not so, it defaults to NMEA messages at 4800 baud, 1 stop bit and no parity. The default NMEA messages outputted are GSA, GSV and RMC.

    The following lists the typical output from the module when it is first powered up in the factory default state and before it has gained a lock on any GPS satellites:

    $PSRFTXT,Version:GSW3.2.4_3.1.00.12-SDK003P1.00a
    $PSRFTXT,Version2:F-GPS-03-0701301
    $PSRFTXT,WAAS Enable
    $PSRFTXT,TOW: 0
    $PSRFTXT,WK: 1399
    $PSRFTXT,POS: 6378137 0 0
    $PSRFTXT,CLK: 96250
    $PSRFTXT,CHNL: 12
    $PSRFTXT,Baud rate: 4800
    $GPGGA,235947.050,,,,,0,00,,,M,0.0,M,,0000*5D
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235947.050,V,,,,,,,281006,,*29
    $GPGGA,235948.057,,,,,0,00,,,M,0.0,M,,0000*55
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235948.057,V,,,,,,,281006,,*21
    $GPGGA,235949.042,,,,,0,00,,,M,0.0,M,,0000*50
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235949.042,V,,,,,,,281006,,*24
    $GPGGA,235950.042,,,,,0,00,,,M,0.0,M,,0000*58
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235950.042,V,,,,,,,281006,,*2C
    $GPGGA,235951.042,,,,,0,00,,,M,0.0,M,,0000*59
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGSV,3,1,12,20,00,000,43,10,00,000,,31,00,000,,27,00,000,*7B
    $GPGSV,3,2,12,19,00,000,,07,00,000,,04,00,000,,24,00,000,*76
    $GPGSV,3,3,12,16,00,000,,28,00,000,,26,00,000,,29,00,000,*78
    $GPRMC,235951.042,V,,,,,,,281006,,*2D
    $GPGGA,235952.042,,,,,0,00,,,M,0.0,M,,0000*5A
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235952.042,V,,,,,,,281006,,*2E
    $GPGGA,235953.042,,,,,0,00,,,M,0.0,M,,0000*5B
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235953.042,V,,,,,,,281006,,*2F
    $GPGGA,235954.042,,,,,0,00,,,M,0.0,M,,0000*5C
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPRMC,235954.042,V,,,,,,,281006,,*28

    The following shows the output after the module has got a lock on sufficient satellites to get a valid position:

    $GPGGA,043356.000,3158.7599,S,11552.8689,E,1,05,3.4,25.0,M,-29.3,M,,0000*56
    $GPGSA,A,3,23,20,13,11,32,,,,,,,,4.7,3.4,3.4*31
    $GPRMC,043356.000,A,3158.7599,S,11552.8689,E,0.24,54.42,101008,,*20
    $GPGGA,043357.000,3158.7598,S,11552.8691,E,1,05,3.4,24.6,M,-29.3,M,,0000*58
    $GPGSA,A,3,23,20,13,11,32,,,,,,,,4.7,3.4,3.4*31
    $GPRMC,043357.000,A,3158.7598,S,11552.8691,E,0.32,57.59,101008,,*27
    $GPGGA,043358.000,3158.7597,S,11552.8692,E,1,05,3.4,24.0,M,-29.3,M,,0000*5D
    $GPGSA,A,3,23,20,13,11,32,,,,,,,,4.7,3.4,3.4*31
    $GPRMC,043358.000,A,3158.7597,S,11552.8692,E,0.33,58.17,101008,,*20
    $GPGGA,043359.000,3158.7597,S,11552.8693,E,1,05,3.4,24.4,M,-29.3,M,,0000*59
    $GPGSA,A,3,23,20,13,11,32,,,,,,,,4.7,3.4,3.4*31
    $GPGSV,3,1,12,11,75,324,36,01,59,146,27,32,58,161,34,20,56,209,30*75
    $GPGSV,3,2,12,23,52,301,40,25,42,101,,13,23,311,23,17,19,237,23*72
    $GPGSV,3,3,12,31,12,136,,19,08,358,13,14,06,136,,27,05,350,*72
    $GPRMC,043359.000,A,3158.7597,S,11552.8693,E,0.29,58.06,101008,,*2B
    $GPGGA,043400.000,3158.7598,S,11552.8693,E,1,05,3.4,25.0,M,-29.3,M,,0000*58
    $GPGSA,A,3,23,20,13,11,32,,,,,,,,4.7,3.4,3.4*31
    $GPRMC,043400.000,A,3158.7598,S,11552.8693,E,0.20,72.85,101008,,*25

    Each line is terminated with a Carriage Return and Line Feed pair of characters.

    The NMEA standard states that the maximum number of characters between the starting $ and the CR/LF pair should be 80 characters. I have read references that suggest that many GPS modules exceed this and apparently the SiRF chipset can output a second line if the first line would be too long. I have not seen either of these effects so perhaps this is just another inaccurate comment.

    Input Commands

    You can send many commands to the module, see the documentation. Two commands that I have found useful are:

    Turn off WAAS:                    $PSRF151,00*0E
    WAAS is not available in Australia and there is no point in having it turned on (might even impact performance). This command must be repeated on every power on or reset.

    Reset to factory default:       $PSRF104,00,00,00,00,00,00,12,08*29
    I have found that when sent at 4800 baud this command worked even if the module was somehow put into the wrong baud rate.  This is not guaranteed but is a very handy characteristic.

    Both of these commands must be terminated with a CR/LF pair.

    First Time Startup

    The GPS satellites transmit a sequence of information that enables the EM-408 to calculate details of the satellite’s orbit and from that, its location on the planet’s surface . This data takes 12.5 minutes to transmit so a “factory fresh” module will take at least this time before it can get a valid position fix. The module also saves this data in memory, which is supported by a super capacitor, so that when power is reapplied to the module it can quickly find its location. But, if it has been a long time since it was last used, the capacitor might have lost its charge—in that case you are up for another 12.5+ minute wait.

    So, the moral of this story is: Be patient and don’t jump to an early conclusion that the module is faulty.

    Antenna

    The SiRF chipset is quite sensitive and in most situations can lock onto sufficient satellites using the built in “patch antenna”. Sometimes rain, being indoors and tin roofs can have an impact and it can take up to 5 minutes to get a lock.

    The best mounting position for the module is horizontally with the antenna on top of the module pointed to the sky. This is the most sensitive orientation.

    The gold coloured connector on the side of the module is for an external antenna. You need an active GPS antenna with a MMCX connector suitable for a 3 volt module. There are quite a few to choose from, just Google for "GPS antenna MMCX". I have tested this one from from DealExtreme and it worked well. Another example is SparkFun who also sell the GPS module. They have an antenna with a magnetic mount for US$15. This has a SMA connector so you will also need an interface cable MMCX to SMA for US$10.

    Downloads

    EM408 User Manual DOWNLOAD
    EM-408 NMEA Reference Manual DOWNLOAD
    SiRF Binary Protocol Reference Manual DOWNLOAD