Odd Software for Odd Jobs

Average Speed Calculator, part 3

Took my little average speed calculator for a quick field-test around the local streets. Seems to be doing the job I wanted it to. Need to enlist the wife's help to do a proper test at highway speeds.

Field test

I also added a sixth screen of information - the maximum speed recorded and the timestamp:


I still need to sort out the localisation of the date from the UTC date received. And also tidy up the code - add some more functions instead of just replicating the code (I feel terrible about it!).

Average Speed Calculator, part 2

I have got my prototype ready for field-testing, i.e. driving around in a car.

The final parts list is:

  • Freetronics Eleven (Arduino Uno compatible)
  • GPS module using a u-blox NEO-6M (board is labelled "GY-GPS6MV2")
  • 16x2 LCD display (labelled "JHD162A")
  • Two SPDT microswitches that I've soldered onto the prototyping area of the Eleven (Jaycar SM-1036)
  • 10kΩ potentiometer to control the LCD contrast
  • 1 x 4.7kΩ, 3 x 10kΩ, 1 x 220Ω resistors

The 4.7kΩ & one 10kΩ resistor are used for the GPS module's Tx pin to the Arduino (the GPS module uses 3.3V).
The 220Ω resistor is connected between the LCD display's pin 15 (LED+), the backlight anode, and the Arduino's 5V supply.
The final two 10kΩ resistors are connected between the switches and the Arduino.

One of the buttons is used to switch between five screens of information:

Screen #1 - current speed and altitude


Screen #2 - when speed averaging is activated (i.e. when you pass under the first point-to-point camera), it shows the duration since it started and the current calculated average. The asterisk indicates whether the average is currently being updated (asterisk) or is from the previous activation (no asterisk)


Screen #3 - current latitude and longitude


Screen #4 - number of visible satellites and the current HDOP


Screen #5 - finally, the current date & time - the date/time is received in UTC so I've hardcoded +11 hours to compensate for current Sydney DST


Oh, bugger - I haven't bothered compensating the date either. Okay, still some polishing to do.

Anyway, the Freetronics Eleven can be run off 5V via the micro-USB or 7-12V so I have the option of wiring up a cigarette lighter plug to power it or simply use a cigarette light -> USB plug.

If it seems to be accurate - I'll measure against my TomTom - then I'll move to the next step and create a proper hardwire prototype in a jiffy box.

Here's the current Arduino code if anyone is interested - I used Mikal Hart's 'kitchen-sink' example from his TinyGPS++ library as the basis.