greeeg

GPS logger for a local Beagle club

51 posts in this topic

I know I haven't finished off my desk clock project just yet, But I've been requested to design a new GPS logging device for my sisters Beagle Club,

 

The basic idea is that a sent is placed with a guy that forms a path, the GPS logger is taken along also.

They then attach the device to a beagle (using some kind of vest, I think). And let them follow the scent. 

 

Post event they extract the GPS data from the logger and overlay both tracks in google earth.

 

 

 

They have one unit that has been working well for them, developed by a previous club member.

It consists of off the shelf components from Sparkfun. With a total BOM just over $150

All of these are connected together and fit into an off the shelf jiffy box.

post-274-0-13250400-1451891730_thumb.jpg

 

 

They would like 5 more made, which would perform identical/similar function

 

Design goals:

  • Lower cost (< $50AUD per unit, making 5 units)
  • Externally operates identically to the old version
    • USB MSC
    • Logs start when unit powered on via toggle switch
    • new log created when button pressed
    • All additional tools stored on SD card (GPS utilities, past logs)
  • Long battery life, unit should operate for > 10Hours
  • Physically the same size or smaller
  • (if time allows, a simple PC tool to to reset the device into DFU mode, and update the firmware)

I'm planning to source a more slimline case. once I have that I will begin PCB design.

 

 

I have drawn some quick System level schematics

 

The hardware is pretty straight forward

post-274-0-89001400-1451891899_thumb.png

 

Same with the software, I have already played with the MSP430 USB MSC examples, and am familiar with FATFS. I should be able to glue in some UART code to get it all to work.

The device will operate under two modes depending on if it's connected to USB or not.

post-274-0-90803300-1451891893_thumb.png

 

 

Hopefully someone will find this mildly interesting as I work through it.

chicken, pine and Fmilburn like this

Share this post


Link to post
Share on other sites

It's weird how I am drawn to your diagrams.

 

What program did you use to make them?

Share this post


Link to post
Share on other sites

I intend to finish this project in a usable state. So I've got to pick an enclosure right off the bat. There are a few options, all with their pros and cons.

 

Option 1

OKW minitec series. (https://www.okw.com.au/en/Plastic-enclosures/Minitec.htm)

post-274-0-90608000-1451952763_thumb.jpg

 

3d Mockups

post-274-0-01672400-1451952792_thumb.jpg

post-274-0-35399500-1451952810_thumb.jpg

 

Pros

  • Slimline
  • Simple 2 part design
  • Nice looking

Cons

  • Expensive (>$10)
  • Curved design makes cutouts difficult.

Verdict, Probably Too difficult to machine the cutouts myself, would add significant cost.

 

Option 1a

Minitec Teardrop series

 

post-274-0-79912600-1451954202_thumb.jpg

post-274-0-43470100-1451954241_thumb.jpg

 

Pros:

  • Has a flat surface, should be easy to mill cutouts
  • Slimline

Cons:

  • Expensive (>$10)
  • Battery is a tight fit

 

Option 2

Hammond 1593K (http://www.hammondmfg.com/1593ptbl.htm)

 

3d Mockups

post-274-0-57003500-1451953081_thumb.jpg

post-274-0-68604300-1451953121_thumb.jpg

 

Pros

  • Cheap (<$5)
  • Flat removable ends make cutouts very easy!
  • Still slightly Smaller than original design (~10% less volume)

Cons

  • Still looks like a boring project box
  • Very square
  • lots of free space within the enclosure

Verdict, A good contender. Probably my first choice for easy of use

 

Option 2a

Hammond 1551 Series

 

post-274-0-18442900-1451954086_thumb.jpg

 

Pros:

  • Compact
  • Cheap (<$5)
  • Thin (15 or 20mm only)

Cons

  • Too thin?
  • No removable panels for cutouts

Verdict, The rendering shows the 1551H (60 x 35 x 20)[mm] This may be alittle small, The largest size in this series is the 1551K Which is (80 x 40 x 20)[mm]  Which sounds bigger, but is still less 2d area than a credit card.

 

They also have flanged versions available

post-274-0-88055700-1451954905_thumb.jpg

 

 

Currently I'm swaying between Option 2 and 2a. Given that option 2 is is still a smaller case than their current design I think this will be the way to go. There is also enough room inside to accommodate for a larger battery if required.

bluehash likes this

Share this post


Link to post
Share on other sites

@@zeke Microsoft Visio, it's part of Micorosoft Office (But you can buy it individually). I've actually never used it before, but I got given a license from my university. Figured I'd try it out.

 

It's more user friendly than the online based diagram tools I've used in the past.

 

http://visio.microsoft.com/

Share this post


Link to post
Share on other sites

An interesting project. I must admit I assumed from the title that you'd be using a Beaglebone.

 

Why would the curved surface cause such a problem with milling? The USB cutout is parallel to a flat surface so should be OK to cut. Just ignore the curve. The edge of the connector would protrude a bit though. How would you be doing it?

Share this post


Link to post
Share on other sites

@Fred, this is What I was thinking.

post-274-0-62048600-1452121653_thumb.jpg

 

This cutout could extend downwards but then the part would need to be mounted on the curved side. and you would be cutting out a very unsupported thin wall. I doubt this is achievable on my small mill.

 

The cutout could extend upwards, so the part can be mounted flat against the mill's table. I think this is what you're suggesting like so

post-274-0-45560800-1452121972_thumb.jpg

 

Which is a good compromise. I need to source the toggle switch and pushbutton, and see if those can be incorporated in similar ways.

 

 

Good point about the project name, I actually didn't realize that at the time. @bluehash, feel free to change the topic name if you want to remove the confusion.

Share this post


Link to post
Share on other sites

I was thinking of the first one. Maybe fix the case to a square wooden block and clamp that to the table so the case is held securely in an upright position. Obviously this friends on your mill - particularly the Z height. The second option doesn't look too bad either.

 

Of course there is the old school way of doing it by hand with a file. If you're only making 5 that might be worth considering. A shame not to make full use of your toys though!

Share this post


Link to post
Share on other sites

Did you consider just using an old (or new prepaid) cell phone?

At least in the US one can get no contract prepaid android cell phones for 5 to 15 USD.  (on sale, but they are on sale routinely)

Gives you battery, GPS, flash storage, some have uSD.

Don't know if you could find one as small as your previous unit (I didn't see dimensions listed).

 

Of course programming it would be a pain (unless you could use one of the existing hike logging apps).

Weatherproofing might also be an issue, as might weight.

 

(Might also give you other things to play with if you wanted - like compass, accelerometer, WIFI)

 

Just a thought.

Share this post


Link to post
Share on other sites

I was thinking of the first one. Maybe fix the case to a square wooden block and clamp that to the table so the case is held securely in an upright position. Obviously this friends on your mill - particularly the Z height. The second option doesn't look too bad either.

 

Of course there is the old school way of doing it by hand with a file. If you're only making 5 that might be worth considering. A shame not to make full use of your toys though!

Z height should be OK, only have 50mm of travel. But that can be offset, by manual moving the spindle in it's holder. It's just one of these elcheapo Chinese CNC mills. (with a spindle upgrade)

 

Did you consider just using an old (or new prepaid) cell phone?

Just a thought.

I honestly, didn't consider it.

 

Atleast here in Australia, cheap phones generally lack GPS. You need to get into the $50+ range to get that feature. Of course there are specials sometimes.

 

I think the biggest thing would be altering their workflow. A phone (especially cheap ones) might take a minute or two just to boot. Then they'd have to open the app. and I'm sure it's possible, but I've had limited experience programming on android, not sure how well things run when the screen is off.

 

Of course it might actually be a viable solution, but I'm a micro controller guy. Stick to what you know right? :P

Share this post


Link to post
Share on other sites

This project now has a github page. (barely)

 

Got TI's example firmware to a surprisingly functional state.

 

The GPS implementation is very basic, serial data comes in via Interrupt. data is stored in a buffer, if buffer is full buffer switches to second buffer, notifies main loop.

main loop upon getting notification write buffer into file on SD card.

 

I'm using TI's MSC example. which already has USB event functions that are used to start/stop this File writing when USB is connected/disconnected.

 

https://github.com/Greeeg/gpsLogger

 

Still alot to do, would like a basic text_file config system. (logging frequency). Currently logging does not start unless you connect it to PC then disconnect. Obviously this isn't ideal.

I'm currently logging onto a 4Gb card, since that's all I had lying around. Since I've updated the FatFS library it seems to all be okay.

 

Write/read speeds are laughable, 100kb/s and 280kb/s respectively. mostly due to the FullSpeed 12MB/s usb link.

Share this post


Link to post
Share on other sites

Some more parts arrived this week.

 

Batteries

post-274-0-58449800-1452842016_thumb.jpg

These are 650mAh round lipo cells. Bought from my local hobbyking, Super cheap, super high energy density. Because these are RC lipos, they lack any under voltage/overcurrent protection. Searching digikey for lipo protection didn't turn up anything particular cost effective, so I've got some generic protection PCBs these were about $0.30 each.

 

post-274-0-69311300-1452841999_thumb.jpg

I will either transplant the components onto my own PCB, or use them between the battery any my device as is.

 

Finally the GPS units.

post-274-0-52637300-1452842006_thumb.jpg

 

These are similar, if not the same, as the units used on the GPS launchpad. (Y)

Based around the MT3339 GPS chipset.

 

 

With a 650mAh I'm aiming for a power budget of about 60mA to reach my 10Hour battery life. With the MSP + GPS+ SD I think this is reasonable. From my bench tests the GPS does stick to it's 30mA while locking, and 20-25mA while tracking. the SD card is Around 10mA during writes. MSP430 is about 1-5mA. it's asleep most of the time.

 

 

Thinking about mounting options for everything. and how cutouts will work easiest for me. Mocked up some buttons on the top. These require seperate custom parts for the buttons and the holder part... but do look nice. I think I could probably 3d print them with little effort.

post-274-0-94066100-1452842822_thumb.gif

^^ This is a gif, click to see it animated ^^

Fmilburn and bluehash like this

Share this post


Link to post
Share on other sites

Did some more work today.

 

Wanted to check out the size of the buttons, so I printed half a profile to get a feel for button placement, I feel like I had designed these a bit too small.

post-274-0-44940700-1453024286_thumb.jpg

 

Took a closer look at the battery protection circuitry. unsoldered one and sanded it down to get good images of the copper. then worked the images in photoshop.

post-274-0-60581900-1453024308_thumb.jpg

post-274-0-17829100-1453024288_thumb.jpg

 

These have been added to the schematic/pcb so I don't have to have the board soldered inline.

Schematic has been done.

post-274-0-60789200-1453024727_thumb.png

 

PCB is routed too, and here it is in it's natural environment.

post-274-0-59362000-1453024077_thumb.jpg

post-274-0-32171600-1453024139_thumb.jpg

 

(Kicad 3d export is still kind of dodgy, components changing colour etc :/ )

 

Surprising how complicated a design can become, from such a simple idea.

Off to the fab tomorrow.

chicken, phenyl, yosh and 1 other like this

Share this post


Link to post
Share on other sites

Components and PCBs have arrived.

 

Ofcourse I needed to assembled one to check it was all working.

post-274-0-95490300-1454398111_thumb.jpg

 

A few bodge wires to allow it to operate without the battery for now.

post-274-0-42813900-1454398143_thumb.jpg

 

Cutout fits the battery nicely

post-274-0-18164000-1454398178_thumb.jpg

 

It does all seem to work, I now need to work on the code to support the new LEDs and button, and to add a low power mode so I can connect the battery without the fear of it discharging completely.

yosh and bluehash like this

Share this post


Link to post
Share on other sites

@@greeeg Nice! I'm curious about your first tests ...had some problems in the past to get a quick first fix with these GPS modules. I think we discussed this problem somewhere here some time ago ...

Share this post


Link to post
Share on other sites

@@greeeg Nice! I'm curious about your first tests ...had some problems in the past to get a quick first fix with these GPS modules. I think we discussed this problem somewhere here some time ago ...

I'm yet to code up the GPS stuff just yet, need to alter my test code to ensure I can actually enter a low power mode and shut off the SD/GPS stuff.

But yes, unaided GPS will take 30-60 seconds to get a fix. These units are to be used outside so the reception should always be pretty good.

 

That being said, my tests so far have been to "half" solder up one unit, and test the USB / MSC / SD side of things. I forgot to order the High side mosfet switches, so currently everything is always powered on.

 

Cool! I like that vise. I'll be adding it to my wishlist.

 

I bought it with a smoothie board from the hackaday store. Highly recommend, I use it every time I'm soldering electronics.

Share this post


Link to post
Share on other sites

 

But yes, unaided GPS will take 30-60 seconds to get a fix. These units are to be used outside so the reception should always be pretty good.

 

Found the POST ... using sleep() was the solution there ... @"B@tto" and me had difficulties to get a good first fix ... maybe because of pcb design errors. But that's only a side note ... ;)

greeeg likes this

Share this post


Link to post
Share on other sites

The basic idea is that a sent is placed with a guy that forms a path, the GPS logger is taken along also.

They then attach the device to a beagle (using some kind of vest, I think). And let them follow the scent. 

 

 

That's a funny thing to do!  :)  :D 

 

Awesome project as usual @@greeeg

Share this post


Link to post
Share on other sites

Found the POST ... using sleep() was the solution there ... @"B@tto" and me had difficulties to get a good first fix ... maybe because of pcb design errors. But that's only a side note ... ;)

I have actually heard about this while researching. I suspect that the GPS units are very susceptible to noise on the power rail. hence why physically separating it helps.

 

my design powers the GPS unit direct from the battery rather than the local LDO. So hopefully any switching noise form the Micro is constrained to the LDO rail and wont leak back.

 

 

 

I've worked on the code, updated the state machine that handles everything. It's all working on my bench, I'm yet to test the fix time.

 

Current draw while "sleeping" is 700uA (only LPM3, I think I can knock off the timer I'm running to use LPM4), This figure will result in a battery draining within a month if left idle. Ideally I'd want atleast a year, if not better. (the battery protection circuity will cut the battery out if it gets to 3v. then the user would have to recharge the device.)

 

I'm seeing about 25mA to 40mA (for milliseconds during SD writes) for logging the average sits around 25mA. Taking worst case and a trivial calculation, we can expect upto 16 Hours. Not bad.

 

 

Finally, I've been using these 8Gb patriot SD cards. My local computer store sells their 8gb for $5 each, and it's the smallest size the stock. The hardware seems to support it, although it might not read over 4Gb( 32 bit address space ) but windows was taking forever to recognize the Mass storage device through the MSP430. Around 8-20 Seconds after the initial device connected sound. (I suspect windows tries to do some 'quick' scan, but the MSP USB interface is pretty slow.)

post-274-0-52281200-1454690033_thumb.jpg

I've since partitioned the 8gb card into a 1gb partition using windows diskpart. This is actually working great. Hopefully 1Gb is large enough.. results in around 2 months of continuous loging.

Share this post


Link to post
Share on other sites

Everything seems to run fine!

 

No issues getting an initial fix, although because it's battery powered the MCU is always sleeping, and the code is interrupt driven.

post-274-0-99227800-1454814811_thumb.jpg

 

Needed one badge wire, for the MSP to detect battery charging status.

post-274-0-44353400-1454814820_thumb.jpg

 

Still no word from the local sale rep from OKW, He said it would be no problem getting 6 units, I'll get onto him this week.

For now I'm still stuck with some 3d printed cases, that I can't use outside of development purposes. All the cutouts seem to align though. still need to add light pipes for the status LEDs

post-274-0-86763400-1454814909_thumb.jpg

 

 

You may have noticied my resonator lost it's metal can, that was due to the fact that my 3d printed case had support material I did not remove. It must have been pushing against the side of the can.

post-274-0-70228100-1454814918_thumb.jpg

 

 

Still a few areas to work on, Sleep current is still too high, battery voltage is still not being monitored to turn off the device if the battery is too low. I also need to ensure that my battery protection circuity will actually disconnect the battery if it falls below 3v to prevent under discharge.

 

 

 

 

Share this post


Link to post
Share on other sites

Here is some information about how I'm doing my current measurement, and the results I'm currently getting.

 

I'm using my uCurrent with my Agilent U1271A (these currents are all in the mA range currently, so the uCurent isn't strictly necessary.)

I am measuring the current between the battery and my device, this will give the best battery life predictions.

 

The device currently has 3 modes of operation:

 

Sleep mode, Lowest power mode. This current should be lower, I think I'm getting some leakage through my high side switches. I'm going to instigate further.

post-274-0-42639100-1454816132_thumb.jpg

700uA is still good, but will discharge a fully charged battery in 2 months, not good.

 

Logging mode, GPS active, SD active. (I might be able to save a few mA's by powering the SD on and off. but it's negligible. the GPS takes the most power)

post-274-0-61913400-1454816140_thumb.jpg

This is an average reading, the GPS is typically 20mA, and then for SD writes it jumps to 30mA. I will get this hooked upto my scope once I've dealt with the bigger issues.

 

USB MSD mode, SD active, battery charging (note, reverse in sign) Charge rate is set to 100mA currently. I think I will up this to 300mA for a two hour complete charge.

post-274-0-92037800-1454816144_thumb.jpg

 

 

 

Share this post


Link to post
Share on other sites

Sleep current has been reduced down from 700uA to 2.5uA by changing some pins form pullup to pulldown when I disable the high side switches for the SD/GPS units.

The 0.7mA was due to leakage current through their internal ESD/anti latchup diodes.

 

2uA is still high, the datasheet specs a LPM4 of >1uA. I might need to disable some modules or lower the core voltage. Maybe disable SVS?

 

 

In more exciting news

finally received some enclosures. This is basically what my local sales rep had on hand.

post-274-0-96353500-1455235206_thumb.jpg

post-274-0-67010500-1455235211_thumb.jpg

 

Fit like a glove.

 

Now I just need to get these into my cnc to do the cutouts.

Share this post


Link to post
Share on other sites

Ran the enclosures through my Mill, made a little jig to aid in positioning.

post-274-0-64239000-1455625291_thumb.jpg

post-274-0-69573200-1455625297_thumb.jpg

 

There are a few issues left to sort out.

  1. PCB is not retained downward in the enclosure, when removing USB the PCB lifts upwards.
  2. LEDs leak light between their corresponding holes in the enclosure
  3. Button needs a mechanism to reach up through the case.

I plan to solve these issues by creating 2 custom parts.

Part A:

  • This part will wedge between the PCB and top of the enclosure.
  • Have holes over the LEDs to create light pipes out of the enclosure.
  • A channel around the button to house a switch cap, part B.

Part B:

  • Switch cap, poke through the cutout in the enclosure

 

I decided to use my CNC to make molds to form the parts out of polyurethane. Straight from the CNC. You can see the switch part took a few attempts to get the tolerance right.

post-274-0-28491500-1455626582_thumb.jpg

 

Fitted

post-274-0-44513500-1455626605_thumb.jpg

post-274-0-86517400-1455626610_thumb.jpg

 

Button fits perfectly flush with the case to avoid accidental presses.

post-274-0-51788900-1455626616_thumb.jpg

post-274-0-27112000-1455626622_thumb.jpg

post-274-0-58045700-1455626627_thumb.jpg

 

 

Fmilburn, phenyl, Fred and 5 others like this

Share this post


Link to post
Share on other sites

Amazing stuff greeeg, is this hobby or profession, having a 3d printer, cnc etc.?

 

The 30V high side switches I use also leak up to 1 uA so if you have a few of them, for the battery voltage measurement and other chips/systems then this adds up. My battery powered system (9-30V) uses ~3 uA in LPM3 and setting all pins correctly high or low was key to that. Were you able to save significantly more by disabling internal functions?

 

Regarding the uCurrent I wonder: will your device still be able to use (say) 100mA when you set it to the uA range? With a normal DMM the voltage drop over the sense-resistor gets too high when the mcu gets out of LPM3 and switches on auxiliary circuits to do useful things so the MSP resets (or at power up)...

Share this post


Link to post
Share on other sites

@@LIJsselstein The equipment is all mine and used as a hobby. I like learning new skills.
 
I bought the CNC after reading Guerrilla guide to CNC machining, mold making, and resin casting I wanted to try it for myself.
I'm always impressed with the results, but it does take longer to setup than say a 3d printer.

 

Yes, the leakage could be from anywhere. I tested some boards before fitting the GPS/SD card and they measure the same 2uA. So I think it's all down to the MSP430 and passives now. I've heard some ceramic caps can have leakage into the 10-100nA range.

 

Yes I've found that too, I have a serial line connecting to the GPS high after powering the GPS off. This caused quite a high current drain. (500uA)

I'm entering LPM4 when the unit is off, (a pin interrupt wakes the unit). So I'm imagining most of the internal function are automatically disabled when the clock is stopped.

 

My voltage divider for voltage measurement is switchable too, so that should not be contributing.

 

 

Regards to the uCurrent Well the sense resistors are as follows,

  • mA 10m Ohm
  • uA 10 Ohm
  • nA 10k Ohm

So 100mA is quite high, a huge jump from 1-2uA.

But you can just apply ohms law to determine the voltage drop.

 

V = I * R

 

V = 0.1 * 10 = 1Volt.

 

This is quite significant. Personally this unit only reaches about 20mA so 0.2V drop isn't a huge burden.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now