Attaching a GPS Module

Pictures to follow soon...

 Things you will need to know:

Gather these details now before you begin.

  1. What is the voltage requirement of the GPS unit, expressed in Volts (V). The voltage requirement will be either 5v or 3.3v.
  2. What is the maximum current requirements of the GPS unit, expressed in milliamps (mA). This will be stated as the something like 48mA (acquisition) and 37mA (tracking), for example.
  3. Is the communication serial (ex. RS232 TTL) or I2C. For the Quadrino we want an I2C device and only the I2C GPS modules will be discussed here.
  4. Is the communication bus 3.3volt or 5volt? Typically this is the same value as the first item, but not always.
  5. The version of eosbandi code that is on the GPS module. You will need to either match with the version of MultiWii on the Quadrino, or reflash your GPS module. Reflashing most competitor modules are not easy because the serial port for reflashing is also used to communicate with the actual GPS chip and conflicts.
[notice class="notice"]Please submit your information and success (or fail) stories to me so I can post the info to this page for others![/notice]

Powering a module - Explained!

I'm confused by volts and amps, what is the difference between these two things?

Voltage, Current, Resistance and Power are so bound together you can't affect one without affecting one or more of the other. There are formulas that relate them but let's keep things simple, when adding a module we must consider what the module will take and what the power supply can give. The power supply will give a set voltage to the module, but the module will pull a certain amperage from the power supply. So again, the power supply gives voltage, the module takes current! When matching the power supply with the module, we must ensure that the module will not take more current then the power supply is capable of handing out.

When powering a module the voltage between the power supply and the module will stay constant (at least, we hope so!). The module, however, may alter it's current demand based on what it is doing at that point in time. For example, while searching for satellites the GPS module may increase power in order to better it's chances of finding a weak signal but once the it has found enough satellites it may reduce power to a more reasonable level. 

What regulator can I use to provide 3.3volt power?

One option is the 3.3volt 500milli-amp (mA max) voltage regulatorin a TO220 physical package (part# UA78M33CKCS) from Digikey. This will provide the necessary current for the GPS module and probably any other modules you need in the future. It's pins are also the right size and spacing to fit a standard RC 3pin connector. You can plugin the connector and heat shrink it to keep it in place. This means no soldering necessary!

The 500mA is a current limit maximum but it does not consider the heat that may be dissapated by the device. If you approach 350mA you may notice the device heat up considerably and a heat sink will be needed. Luckily our modern micro GPS devices do not take more than 100mA typically so a heat sink wont be needed. You can test the temperature with your finger, if you cant keep your finger on it then it's too hot!

So down to business, how do I hookup the GPS module?

Adding an I2C GPS module should be very simple for most of the GPS units I've seen on the internet. The process consists of proper mounting and then wiring 4 wires between the GPS module and the main Quadrino. In some cases we may need to add a voltage regulator module.

Pre-installation Steps

First of all, DO NOT update the firmware on your Quadrino until after you have installed the GPS module. DO verify the basic operation of the quadrino before beginning. If the basic operation fails after installation of the GPS unit then you will know it was something in the GPS installation and not a pre-condition. Once the GPS is installed, verify the basic operation again before updating the Quadrino firmware with a GPS-enabled version. A firmware with GPS-enabled with simply ignore the GPS but if the GPS is installed incorrectly it can affect the operation of the flight sensors such as the gyro, accellerometer, magnetometer and barometer. Verifying basic operation at each step will narrow down any mistakes.

Mounting the GPS module

I recommend mounting the GPS using an unused mounting hole on the Quadrino using a standoff. However, if you use this method you should have a cover for the whole thing. The sole reason being that if you happen to crash the copter upside down a force on the GPS module is going to torque the standoff and possibly fracture the Quadrino board. So if you dont plan on covering the unit then place the GPS module off of the center frame itself. Try to keep the GPS module away from the ESCs and the motors where high currents can cause interference or noise to be induced into the GPS electronics.


Wiring the device for power

THere are 4 wires that need to be patched between the module and the Quadrino. Two of these wires are simply power, and here you need to know of your module wants 5 volts or 3.3 volts. If you power the module incorrectly (namely to much voltage) you can permanently damage the device!


Requring the 3.3V regulator

If your module is 3.3volts you will need to add a voltage regulator inline. You cannot use the 3.3v power from 4pin the I2C bus header because it cannot supply enough power for a GPS module. Purchase the voltage regulator from Digikey above. You can solder wires to the regulator, but the easiest way to use this regulator is to use a 3pin RC cable just like a servo has. This 3pin header can be plugged right into the regulator's 3 pins. Another method which is convenient is to use single jumper wires like those found on sparkfun or adafruit. I prefer the jumper wires because they are more versatile and usable for other projects.

Now with the wires attached shrink wrap the whole thing or wrap in electrical tape to so as to secure it and prevent the metal tab from shorting anything else out inside your quadcopter.

The color coding on the 3pin header is not going to be correct. If you are looking at the voltage regulator from the front (where the part text is), then the left pin will be the voltage input (5v), the center pin is GROUND, and the right pin is voltage out (3.3v). You can either pop out the wires from the 3pin header and move them to match, or simply accept the incorrect color coding. Popping out the wires of the 3pin header is usually pretty simple and we can then make the black wire match GROUND, red wire match 5V (left) and brown or yellow match 3.3V (right).

We will require 5V and GROUND pins from the Quadrino. We can use the ones from the MOTOR and RADIO pins. You will need to add a few header pins to these locations on the board if they arent already present.

Now attach the center wire (ground) to a ground pin on the Quadrino. Then attach the 5V (left) wire to a 5V pin on the Quadrino. Now attach the third (right) wire to the GPS module's 3.3V power input. Now attach another ground wire from the Quadrino to the GPS module. We needed two ground wires because the voltage regulator requires it's own ground to work properly.

Wiring the device for communication

Now that we have powered the device we are ready to connect the last two wires which are the I2C data lines. These signals are called SCL (Serial CLock) and SDA (Serial DAta), or sometimes CLK (CLocK) and DTA (DaTA). Either way, one is a clock signal, and one is a data signal. Here the voltage of the communication bus is not that important. All I2C GPS modules are going to have an Atmel processor that can accept 5v or 3.3v I2C lines no matter what the main voltage happens to be. This means we can use either of the I2C headers on the Quadrion (the 2pin or 4pin header). However, I would still recommend using the same I2C voltage header as the module voltage.

Hopefully you took my suggestion to buy some single jumper wires above. Use two wires (go with SCL-green and SDA-yellow) to attach the SCL and SDA lines between the Quadrino and GPS module.


Now you are ready to power the units on and test the software and communication. If you havent reflashed the Quadrino with a GPS-enabled version of MultiWii then I would suggest testing as is. Make sure that the board still works and all sensors communicate without I2C errors. You wont have GPS yet, but you can verify you did nothing wrong so far. Once you've verified basic operation of the Quadrino then move on to uploading a GPS-enabled version of MultiWii.