DIY GPS Logger,
Thanks mainly to Boardsurfr, with help from FormulaNova, and srtgumbee. I've finally got a logger to the testing phase. It's still very rough and ready, but working well.
With any luck, with a few more sails, we'll have enough data to get it approved.
My main objective is an accurate logger that will record at least 5hz data for 24hrs reliably.
On the way I've fallen into many pitfalls, mainly from buying cheap Chinese stuff. So the working model users the more expensive genuine parts.
So just in case anybody else wants to have a play, I'll try and detail where I've ended up. Approval won't be automatic, it'll need to be used with another unit that exports accuracy data, so the two can be compared.
Here's the list of what I've used and where I've bought it
--------------------------------
1 GPS UBLOX NEO-M8N HMC5983 GPS Module GYGPSV5-NEO For Pixhawk APM www.ebay.com.au/i/232265962742?ul_noapp=true
Sold by nyplatform (79637)99.6% positive Feedback
Approx. AU $40.46 + AU $19.23 postage
Note the GYPS5 is important, it means that it's the "5" version. Most of the cheap ones are the "3" version.
------------------------------------------------
2 This is the power source, it has internal battery management, that looks after charging and prevents overly discharging the battery. 2200mAh in theory should last about 40hrs, so a 1000mAh should be enough for almost every body, but I can't find one that is thinner than this, you may have better luck.
The url is huge I'm afraid, but I can't get anything smaller to work, make sure you copy all of it.
power bank. https://www.ebay.com.au/itm/2200mAh-Ultra-slim-Portable-Power-Bank-Battery-Charger/123151148106?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D2%26asc%3D20160908110712%26meid%3D776af61dd1c141bea99ba1b21efaf070%26pid%3D100677%26rk%3D7%26rkt%3D30%26sd%3D122538669476%26itm%3D123151148106&_trksid=p2385738.c100677.m4598
2200mah power bank from ebay. Was: AU $6.50 What does this price mean? You save: AU $0.58 (8% off) Price: AU $5.92
-------------------------------------------
3 This writes the data to a micro SD card, use a high speed card to make sure there's no gaps in your data. openlogger SparkFun OpenLog DEV-13712
core-electronics.com.au/search/?q=sparkfun%20openlog%20%09dev-13712
$20.38 AUD, inc GST + postage!
Shipping:
$6.95 Standard (2-4 days, tracked) $8.95 Express (Overnight*, tracked) $3 Economy Post* (3-7 days, no tracking) FREE Pickup (Newcastle only)
--------------------------------
From Jaycar
4 The box that holds the electronics, this one can just be squeezed in to a paqua midi. But it does need some modification, the internal uprights need to be removed to fit the battery in.
enclosure. CAT.NO: HB6005 Jiffy Box - Clear - 83 x 54 x 31mm.
Note I had to modify this to fit battery. $2.95
5 this is the board I've used to mount the components on
PCB CAT.NO: HP9556 Ultra mini experimenters board $4.95
6 On/Off switch switch CAT.NO: SS0834 A great addition for projects that need a small on-off switch. $1.50
7
This isn't part of my logger. But it needs to be temporarily connected to the Neo M8N, so that the GPS chip can be programmed.
Jaycar Serial to USB converter. Arduino Compatible USB to Serial Adaptor Module CAT.NO: XC4464 A mini-USB to 6-pin serial port module used to communicate with Arduino boards and modules. $19.95
Here's a very rough wiring diagram.
Not much to it, but it took me quite a while to get here!
Note the RX and TX connections have to be swapped.
But before this will work, the Neo M8N needs to be programed.
it needs to be changed from 9600baud to 115200baud. It also needs to be changed from the default NMEA data to the UBX NAV-PVT sentence.
Connect the serial to USB converter in place of the data logger, without the battery connected.
Download U-Center from the ublox site,
www.u-blox.com/en/evaluation-software-and-tools
Looks like there is only a windows version.
More on how to use U-center later, I need to boot into windows and do it myself, I don't trust my memory to get it right.
A potential alternative to buying the USB to serial converter (step 7) is to get a NEO-M8module that has USB and serial ports, like this one from Drotek: store-drotek.com/
This module can be programmed directly with a USB cable, and is definitely a genuine u-blox chip, not a Chinese fake. But there may be an issue with the chip adding NMEA sentences to the output, regardless of settings. This creates larger log files, and could possibly cause other logging problems (data loss from too much data). So I'm mentioning this chip more to discourage its use until the cause of the extra NMEA sentences is understood (this might be specific to using u-center, and therefore might not be an issue with Openlog).
U- CENTER
U-center is very comprehensive, it allows you configure the GPS chip, view all the incoming data, replay saved files, and show where you are on a map view.
I've only touched the surface of this program, so I'm a long way from being an expert, so I'm only going to show how to configure the GPS module.
with only the module connected to the serial to USB converter, (best to do this before you start putting the other stuff together). Plug into your computer and open U-center.
The most used button here is "view".
First thing to do is match baud rates between module and u-center, this should be 9600. when they match you'll get NMEA data in "packet view"
For some reason in this example the dongle I was using was on 57600, you can see this towards the right hand side of the second from bottom row, to the left of that is "COM5" and a funny little symbol that indicates a connection when it's closed and data transfer when it flashes green. To the left of that again you can see "u-blox 7" you should see "u-blox 8". On the left hand side at the top, you'll see that little symbol repeated, the down arrow next to it, lets you connect and disconnect, in this case to COM5. to the right of that is a square wave symbol that is the baud rate adjustment for the receiver. Once I'd set that to 57600, the above NMEA data started to scroll down the screen.
So now we can program the chip, go to PRT (ports) view.
So we see target is UART1 protocol in, I leave as is, I don't know exactly what is coming in?
Protocol out I change to ubx, and baud rate to 115200.
Then save to the module by hitting the send button bottom left.
That should stop the data in packet view, you then have to go back to the square wave symbol and change that to 115200.
Then go to CFG (configuration) and just hit the save button, this save to permanent memory.
Now we set up the NAV-PVT sentence.
go to MSG (messages view)
So in the top drop down box scroll to NAV PVT, tick the UART1 box On. Hit save again, then another trip to the CFG window, and again save.
Check the packet window, there should only be NAV PVT sentences coming in. If there's anything else, you need to go back to MSG and untick the "on" box for them, then the double save routine.
Just to make sure it's all properly saved you can disconnect with the funny little symbol, and unplug the GPS. plug in again a while later and see what you get.
A genuine U-Blox module should save these settings indefinitely, some copies will save for a day or so, and others not at all.
OPEN LOGGER
Next step is easy, programming the logger.
With a reasonably empty, (the blurb, says the more data on the card, the slower it will write to it) SD card in the logger, formatted for windows. At first power up, the openlogger writes a config.txt file, this is what's used to configure the logger.
It should look like this.
115200,26,3,0,1,1,0
You can write this to the card before you plug it into the logger, or edit it after the logger has created it. But the logger creates it with 9600, (this sets the baud rate) so it won't talk to the GPS module until you change it.
SOLDERING,
This probably should have been closer to the beginning, but never mind eh?
A very fine tip temperature controlled soldering iron is needed to avoid overheating, lifting tracks and "bridging" across connections, also fine self fluxing solder wire.
Modern micro electronics are very susceptible to static electricity. So precautions are necessary to prevent damage.
An earthed soldering iron, earthed work station and earthed wrist band, will fix this. I started off inside, with bare feet on the concrete floor, but this got me cold feet. So I stuck a metal spike into damp ground and ran a wire to my vice, used the vice to hold the PCB while I soldered, with a wrist band attached to the vice.
At first the other problem I had was the size of everything. Modern stuff has gotten very small, there's not much gap between connections and tracks. Didn't take me long to realise I just couldn't see well enough. So I bought a pair of cheap 3X specs from the chemist, then I could see exactly what was happening and made life a lot easier.
The trick to a good solder joint is heating the connection with the iron and applying the solder to the connection, this allows the flux to melt onto the connection first, so the solder can follow. If you apply the solder to the iron first, the flux will be gone before it gets to the connection, and you could end up with a "dry joint"
here's a couple of pics of the bits in varies stages.
Just cobbled together to see if it all works.Battery is under antenna
All together in box, holes cut for switch, SD card and charging access .
That reminds me. this NEO has long cables attached to it. I've cut lengths off them to wire it up, very handy, saves buying small amounts of hook up wire.
BATTERY and ENCLOSURE
These are the aspects I'm least happy with.
The enclosure is a tight fit in the paqua midi, I worry this may cause the paqua to fail where the corners press on the plastic.
The battery is overkill at a theoretical capacity of 40hrs, (I'll do a discharge test later and see what it really is), and is the reason the enclosure needs to be so thick. It also means both have to be modified.
There are internal side supports in the enclosure, to slide small pcb boards into. I've had to remove these by pairing them away with a sharp chisel. But the battery is still a fraction too wide, so I've also had to pair the rounded edge back to almost square.
Beware battery modification is potentially hazardous!!!!!!!!!!! be extremely careful about not going to deep or cutting the cable
Top up your devices with the powerbank to discharge it as much as possible, it switches itself off before it's fully discharged, so there's always a bit of juice between the terminals, for a short time.
There's a bulge where the cable comes out, I've completely removed that, and moved the opening for the cable around to the end so it doesn't stick out the side.
Also I've cut off the USB plug so I can hard wire it to the switch on the board. Only cut one conductor at a time, and cut them in different places, so the wires can't touch together.
So I'll be looking for an alternative battery and enclosure. There's plenty of smaller batteries around but it needs to be at least 800mAh in case I ever want to do a 14hr distance attempt in the future. But they aren't any thinner, so nothing is gained. Except it may not need modification.
Another alternative is a Li-Po battery with a management chip
USE.
That's basically simple, as there is no display, there's no indication of a full fix. A green light on the NEO flashes when it has found satellites, and a blue light flashes on the logger when it's saving data, so you know it's working. But it's a good idea to switch it on when you start rigging and leave with a clear sky view, just to make sure of a good fix.
When you down load from the card, the latest file will be in the format, #LOG.txt, where # is the highest number. You have to change the .txt to .ubx before GPSResults can process it.
At the moment KA72 doesn't work with .ubx files, but once there is enough of them I'm sure Dylan will fix that.
APPROVAL PROCESS
I've just been doing some number crunching from Wednesday's session. First thing is to do a chronological sort, so we know we're comparing the same run. If it's sorted by speed, it can look better than it is. The 18s difference is because one system uses satellite time the other UTC
The aim here is to check that the difference between the GW52 and the logger doesn't exceed the combined accuracy value. If it does there's something wrong!!!!!
So the 2n last right hand column shows the difference in speed between the GW52 and logger, where it looks a little high I've added the two accuracy columns together to check that the result is within the margins.
Most results are well within, the worst is a difference of 0.226knots with a combined +/- of .282knots.
If it gets any closer, I'll also check the watch data, to see if it's closer to the logger or GW52.
Hopefully more data to play with tomorrow.
GROUND PLANE
Thanks Peter, I should have posted my own config.txt file, I've set that very high, forget now, maybe 100 or so.
There's probably a lot of other stuff I've forgotten as well. Like the antenna ground plane.
The preliminary setup had a big ground plane, ( a piece of alfoil under the antenna), but after squeezing it all down to fit in the box, the ground plane ended up almost the same size as the antenna, so it's probably not making any difference.
I've forgotten my antenna theory, but the essence is, that the ground plane improves the antenna sensitivity, (I think).
Summary,
So I think I've covered most of the stuff related to my project, but there are lots of alternatives.
Boardsurfr's thread, "Hope for a GPS alternative" here
www.seabreeze.com.au/forums/Windsurfing/Gps/Hope-for-a-GPS-alternative?page=9
Explores a lot of ideas, and I've detailed my tortured path along the way.
The Beitian 220 (or 280 with compass) sounds promising, it's smaller and cheaper, so possibly not as accurate, but that has to be evaluated.
The bluetooth to a phone with gps software also has lots of advantages.
So if you are so inclined, enjoy having a go.
Time for Boardsurfr to say, "I told you so", the unit wouldn't stay on today after a full charge last night.
The warning was to be careful of Powerbanks, as they turn themselves off when the current gets too low. And they all have a different threshold. This one was going fine until I fully charged it last night. I suspect there's a bit less current out of the battery with a higher voltage.
If I'm correct a resistor across the 5v rail should solve the problem, I'll find out tomorrow.
My mental arithmetic says a 1k resistor adds 5mA, so I'll keep adding them in parallel until the unit stays on. My bet is that one will do.
Fingers crossed!!!!!
Thanks Formula, I'll try Jaycar tomorrow.
It looks like they don't have any with solder tags, can you solder to the nipple or do you need a holder?
OK good job I didn't take that bet with anybody!!!!!!!!!!!!
Something must have happened to the powerbank because it now needs 65mA to keep it on. When I first used it with the logger, it was working fine at 50mA. So I've had to use a 180 ohm resistor, nothing larger would keep it on. So now theory says, it should last 30hrs. I'm testing that right now.
Nice to see the progress!
Powerbanks also didn't work for me, I quickly switched to LIPO chargers boards and finally just ordered the bare chips
Couple of things to keep in the back of your head
1800mAh is "just" enough for my unit for +-24,5hrs (15/25mAh for your Openlog, 45/60mAh for M8, 100/150mAh for SD)
You can set high Hz rates, but going above a certain data stream rate will give errors.
I haven't figured it out if this is M8 buffer or compute resources, but I can't look into the M8 at that level...
When writing to SD you need to allocate free blocks, this can take longer than your buffer can store data (depending on Hz rate)
Manfred made ParseUBX.exe, you can check the integrity of your log
cloud.raymondwortel.nl/index.php/s/TtRZ7a8b4nC2oBr/download?path=%2F&files=ParseUBX.exe
If you wanted to go for a really basic solution, which requires charging the battery outside of the unit, you can try a protected 18650 cell, together with a battery holder. It seems I was wrong and Jaycar do sell them, which is stupid as I have already built another project where I had 8 of these battery holders wired together in order to build a power bank for some LED lights.
It sounds like an 18650 is going to be the correct size for the capacity you need.
From what I have seen and what my memory recalls from the testing I did with them, Li-ion seem to have an absolute maximum cell voltage of 4.2v and useable energy down to 3.0v. Given that you are using devices that seem to be rated for a nominal 3.3v, you can probably get away with using the cell directly, but you must use a protected cell. The protected cell circuit will stop it discharging the cell too far which would make the cell unusable.
So, maybe these if they fit:
www.jaycar.com.au/single-18650-battery-holder/p/PH9205
www.jaycar.com.au/18650-2600mah-li-ion-protected-battery/p/SB2299
You can wire the battery holder directly to the circuit you have provided, and as long as it will run from 4.2v down to 3.0v you should be okay.
This is a combination I would use if I were creating the power and charging setup from scratch.
It is two modules connected in series. The first is the charger and protection for the lithium ion cell. It charges it, and prevents excessive discharging. The output of that is connected to another module to deliver 3.3v (or 5.0v if you choose a different module).
(just search in ebay for these terms, as the URLs seem too long, and there are many sellers of these)
5V 1A USB 18650 Lithium Battery Charger Board Protection Module
This cuts the output once the battery gets below 2.5, but otherwise the output of the module can be from about 4.3v down to 2.5v.
Buck-Boost-2in1-0-8-6V-to-3-3V-DC-DC-Converter-Module-for-esp8266-Wifi-Bluetooth
The buck/boost converter is required because the voltage of the lithium ion battery can drop to less than 3.3v and still have a lot of usable energy, so you boost it back to 3.3v.
This combination will give you a 18650 (typically 2600mah) battery that is protected and can be charged from USB, and will deliver as much power as you can realistically get out of those cells.
As ebay examples.
www.ebay.com.au/itm/Hot-TP4056-5V-1A-USB-18650-Lithium-Battery-Charger-Board-Protection-Module/222945885464?hash=item33e89c3d18%3Ag%3A-B8AAOSwJjZa4DyN&_sacat=0&_nkw=5V+1A+USB+18650+Lithium+Battery+Charger+Board+Protection+Module%5C&_from=R40&rt=nc&LH_TitleDesc=0%7C0
www.ebay.com.au/itm/Buck-Boost-2in1-0-8-6V-to-3-3V-DC-DC-Converter-Module-for-esp8266-Wifi-Bluetooth/142489267704?hash=item212d05adf8%3Ag%3Axu8AAOSwhLJZoP7Q&_sacat=0&_nkw=3.3v+buck+boost&_from=R40&rt=nc&LH_TitleDesc=0
The Jaycar search engine leaves a lot to be desired, no wonder you can't find stuff.
The 18650 battery holder looks to be a tad too long unfortunately, the bare battery will fit in maybe I could improvise something. Needs some thinking about.
Nup that's not it, it's writing to the SD no worries.
So it will be interesting to see how long the power bank holds up.
Battery lasted 21hrs, not good enough for an extreme distance attempt, but more than enough for my needs.
I ordered a charger from Bangood, I think Jaycar said they had a booster. I'll find out when I get the tagged battery.
Charges up the power bank, and you guessed, it wouldn't stay on. But I figured the 180? resister would be very close to keeping it on, so I kept switching it back on. After about 20 tries it stayed on, so I'm leaving it on for an hour or so, so it should work tomorrow.
Bought a 14500 800mAh tagged lithium battery. The 18650, at 18mm dia is too big, the powerbank is 15mm thick which is very tight.
The booster they had was also too big, so I'll have a look on line.