The Micro:bit - GPS Logger Prototype
This module is rather unimaginably named the ‘Micro:bit GPS Logger Prototype’ as it never really worked well enough to warrant a proper, snappy name.
Unfortunately despite the module I selected communicating beautifully over i2c pretty much immediately, I failed to correctly account for the ground plane requirements for the GPS antenna to function, resulting in a great looking, but ultimately functionless module.
Its a power connector!
No, really, its not really all that interesting for this one; I included this to present battery backup power to the GPS module, even when the Micro:bit is in deep sleep or power-off modes, keeping the last set of satellite fixes in memory until they’re needed again.
I threw on some protection diodes as well, such that powering the board through the Micro:bit USB connector, the Micro:bit JST battery connector and using this connector, even all at once should be fine, without any power supply trying to back-feed power into a battery with all the potentially firey consequences that would have. The diodes introduce a little bit of a voltage drop, but as this was intended for something like a set of AA cells (or bigger) they would have the voltage overhead to not matter.
Micro-SD cards have a really handy SPI mode, and can be hooked directly into any 3v3 microcontroller that can support SPI. You still need some software capable of reading the filesystem on the card (or just treat it all as a giant EMMC and deal with such nonsense as ‘reading’ the data on a computer later), but electrically this is extremely simple.
The connector itself is a nice push-push type with a little bi-stable spring to eject the card. This allows the user to just press the card into the slot until a very satisfying click is heard, then simply press it again to have it pop pleasingly out far enough to comfortably grab. This plus a little milling out around the edge of the PCB to make grabbing the card easier finishes this off.
Unfortunately, as this function wasn’t the main focus of the work at the time, the software to drive the card remains incomplete, although there is every chance I’ll revisit this at a later time when I need larger long-term storage on a micro:bit… perhaps for long-term datalogging in hard-to-access places; such as being deployed in a forest for environmental monitoring duties.
In theory this should have been a great little module - its expensive, but is very capable, and can communicate over i2c, so no pin sacrifice would be required to use the module - we can just simply pass the i2c connections through from one Micro:bit connector to the other, and tap into them for communication to the GPS module. The Micro:bit even has the requisite pullups for i2c already on-board, so this board could skip the two extra resistors normally required.
Unfortunately, it would transpire the this particular module is particularly sensitive to the shape and placement of the module relative to the PCB groundplane.
I had accounted for the required cutout on the underside where the module is soldered to the PCB, but to function at all it seems that this little GPS needs to effectively use some of its carrier PCB groundplane as part of its own antenna. Not knowing this (As I’ve not used this particular module before, and missed it on the datasheet) I didn’t leave enough free space around the module for the antenna to function, so while we get some perfect NMEA strings back from it - the total number of satellite fixes never goes above zero, even in otherwise ideal conditions.
In hindsight, perhaps I should have also broken out the antenna trace to a u.FL connection, so that an external antenna could be used, but that would require planning! Perhaps someday I’ll revisit this module in this design, and do this, but for now its relegated to the archive while work progresses in other directions.
As part of developing this board, I also quickly threw together this little MakeCode extension,
pxt-mock-gps, which uses a preloaded set of coordinates and a timer to passively ‘wander around’ the Lancaster University campus over time, allowing my colleagues to experiment with code that used location data in their code sketches.