Update 12/02, I have rewrite the sketch:
– The sketch is more clear, light and compact, 3.76ko from 5.07ko comparing old sketch.
– Use TinyGPS lib, so you can select what we want to log.
– Create a .CSV file directly, you can use import function from GoogleEarth PRO (good news, Google has released it for FREE right now).
In the past two years, i have released two version of GPS logger, with a lot of default like, poor autonomy, need to take off the sdcard to get the log, no function to upgrade the code easily, by the way, i have redesigned a new version with a lot of news feature, see bellow.
– Better autonomy.
– Be lightweight and portable.
– Be rechargeable easily.
– Got log directly from USB.
– Upgrade code via IDE Arduino through USB.
– Future options implemented for improvement.
– Many more …
– µC Section
The hardware run around a Teensy 2 this very small board run with a ATMEGA32U4 8bit AVR 16 MHz Processor, 25 I/O.
Issue encountered: On the first board prototyp i have mounted a PA6B without problem, when i powered up the pcb for the first time the GPS try to lock to satellite, in this case the 3d fix output should continuously output one-second high-level with one-second low-level signal, in theorical, regarding the data sheet, when the GPS is locked on the satellite, the output pin should continuously output low-level signal, but in my case, the output give me a high level signal, probably du to the firmware, so i decided to re-upgrade with the default factory firmware, the software, firmware, and guideline are available here. Be careful, the factory firmware set the baud rate to 9600bps, not 4800.
To ensure fast hot start, the batteries pin is connected directly to the li-ion batt, the receiver has valid time, position, almanac, and ephemeris data, enabling a rapid acquisition of satellite signals.The voltage should be kept between 2.0V~4.3V. So, its OK.
– Power Section
The power come from a BlackBerry batteries (1100mha in this case), a charge pump, DC/DC converter (LT1302) give 5v/600ma from the 3,7v batt, available in SOIC-8 package, it’s a very powerful converter and can start as low as 2v. Two LP2981 give two separate 3,3v power line for the GPS and Teensy.
– Charging the Batt
Power charging is assumed via a LTC4054-4.2 a standalone Li-Ion Battery Charger with Thermal Regulation in ThinSOT package, the charging current is set with a simple resistor, i found 1,5k good value for around 1h30 of charge, the charge control is drive thought a N Channel MOSFET (2n7002) the signal come from the Teensy, just plug the USB cable and push the button to turn the PIN 17 High. Another option, is play with a “usb_configured” variable inside Teensy’s USB code which indicates if the PC has configured the USB device. Accessing that variable is the best way to know if a PC is connected to Teensy. But its not implemented yet.
Original code come from Adafruit, and it run on Teensy with some majors modification.
I have removed unused libraries like avr/sleep.h, and GPSconfig.h header, the SoftwareSerial.h, NewSoftSerial.h libraries was replaced by <AltSoftSerial.h> for better performance. More informations are available in the commented sketch.
Loading the code
- First, download and install Teensyduino software and libraries, complete instruction are here.
- Download and unpack AltSoftSerial Library to /libraries directories.
- Run Arduino 1.0 and load the code.
- Select Teensy 2.0 in the tool menu.
- Select USB Type Disk SD Card + Keyboard
- Finnaly, select CPU Speed to 8Mhz
A “N Channel MOSFET” (2n7002) is connected to the Enable pin of GPS, in case of you need to drive the GPS. In normal operation keep Enable Pin floated or connected to Vcc.
Power saving method
Since is a embedded project, for better batteries life, we need to run with a maximum save of power, some good way:
– Run Teensy and GPS with 3,3v power supply.
– Lowering the clock speed at 8Mhz.
– Write GPS data only every 10 seconds, in hiking we no need very accuracy in fact.
– The data is stored only when the GPS give valid fix.
– Disabling the “Analog to Digital Converter”.
With this power measure, we can switch from 27.3 mA power consumption to only 10.6 mA
The total power of TeenLogger is around 45ma with GPS satellite tracking, and give around 15/17 hours of complete logging.