A Small GPS Arduino Watch / Clock

IMAG1236

Another Arduino GPS Project – Mini GPS Device

Garlow is a mini GPS Watch that is based on the Arduino Nano board. It’s not really that “mini” compared to other commercial GPS watch like the Garmin, but I really made a great effort to bring the size down. In fact it looks more like a GPS clock. The first version Arduino GPS logger I built was based on the Arduino UNO, and it was larger than 2 packs of poker cards stacked together. It works just as well as a Garmin GPS watch.

Garlow stands for GPS Arduino Rechargeable Logger OLED Watch. It does what the name suggests: Accurate time, positioning related information are received from GPS satellites, and they can be logged on SD card and shown on a OLED display. It can be carried as a watch or simply left at the back seat of your car as a GPS data logger. The whole system is built on the backbone of an Arduino Nano board, with a Lipo power module which enables USB battery recharge.

During the development of this Arduino GPS watch, I discovered so many things and techniques that I didn’t know about the Arduino, for example I didn’t know you could save data on EEPROM, which is unaffected by power down.

Compoents, and Circuit Connection Schematics

So here are all the parts I used in this project.

  • Arduino UNO
  • Adafruit GPS Module
  •  Mini SD Card module
  • 0.96′ Mono Colour OLED Display
  • Power Cell – LiPo Charger/Booster
  • 600mAh 1S Lipo Battery
  • Some jumper wires

Wiring is easy, and soldering is minimum.  I used jumper wires so each component can be disconnected for future projects.

IMAG1225

IMAG1226

I built the case using Plastic Styrene sheet (my favorite DIY material). Everything is then glued together using hot glue, and some nylon screws and nuts.

IMAG1224

IMAG1227

IMAG1228

IMAG1235

IMAG1234

IMAG1233

GPS Insight

If you don’t know how GPS receiver works, check out my previous Arudino GPS tutorials first. It’s much easier to use a GPS library to help decoding the gps nmea sentences, and get the useful data directly. I am using TinyGPS for this project.

OLED Display Explained

There isn’t any formal or standard library for the 0.96′ OLED displays I bought from eBay, and the one provided by the seller isn’t that easy to use either, so I wrote my own OLED display library here.

arduino-oled-display

Micro SD Card adapter for Arduino

The SD card module is a random one I found on eBay where the Chinese manufacturers have made it dirt cheap (only $5). Most of them works with Arduino using SPI communication. There is a standard SD library provided by the Arduino Official, and here is a tutorial on this. However it was causing flash memory problem for me.

This is a tricky one. I written my sketch, and tested the GPS and OLED display, everything was working great, until I added the SD Card module, and the Arduino IDE was telling me my sketch is too big to upload!

After a long research, and tried many different libraries, I found an old SD library. Although it can only do “append”, it’s only 3KB when compiled. That’s all I need anyway as a data logger.

arduino SD card

Lipo Battery Booster & Battery

Power Cell – LiPo Charger/Booster by Sparkfun. I used this LIPO booster in my DIY Bike Light project, works pretty well as a battery charger and voltage regulator at the same time.

You can leave the circuit running and charging at the same time. It cuts off when voltage drops below 2.6V. Some people found it cuts off at 3.2V or higher, that’s because when the device is operating, and it’s drawing current from the battery, the voltage would drop. When it reaches 2.6V, the fail safe kicks in, and disconnects the circuit, so the voltage of the battery gradually rises again, eventually back to 3.2V. However this will not trigger the booster to start until you charge your battery.

diy-bike-light-voltage-check-3-3V

I am using a 600mAh 1S Lipo battery from my little quadcopter. With the Arduino Nano’s analog input, I am able to check the battery voltage by connecting the battery+ to the analog pin directly. Same reason in the Bike Light project, I had to put a push button in between, so when it’s not pressed, it’s a open circuit. Otherwise current will be drawn from the battery constantly.

Programming

When it came to programming, It was quite a challenge for me. It wasn’t because of the complexity of the coding, but I was stuck with the limited sketch space on the Arduino. I kept getting “Sketch is too big” error, and I was struggling to try to reduce the size of my program. Following my previous post about tips on reducing Arduino sketch size, I was able to cut the compiled size of my code down, just under the limit of the Arduino UNO (around 32K KB), but still it’s 2KB over the limit of Arduino Nano.

After analyzing my code, I realize the biggest space consumer was the SD.h library, and it was taking 13 out of 32KB! After looking over the internet, I found some old SD card libraries tend to be smaller when compiled, but they usually only support FAT16 format, which means SD cards that are larger than 4GB won’t work. I saved another 5KB by using the fat16lib Library. Yes!

Not long after that, I ran out of flash memory again! I have added so many functionality I don’t really want to give up. So I started look for even smaller SD card module library. Eventually I was able to find FileLogger, which only takes 3KB of memory.

I will share my source code once I have finished optimizing it and commented everything.

Performance Tests

IMAG1232

Electrical Property

This GPS clock draws a total current of 40mA at standby mode (OLED turned off, SD card Modue turned off, only GPS working), and at 80mA normal operation (all on). The current consumption can be broken down to:

  • Arduino Nano – 20mA
  • GPS Modue – 20mA
  • OLED Display – 15mA
  • SD Card Module – 25mA

So with fully charged battery (600mA) it can run 13 hours on standby mode (with 10% left), and 6.5 hours on normal operation.

GPS Accuracy

The GPS positioning accuracy is about +/- 3 meters, as you can see from the video the result is zigzag. Update rate is very good which is 10Hz. It also works indoor but needs to be close to the windows.

gps_google

Conclusion

Here is the source code, if you find any bugs, or have any good idea please let me know!

https://code.google.com/p/arduino-gps-watch/source/browse/

Like us on Facebook if you haven't already.
Subscribe to our Channel for random videos :D
If you find this article useful.
Donate any amount, to help us maintain this website.

24 thoughts on “A Small GPS Arduino Watch / Clock

  1. When you’re ready to share, I’d be interested in seeing your code because I’ve been trying to build a similar project, one which uses a GPS, SD card, and a display with Arduino Uno. But I’ve been running up against memory limitations.

    • thanks for your interest. No one said anything about the code, so i have already forgotten about it. i will upload the code somewhere soon. give me a couple of days.

  2. Oscar, nice job. I’m really new to electronics, but managed to build two working GPS receivers, one with a 16×2 LCD, and the other with a 2.2″ TFT (Adafruit) the 2nd one is pretty good, but about the dimensions of an iPhone, but twice as thick. I want to make one even smaller one and thinking of using Arduino Micro again and a smaller display like OLED, I’m really new to code, so that’s my big challenge. I would really like to get your code for this project…yours does lots more than I need, so that would really get my project going…

    Thanks,
    Jim

  3. […] Garlow is a mini GPS Watch that is based on the Arduino Nano board. It’s not really that “mini” compared to other commercial GPS watch like the Garmin, but I really made a great effort to bring the size down. In fact it looks more like a GPS clock. The first version Arduino GPS logger I built was based on the Arduino UNO, and it was larger than 2 packs of poker cards stacked together. It works just as well as a Garmin GPS watch.  […]

  4. Hi
    Nice project and I am interested by your project, working also on a similar one. I will be glad if you can send me your sketch.
    Thanks and best regards
    Olivier

  5. […] Garlow is a mini GPS Watch that is based on the Arduino Nano board. It’s not really that “mini” compared to other commercial GPS watch like the Garmin, but I really made a great effort to bring the size down. In fact it looks more like a GPS clock. The first version Arduino GPS logger I built was based on the Arduino UNO, and it was larger than 2 packs of poker cards stacked together. It works just as well as a Garmin GPS watch.  […]

  6. Hi, your project is exactly what i’m trying to build as well. But i am struggling with the same problem (code size). The parts I am using for my tests are
    – Sparkfun Arduino Pro Mini 5V/16Mhz
    – Adafruit Ultimate GPS v3
    – Adafruit Monochrome 1.3″ 128×64 OLED graphic display (or 128×32 OLED)
    – Adafruit Micro SD Breakout.
    – unfortunately I cannot get an LiPo Charger/Booster here in Switzerland like the ones from Sparkfun (my be you have an Idea how to solve this)

    But always the same problem everything is working fine except the SD Logging Function (because of the code size – I will try with one of the 2 libraries you described).

    Your menu structure is fantastic and I would really like to implement this into my little project as well. How exactly did you realize this?

    Would you mind to share the code? Does not matter if it is not documented I would really like to try it with the parts I have here.

    many Regards from Switzerland,

    Nelson

    • Sure! I have always wanted to upload my code once I added adequate amount of comments in the source code, but I still haven’t got around doing that. I might just upload it anyway in the next few days!

      thanks for the reminder!

  7. How did you do your menu system? Did you use an existing library or did you create it yourself in the code?

    many regards, Nelson

  8. Hi Oscar, i think you meant main.cpp right?. I get compile errors on all drawBitmap commands like
    start_up_logo
    kmh
    DregreeSymbol
    minus

    where did you store them? I don’t see any code in main.cpp where you load them first from somewhere.

    And thanks a lot again for sharing your code. I’m learning a lot by going through your code.

    Nelson

  9. Hi Oscar, did you connect your SD-Shield using HW SPI? If so, on which pins did you connect it (11,12,13?). I am using Adafruits mircoSD Breakout (adafruit.com/products/254) and I cannot get it to work with the Filelogger Library. I formatted the microSD with FAT16 and created a file with the corresponding name in the code and included some characters (because as I read, the file needs to have at least one Byte inside it). All other (big) SD-Libraries work fine, but since my sketch size is already quite large, since I head to take u8g-Lib for my Display and Adafruits GPS-Lib for the GPS.
    I would really like to use the Filelogger-Library but with all my tests I get the Resultcode 1 (“Result: Fail initializing”).
    Regards, Nelson

    • I connected the SD card module described here:
      http://blog.oscarliang.net/sd-card-arduino/

      how big is your SD card, as I described in my post:

      I found some old SD card libraries tend to be smaller when compiled, but they usually only support FAT16 format, which means SD cards that are larger than 4GB won’t work.

      Mine is 2GB micro SD card, have you tried something similar?

  10. I have a 1GB FAT16 formatted microSD in the Shield mentioned. All other (bigger) SD Libraries work with my SD-Card, just Filelogger does not.

  11. Hi Oscar, great project – very useful. Thanks for posting the code, but would you be able to post only the code from the menu? Right now I don’t need the rest of the functions in and when I try to remove them manually many errors show up. If you have a done menu project just like this one and posted it it would be great.

    Thanks a lot!

  12. Hi Oscar,

    many thanks for your work. All is working except my SD Card (Error1).
    I see in MMC lib this:
    // PORTB pin numbers
    //
    // arduino D10
    #define SS 2

    Which Pin is SS Pin? Pin4 is reserved by GPS and PIN 10 isn´t working.
    Which file will be created on the Stick? MyFile with some characters?
    Would be great to finish your project.

    TIA
    Frank

  13. It´s me again :-)

    Filelogger Lib is working now with 2GB SD Card, but it won´t work with your sketch.
    I have to disable #define MEM_PW 8 and the after i type “W” it appends the card with messages.
    Card is directly powered and not via Output Pin.

    12345Hello, this is my message. Just testing the FileLogger library.
    Hello, this is my message. Just testing the FileLogger library.
    Hello, this is my message. Just testing the FileLogger library.

    My card will not work with your sketch.. Error1.

    Any suggestions??

    BR
    Frank

  14. Sorry for hitchhiking/confusing this Blog, please delete older posts of me.
    Now it´s working and data will be written to the sd card. :-)
    Size is a matchbox format, which is very comfortable to mount it anywhere.(quadcopter .. bike.. etc.)

    For other users:
    You need a sd card with maximum size of 2GB, e.g. Trancend.. working like a charm.
    If you have an arduino nano, connect the card to pins 10 to 13. Test it before with filelogger.pde and exclude #define MEM_PW 8. Power your SD Card via VCC (3.3V).

    I take a short trip with my car and now i have some gps coodinates, but speed is mssing.
    Next question is to import those data to google earth or or google maps to verify my trip?

    Hope you can help me there @Oscar.

    Thx for your good work!!!

    KR
    Frank

Leave a Reply

Your email address will not be published. Required fields are marked *


9 × = eighty one

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>