Saturday, 13 August 2016

PaPiRus GPS

Low Power GPS Tracker


PaPiRus e-ink screen is an interesting display for the Raspberry Pi. I thought it would be a good idea to start putting the screen to work and try out something I could take out and use. 

GPS has saved me when footpaths disappear in the middle of nowhere. A dedicated device to help locate me and also track where I've been seemed like a good project idea. This current instance is fairly basic but the plan is to steal a few ideas from fitness and tracking apps and reuse here.

Specification

Portable, low power, battery supplied, GPS device with the ability to view where I am on the OSGB36 grid and run for at least 3 hours.
In detail:
  • 3 hours running time
  • Log my journey and provide a view of the data
  • Start/stop the logging
  • Provide
    • Distance
    • Split time per mile 
    • Where I am on the OSGB36 grid and WGS84
Secondary goals
  • Min/max altitude
  • Climb rates split per mile
  • Visible mapping of journey

What's gone into the build?

A PaPiRus screen has been included to provide a low power display solution. The build uses the full sized PaPiRus and it works fine attached to a Pi Zero. 
The Pi Zero was used because, it's cheap, small and should also help keep the power usage low. The Zero's ability to work as a gadget over USB is awesome for a device in a box. Network gadget feature is used so the software can be maintained easily and web services provided. 
The cheaper GP-20U7 module has been selected from Proto-Pic for use in this build. The JST connector was cut off and a jumper connector added to work with a custom strip board.
A Sparkfun LiPo charger and power booster has been included to provide power using either 400, 500 or 1000mAh LiPos. The aim is to use the 1000mAh to get the longest life. An evolution of the design included power management and this is handled by a Sparkfun Fuel Gauge.

The luxury items here are the push buttons. These are from Sparkfun and come with illuminated LED rings. 
A custom strip board has been used to add in headers to connect up buttons, I2C and the GPS. A couple of NPN transistors are on the board to switch 5v to illuminate the button LEDs. 
To provide some connectivity to the outside world a female USB breakout board from Sparkfun has also been used with a stripped down micro USB cable to provide power and data.

All of these components are housed in a 41x77x101 ABS. It's a fairly snug fit for the PaPiRus, Zero and strip board. 

After some drilling and cutting, all the components fit in neatly. Liberal use of electrical tape provides some protection from components touching and sending 5/3.3v the wrong way.

Getting it running

By default the PaPiRus display uses the UART pins, but there's a build option for the PaPiRus to exclude these and change the required GPIO pins used by the display. UART pins are used by the GPS module so excluding them was necessary. This was tested before assembly of the components by carefully running jumper pins to the PaPiRus. Unfortunately there was one issue which only revealed itself on assembly which was down to the RXD line. When GPS data is actually going to the RXD the PaPiRus display wouldn't work. 
Header surgery on the Pi Zero

The only option at this stage was to snip the GPIO pin going to the display. In hindsight this could have managed this on the strip board layer by designing it to sit between the Zero and the PaPiRus. I wouldn't have been happy to do this to my Pi 2 or 3, but this isn't a concern with the Zero as there are no plans to reuse it on another project.

Controls

The 2 buttons provide basic control. The green button provides a way to change the display and when held it will shutdown the Pi Zero. The white button provides a way to enable the GPS tracking by holding the button and also control what's displayed on the screen with a brief press. 
A top switch was fitted later into the build as a way to pull the EN line low on the LiPo booster and charger to reduce the power consumption. This doesn't entirely stop the battery from draining due to a quiescent current and a pull up resistor on the EN line. The switch also disconnects the LiPo Fuel Gauge to prevent any charge being lost through the MAX17043

View of final assembly


Video

This is a basic demonstration to show the GPS and how the e-ink screen looks presenting the data

Thoughts

My initial wiring of the strip board included a connection to the SCL pin to wake from halt. Whilst this worked to wake up the Raspberry Pi this wasn't a very logical mix with another GPIO input pin and caused false pin state changes and interrupted the SCL when pressed. The connection was removed after implementing the power switch and provided another way to start up after halting.

A micro USB wire was stripped adding female jumper connectors to break out the power and data lines. Since this was a 4 wire USB cable it didn't come with an ID line. A 5 wire cable would allow this to be connected and an OTG connection supported. OTG would allow a WiFi dongle and connection to a hub to support more devices and charging. 4 wire is fine and the network gadget functionality provides charge and connectivity.

The ability to completely turn off power would be useful. Putting the switch in-between the LiPo and charger would allow complete isolation and prevent slow battery drain. The 1000mAh battery seems to drop by 8% a day at the moment, but this hasn't been measured properly. 

No comments:

Post a Comment