I’ve finished laying out the base station PCB, hurrah!
As ever I’ve laid it out using Eagle – this time I’ve managed to keep it to two layers so that’ll save me some money in PCB manufacture costs. Click it to enlarge.
Now that the CatTrack collar is working, I’ve been designing the schematic for the base station. The base station is the handheld unit I’m going to use to communicate with the collar to work out where the cat is. Currently I’m using a CC1125 development board. More about that here.
The idea is that the base station will mostly live at home, perhaps in my loft (to get decent range) and I’ll be able to communicate with it from my living room via Bluetooth from my laptop. It should also be portable because if Buttons goes miles I want to be able to take the base station out and about to track him remotely.
Now that I’ve got CatTrack working, I’ve been having a look at refining the code. As I previously mentioned, I am using the CCS C compiler, basically because the ‘paid for’ version of their compiler is significantly cheaper than Microchip’s XC8 ‘paid-for’ version. I did begin to wonder though, just how much bigger would my code be, and how much slower would it run if I used the free version of Microchip’s XC8 compiler?
This is what the Memory usage currently looks like in the PIC16LF18345, compiled with CCS C:
Unsatisfied with the GPS trackers available on the market, I decided to design my own. This site follows my component-level design and build of an ultra-low-power wireless cat tracker.
A few years ago we got some cats – Buttons and Turnip! Buttons is the big tabby cat and that’s Turnip, below.
I would imagine that every cat-owning Engineer has at one point or another wondered about either buying or making a tracker for their cat so they can see what he or she gets up to after they jump over the garden wall.
Turnip isn’t like most cats. There’s no need to make or buy a tracker for her because she hasn’t left the garden in 3 years. Well, she did end up in next door’s garden once, but I got the impression from the noises she was making that it was incompetence that caused her to end up there, rather than a desire to be more than 10 feet away from her bed.
Buttons however, would benefit from a tracker. Although he doesn’t disappear for days at a time like some cats, he is often nowhere to be seen, only to turn up a few hours later covered in cobwebs or some other kind of grime.
As you can read in my About Me page, I’ve got a fair bit of experience with electronic design. It’s been my job for the last 10 years. None of the cat trackers on the market fitted my needs (as I’ll explain in a separate post) so I decided to design and build one that’s much better than anything you can buy! (hopefully…)
I’ll be doing a component-level design, from schematics, through PCB design and ultimately casing it all up in a case appropriate for Buttons to carry around with him. I’m sure there will be second revision too, to mop up all my cock-ups from the first revision!
This blog is partly a way to force myself to finish the project. I wouldn’t want the 3 people reading this to be disappointed would I!
The time has finally arrived, let’s test CatTrack on Buttons.
It doesn’t seem to bother him anyway!
The PCBs have arrived from OSH Park! As expected, they look good and the quality is excellent. As an added bonus, they even fit in the case I designed them for. Result!
Over the last couple of weeks I have also been ordering all the components from a combination of Farnell and tme. Everything’s arrived and it’s all ready to solder into place. I’ve also got the firmware into a state such that something should work too.
Now it’s time to get soldering!
Whilst I wait for the PCB to arrive I can crack on with writing the code that’s going to run on the PIC. I’ll write it in C (not assembler…!), using the MPLAB X IDE and the CCS C compiler. I much prefer the old MPLAB 8 IDE, but Microchip has stopped supporting new devices in version 8, so I’m left with no choice but to use MPLAB X. It’s all very pretty and I’m sure I’ll get used to it…soon.
I’ve chosen to use the CCS C compiler over Microchip’s C compiler basically because of cost. Although Microchip have a free version of their XC compiler, all of the optimisations are disabled. This results in terribly compiled code which takes up much more space than it needs to. Not ideal for a small embedded device with limited storage like I am using!
Before designing the PCB I need to decide on an enclosure to use. Ideally I need something plastic, with flanges such that it can be attached easily to a cat’s collar. Clearly size will be a big factor – I want something small, but not so small that the chip antenna is ineffective, or that it’s a nightmare to lay out and fit everything in.
I’ve finally finished the CatTrack schematic, hurrah!
Click it to enlarge.
As a reminder, my plan is for the collar to work thus:
I was a little premature with my previous post. I can’t quite draw the schematic diagram yet – I need to work out the antenna!
Texas Instruments have produced an excellent guide, examining a number of different types of antenna for embedded applications. The table below summarises the pros and cons of a number of different antenna solutions and is taken from that guide.