T3 Rise of the machines
After the success of “Tracker Two” I decided, as I mentioned at the end of that previous write up, that it was time to see if I could build my own custom hardware. How hard could it be? 🤷
Evolution
Version 0
For version zero of the tracker I tried using off the shelf ‘personal tracking’ devices, this proved that it was possible to build my own tracking site. Initially I thought I really didn’t want to spend any time trying to build my own device, but inevitably concluded that was the solution.
Version 1
The first incarnation of the custom tracker was the klutzy A9G based system- well it wasn’t klutzy at first, but after several iterations and enhancements it ended up that way. The A9G was incredibly cheap and worked reasonably well, but the module has some major design flaws and it can’t do bluetooth (hence the klutzing).
Version 2
The second version switched to using the RAK5010 based board, again it started elegant and ended up with multiple improvements. This definitely showed the type of hardware I wanted to use, this was an excellent combination of superb mobile/GPS device - the BG96, with a really good processor module - the NRF52840. Initially I decided I definitely didn’t want to build something like this myself…. but inevitably…
So the plan now was to design and build a custom board incorporating all the improvements and ideas that I’d had working with the v2 design, since I’ve been impressed and happy with the RAK hardware with its use of the BG96 combined mobile and GPS module, my design is basically equivalent, although I’m using a Holyiot 18010 module for the processor to save the bother of having to build the Bluetooth and clock connections. The main improvements are to build in a decent battery monitor (MAX17048), better charger and power converters to provide 3.3v I/O and I2C interfaces. Plus other minor basic improvements such as add ‘a power switch’, better I/O ports, programming socket and so on.This is pretty much the most complex project design and build I’ve done so far, my first proper surface mount project built onto a four layer circuit board that includes both large LGA chip modules (100+ pins) and absolutely ‘tiny’ LGA modules - 2.5mm x 1mm with 10 pads, spaced 0.15mm apart. Also the layout needs careful attention for the antenna traces and data lines.
Surface mounting
The first hurdle and “initial pre-project project” was learning how to make surface mount boards, I’d managed to avoid them all my life and only ever used through hole components before, so project #1 was constructing a home make SMD hotpate.
I hashed together an initial working device from an old power supply, raspberry PI and “bits”
It worked and I used it to desolder some boards to test out the idea, concept, setup and so on and work out what I wanted in a finished setup, the first decision was a raspberry pi is definitely not the appropriate controller. So it was time to progress to a decent “compact” all in one setup, preferably with a micro-controller to be “turn-key”.After a few different designs, heating plates and cases… I settled on an Arduino micro driven device with a home-made mica heater platform:
The final build was a nice compact, self-contained unit. At the moment the fan hangs off the back so that could do with being moved to underneath the plate, but it does the job.
Ignore the dog-clip, that was a temporary necessity!The first test run building some small CO2 sensors (another project to write up sometime) was a great success, although the software running the heater ended up being really primitive, it would be nice to spend some time to make it a bit slicker and smarter.
There’s a “heat profile” to follow for different solders and devices, but I ended up just working out the heating times and just hardcoding a routine to adjust the heater for set periods of time.
KiCad designing
After several weeks of designing and planning, and learning KiCad the PCB design software. I had a good design and sent off for a board to be made. I designed a four layer board, although with components only on one side to make it easier (actually manageable) to solder.(quick aside - it’s just incredible what technology is available to hobbyists now!)
Redesign
A great first success! In the meantime I’d re-read the hardware design notes and decided I wasn’t happy with the routing and shielding I’d done for the data lines. Also I’d discovered that JLCPCB can provide a feature called “vias in pads”, I’d found all the vias (the links between layers of the board) I’d had to add to use to interface to the BG96 resulted in a very messy circuit and made routing harder so I decided I’d do a redesign before building with my new-found expertise with KiCad - the circuit design program.
First build
Unfortunately I ended up with a couple of tiny errors in the design, but I could work around these for the time being.
Debugging
Seeing it finally built was really exciting, I had a remote hope that it would work, but I’ve done enough stuff like this to know there were bound to be issues. There were issues. Promisingly the BG96 did appear as a USB device, so something was working, but it was unresponsive to programming….
Many hours, over a few nights, trying to work out what was going wrong and I finally managed to get a firmware built onto it, but I was having trouble talking to the I2C devices (the max was reporting 0% and 0mv battery and attempts to use the screen resulted in garbage) also it was extremely temperamental and once power-cycled wouldn’t allow programming again. There were many iterations of build trying to work out what was wrong but there seemed to be a major issue with something, I tested the power lines and all seemed well, oddly the BG96 did appear as a USB device a few times. I switched several programming devices, rebuilt my programmer, finally I decided to unsolder the bg96 and once I decided to desolder it I could program again, re-soldered back and it didn’t work, desoldered and I managed to break the BG96 this time 🙁 but at least I could use the board.
Without the useful, and kind of important bit (GPS and modem!) I instead tried to debug the screen and battery issue…. I wondered if there was a clock issue, tested and reworked all the timing code, I wondered if the display was broken so desoldered that and put it on an Arduino. it worked…. again after many hours and iterations rewriting all the display code, realised that the one I’d picked up to use was an SH1106… the one I had in “Tracker 2” and all the code was written for was an SSD1306. They’re almost identical. They look identical, but there’s a tiny difference in the way to talk to them. Doh! So there was nothing wrong with the clock or power.
I got the display working then, reading the documentation for the MAX chip, figured out I’d got the power wiring wrong, so applied a patch to the board, and that “just worked”.
Oh fudge. So I cut the trace on the board, applied another patch wire, and now it seemed indeed to power up and worked reliably.
I tried re soldering the BG96, but it seemed that the multiple resolder cycles had killed it and I haven’t got another. But otherwise the board is working and I can program it, albeit missing the somewhat crucial GPS and GSM features that a tracker kind of needs.
Improvements and fixes
So. Time to design a board to fix the minor flaws and take time with the experience to make some improvements for the next version:
Many days later and I’m happy with the new design, in the end I decided to go back to curved traces which let me return to the more pleasing 50x60mm size! I’ve made lots of tiny improvements with this layout and ready to send off the designs for another board. I’ve also added lots of test-points.
Up and running
In the meantime while I wait for new boards, I decided to get a BG95 module to test the slightly broken ‘prototype’ build to see if there were any other issues or areas to improve…. After a bit of hassle (some components were damaged during the repeated re-soldering to remove the BG96) I got a (cheaper) BG95 module soldered on, and spent some time fixing issues with the power-up signal (a transistor was dead) it powered up! Then the GPS didn’t work, but narrowed that down to the board design wasn’t big enough for the inductor I’d used so it hadn’t soldered correctly (another improvement to make)…
I’m absolutely delighted with this.
In the meantime, I’ve updated the PCB (again), and redesigned the charger circuit which I wasn’t happy about I also decided I’d add a temperature/humidity sensor back on the board just because.
Since this write-up is getting a little long the overview of the latest version is on a new page.
The other GPS posts: