GPS device with SMS

Hi,

I have a university project (with two other students) to make a somewhat-portable GPS tracking device. The smaller the better. My idea is to have an Arduino chip with a GPS chip, and then a GPRS attachment which would receive a text message asking for a GPS location, then turn on the GPS chip (need to save power), get the data, turn off the GPS chip, and send the data back as a text message in the standard NMEA format, which I'd then decode on an android app and put onto Google Maps. I've not used Arduino before but I'm very competent at programming, especially with C, and there are so many helpful tutorials around that I'll be able to cope fine, and as I'm at university I can just ask a lecturer for help if I do struggle, likewise with small hardware problems.

For the hardware, I think I need the following: An Arduino chip, a GPS chip, a GPRS device, two antennae (one for GPRS, one for GPS), and a power source.

This looks great as a somewhat all-in-one solution: http://www.cooking-hacks.com/index.php/arduino-mobile-navigator-pack-124.html with the following antennae for GPRS and GPS: http://www.cooking-hacks.com/index.php/internal-gprs-gsm-antenna.html http://www.cooking-hacks.com/index.php/internal-gps-antenna.html

The GPS tutorials I've been looking at are the following: http://arduino.cc/playground/Tutorials/GPS http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-gps

The GPRS tutorial I've been looking at is the following: http://www.libelium.com/squidbee/index.php?title=New_GPRS_module_for_Arduino_(Hilo_-_Sagem)

I feel fairly confident but have a few questions: 1) Would the GPS device be constantly polling for a new location, or does it only do it upon user request? I only want it to check for a location upon receiving an SMS to save power. If it powers on when I request a location, that's fine. If not, how would I turn it off?

2) What power source would I need? A thread on Cooking Hacks link here (which provides the GPRS chip) suggests that this device would provide enough power. However, it's very expensive. What would you suggest as a power source? Remember, small is key! I see a mention in the GPRS tutorial about using a capacitor if the amps are too low. Would you suggest that? Again, I would love to use a small power supply (Ideally I'd use a regular 9V battery - would that work with a capacitor to provide the power required?)

3) Do you have any suggestions or tips? Is there a cheaper way to do this? We have a budget and these components alone take us a little over the budget, so any way to make it cheaper would be welcome.

Whether or not the GPS can be put into low power mode depends, of course, on the GPS. I suggest you have a look at www.sparkfun.com where there are many GPS modules to select from. Choose one that supports a sleep mode. The bigger question you have is, after it wakes up, how long does it take for it to acquire a fix? If you need to do it quickly, then this is important and the receivers have that as a listed specification.

How well a GPS receiver depends upon its orientation relative to the ground. That white square thing on the top is an antenna. Its designed to have the most gain off its edges, where the birds on the horizon are. These are the most important, and most difficult, ones to receive. If you go putting some kind of wire antenna on the receiver you may defeat that.

The Arduino can also be put to sleep, although others may be more familiar with how to do that.

Who are you trying to spy on? Ex wife? Business rival?

Overall this is not hard to do.

We plan to mount it inside an empty bicycle light and use it to locate a bicycle (the city I go to university at is full of bicycles and they are regularly stolen). We just want to find a position, as soon as one GPS String is sent, the GPS chip can be shut down again. As such, speed's not important, it's being able to sleep/suspend/hibernate that's important.

I was under the impression that the GPS "antenna" I linked to is the actual GPS device - it's just on a wire so that one can position the GPS receiver independent of the rest of the circuit.

That is, http://www.cooking-hacks.com/index.php/internal-gps-antenna.html is the actual GPS receiver, and http://www.cooking-hacks.com/index.php/shop/arduino/gps-module-for-arduino.html handles the data and sends it down to the Arduino chip.

Am I mistaken? The second link says that the first item is required which is what made me think that the first item wasn't an "antenna" even though it's described as such.

(Edit: http://download.vincotech.com/positioning/A1035-D.pdf seems to confirm that these Vincotech GPS modules have two parts).

http://www.cooking-hacks.com/skin/frontend/default/cooking/pdf/GPS_Firmware_GSC3_3.5.0_V4.2.pdf has the command to hibernate the chip:

$PSRF117,16*0B

However, it then states:

To wake up the GPS module again one of the following methods can be used:

• Toggle ON-OFF • Toggle nReset

And I can't for the life of me figure out what it means with the "Toggle" suggestions.

I'll have a look at sparkfun anyway - perhaps I can find a GPS device more suited to these purposes - but if the cooking-hacks things would suffice then I think I'd prefer them for the convenience.

I use this one on my projects:

http://www.sparkfun.com/products/8975

I probably should not offer this, but... I have a nice small board you can mount this to. The board has an ATMega 640 processor, an RS-232 driver and an RS-422 driver. You can take the module linked above, and solder a right angle 5 pin header to it, then drop it on to the board and secure it with two small plastic screws.

Based upon your application, I would say skip the antenna and all the large arduino stuff. But you'll still need to figure out the SMS portion of the project.

I'm trying to remember just what's on the board. I know it has a 5V regulator and a 3.3V regulator. If you use an 8MHz crystal instead of a 16MHz crystal you could probably power the entire thing from just the 3V regulator.

Your SMS board should leave the GPS asleep, then query it when it need location data.

To power it, you'll want something that can take advantage of the full capacity of your battery. Look at this:

http://search.digikey.com/us/en/products/LTC3525ESC6-5%23TRMPBF/LTC3525ESC6-5%23TRMPBFCT-ND/1021099

Your offer is very kind, but I'm in Sweden and delivery from the US would, from my experience, be so high that it'd be quicker and cheaper to buy a chip new.

And yeah, the SMS portion is what drew me to Arduino for the convenience of the complete components. How would you suggest doing it otherwise? I don't have too much experience with electronics so I can't do anything too advanced (This is my first year at uni and my first project).

Lastly, as for the power suggestion - I have to confess I have absolutely no idea what the thing you linked is. That's beyond my capability. I understand the theory of circuitry (we've covered it at uni), and we've built circuits, but always with power supplies at various voltages, with no need for batteries.

Okay, first off, "toggle" means turn something off and then on, so its saying turn power off then back on.

Okay, so how to do it. Well its all trade offs of course. If you have plenty of space and power, you could buy an SMS shield, a GPS shield and an Arduino Uno. You would want the SMS shield to allow stacking another shield on top.

To save some space, you could get the GPS module and solder (find a friend to teach you how) a few wires to it, and connect it to the Uno. You would then use the newSoftSerial library (which I think is now part of Arduino 1.0) to talk to the GPS module. There is a GPS library available to talk to it.

The SMS I have never worked with, but I know the shield also has a library.

That device about the power is a nifty little chip that will take input from a battery, like a lithium ion battery, and as the battery voltage drops, it will convert the reduced battery voltage to 5V. So you get more ability to use the battery's stored energy.

If I were prototyping this, as you are doing, I would go with the shields and get the software all working, but I would not expect it to fit into the headlight. Once I decided it would work, then I would design a special board for it. You can get the SMS module, the GPS module, put them all on a board with a processor and you're good to go. Ya know, if you wanted, you could build it with wire wrap on a breadboard, but you'll need someone with experience in electronics to help.

My thoughts with the light were to use something like this:

Which are fairly large.

Are you meaning buying the shields, getting the software working, and then removing the components from the shields and putting them onto a new breadboard? That sounds like a good idea, actually, and then that should fit into a bike light. I can definitely get help for that from a lecturer if needed, and I do have some soldering experience.

The two shields I linked to actually just take up "one" layer - there's a quarter missing from the SMS shield, and the GPS shield fits perfectly, like so:

That also shows that the GPS "antenna" is just the GPS device on a wire so it can be kept horizontal. Likewise, the fact that it only needs to stack two high makes it smaller, and it might squeeze into a large light as-is.

The software side of things isn't worrying me too much - software is very much my forté anyway.

Lastly, I've seen it stated that an Arduino can't tolerate more than 1A, which is a problem as the GPRS device needs 2A when receiving and sending texts.

Would adding a capacitor (like the image below) be enough? As the power required for an SMS send/receive is very brief, a capacitor seems perfect.

p.s. thanks for the help, you're absolutely fantastic!

I wouldn't take the components off the shields, I would buy new components but yes, that's the idea. Get your concept working then build one that fits inside the light.

I don't know that an Arduino has a 1A limit, although I would have to check to see what the regulator is rated at. It may very well have a 800mA or 1A regulator. The cap is not going to work like that. First, you would need a resistor between +5V and the cap. Second, it would have to be a vastly bigger cap then 220uF. Third, its going to take some time to charge. Its funny you should mention the cap, Corssroads and I are struggling with a super cap circuit right now.

Whoever designed the shield must be aware of the amount of current an Adruino can provide and documented this if its an issue. If you are not sure send them a note and ask. But 2A to drive an SMS transceiver? Seems like quite a lot.

I don't think it has a regulated limit, I think it's that the hardware just can't take the heat caused by a high ampage.

https://tronixstuff.wordpress.com/2011/01/19/tutorial-arduino-and-gsm-cellular-part-one/ mentions the amp stuff:

The GSM shield can often require up to 2A of current in short bursts – especially when turned on, reset, or initiating a call. However your Arduino board can only supply up to just under 1A. It is highly recommended that you use an external 5V power supply capable of delivering 2A of current – from an AC adaptor, large battery with power regulator, etc. Otherwise there is a very strong probability of damaging your shield and Arduino. Ignore this at your own risk. When connecting this supply DO NOT use the DC socket on the Arduino. Instead, connect the 5V (positive) from the supply to the 5V pin on the GSM shield, and the negative to the GND pin. For example:

This thread also suggests that too high an ampage being drawn through the device can cause damage (although it's talking about 7.5A, not 2A).

The capacitor drawing is actually a suggestion by the designer of the SMS shield, from here.

If you want the shield takes power from Arduino => Set the jumper to Arduino 5V possition If you want the shield takes power from an external supply => Set the jumper to V ext. possition For powering the shield from external supply, you have to use V in ext. connector (Vin + GND).

If you use a power supply with output smaller than 2 A, you should add an extra capacitor for the power.

For example, a 220 uF electrolytic capacitor between 5V and GND.

However, as you say it seems odd that it would draw more from the Arduino than the Arduino can supply. I have tried to contact them but have yet to get a reply (it's not been that long).

Well, if he says the cap would work, then it probably will. Its worth a try.

If you try to draw more current than the Arduino can course, the regulator will stop working correctly and the voltage will drop, and then things will get screwy. So you'll know there is an issue.

The cap seems to suffice, although I’ll wait for confirmation before committing.

As for power, I’ll need to figure out what the average amp use is to see what sort of battery would suffice, but for now we’ll just use the power supply we have at uni (a Powerbox 3000). I can keep the amps at 1A, try the voltage at 9V and see if everything works. If it does, then the capacitor must be doing its job. Then I can hook up an ampmeter and see what the passive amp drain is and the active when finding a GPS location, and that’ll guide me to how many amp hours we’ll need to be realistic.

Actually, I misread that diagram about the cap. I looked too quickly and misread the value. A 220 microfarad cap is actually pretty big. It can probably do the job. If you're charging it from 5V, get a 5 volt one, like this:

http://search.digikey.com/us/en/products/PA-5R0V224-R/283-2786-ND/1026754

I am surprised he did not put a resistor in there though.

There is one mistake in that picture that he's stated - it should be between 3.3V and GND, not 5V and GND.

(So as such, I should get a 3.3V cap).

From Digikey at least, there is really only one choice:

http://search.digikey.com/us/en/products/DCK-3R3E224U-E/604-1007-ND/970168

Its surface mount, but its big enough that you can solder some wires on to it.

Isn't that 220mF rather than 220µf?

Strangely, the cap he's used:

is rated for 16V unless I'm reading the image wrongly.

Edit: Scratch that, yes, it's clearly 16V, but it's a cap, so that doesn't really matter.

There are hundreds of 16V 220µF caps though. I'll just get one from my lecturer, they have plenty of caps lying around at uni, hopefully they'll have one that matches those specs.

mF == micro fared. uF == micro fared. u is the greek symbol. When I first read it, being tired and in a hurry, I thought I saw pico fared. When I took a better look I realized my mistake.

Yes you can use a higher voltage cap. In fact, if you don’t have any charge control circuitry, you’re better off because it will be more resilient against transient spikes and such. It will charge to 3.3V. I don’t know exactly how it will perform in this type of environment, where it is providing supplemental current. Normally, if the regular power goes away, the super cap discharges and holds the circuit up long enough for it to do whatever it needs to do before it goes dead. In that case, if you have say a 5V cap, and the electronics needs at least say 4V, then you only have 1V of stored energy available. So you’re wasting a lot of the storage capacity. If you use that booster I linked to, it will use almost all of the energy, draining the cap down to about a volt but converting all that energy to 5V. So you use much more of the storage capacity. So you can use a smaller cap. There are other advantages as well.