Odd Software for Odd Jobs

Average Speed Calculator, part 6

Road test! Drove into work and tested out the averaging functionality (i.e. the whole point of the project). Seems to work as planned! This was point-to-point on the motorway.

Now I'm just working on improving the user interface. It would be cool for the timezone to update automatically based on your location, but this would require too much memory. So I've settled for manually setting your timezone … still, it would be nice that it automatically updated the time as you drove across the NSW/Queensland border during Summer. It will determine DST automatically, though, based on the date obtained from the GPS.

2016-03-22 20.27_800px

Average Speed Calculator, part 5

Got myself a simple mobile phone holder - this one attaches to the air vents.

2016-03-21 14.49_800px

I checked the GPS coordinates it was giving me in Google Maps … pretty accurate.

Here's a shot when I was stationary at the traffic lights - this shows the speed & altitude display. The speed seemed accurate compared with my car's speedo - it was reporting about 10% more than the car's speedo, which I know under-reports by about 10% (a few years of using a TomTom and comparing the speeds).

2016-03-21 14.44_800px

I tried out the average speed calculator - the main purpose for this project - on the drive home from the local shops. I'm planning to take it out onto the motorway over the next few days, with my wife behind the wheel, so I can give it a proper test of the speed averaging, etc. whilst the wife concentrates on the driving.

2016-03-21 14.49-1_800px

As noted earlier, I already have a few ideas for the "Rev. B" prototype - I might make a few of those tweaks (LED blinking for GPS data reception, replacing the LCD contrast pot. with a fixed resistor). Let's see.

Average Speed Calculator, part 4

I finally took the plunge and implemented a hard-wired/veroboard version of my average speed calculator project.

I decided to use a bare Atmel chip rather than a full Arduino - I've got a few chips pre-programmed with the Arduino boot loader so I can simply program it in an Arduino Uno and then insert it into my circuit!

All you need is a 16MHz crystal across the X1 and X2 pins and its two 22pF load capacitors between X1/X2 and ground, and a 10KΩ pull-up resistor on the reset pin.

I've also got a 10µF capacitor across the Vcc and ground lines from USB input. I was originally going to also use a 5V regulator … just to be sure and in case I decide to add an alternative power source … but USB gives me 5V, so I didn't bother.

2016-03-16 23.33_800px

So that I could re-use the parts (like the GPS module and LCD) and to make it easy to construct/pull apart, I've used pins and sockets to connect the main components together - so much easier when installing the switches!

2016-03-17 17.54_800px

This was the result … and it worked!

2016-03-19 21.06_800px

Here is the board fitted into the jiffy box. I used a hot glue gun on the LCD ribbon cable to give it some extra strength (one wire already broke off the board). You can also see the 3.3V regulator on the right as the GPS module requires the lower voltage.

Additionally, I've used nylon screws instead of metal - they're much easier to cut-to-size, but mainly because it's expected that this would be mounted on the dashboard of the car. Having metal screws exposed to the Sun for hours probably would not be such a good thing!

2016-03-20 07.09_800px

I've used D0 to D5 for the LCD, D7 and D8 for the push button controls, and D12 & D13 for the GPS serial data.

This is the front panel construction:

2016-03-20 08.04_800px

Here are all the components mounted together. The GPS module is along the top - I've used some double-sided tape to hold the patch antenna in place.

2016-03-20 08.05_800px

A very tight fit! I probably should've used the next-size-up jiffy box, but I didn't want it to be too big. One issue is the blue potentiometer used for the LCD contrast - it's just in the way of the left-hand LCD plug. I could either replace this 10KΩ potentiometer with a resistor (establish the best contrast and measure the resistance), or move it slightly up so it's not in the way of the plug. For this Rev. A prototype, it'd be simplest to replace it with a discrete resistor.

The GPS module and antenna fit beautifully.

2016-03-20 08.09_800px

The final result! I was pretty happy with the holes I created for the power switch (on right side), USB socket (on bottom) and push buttons (on front). Unfortunately, the LCD cutout was a little off.

2016-03-20 14.36_800px

Now I just need to get one of those suction-cup holders for mobile phones and I can take it for a road test. It's essentially a GPS speedometer, which I've seen for $100 at Jaycar (item LA9025). But it looks pretty basic. I think mine's got more features/information!

I've already got some ideas for a Rev. B prototype:

  • Larger box - but might be solved by re-organising the circuit board a little;
  • An LED on the front panel to blink, indicating GPS data is being received;
  • Add time/date to the display - I had this earlier - due to the different timezones in Australia, I could add some basic timezone handling based on your GPS coordinates;
  • Include a serial-to-USB converter to make it easier to troubleshoot (i.e. debug log printing) - I already have a USB socket that I'm only using for power, so shouldn't be too difficult to get data out using the same plug.

Grotto Time, part 5

Upload to my website is finally working again - it only took my website just over three weeks to tell me what they changed that stopped it working (despite me telling them what I was trying to send and the exact minute it stopped working). Anyway …

So, it's allowed me to start working on it again.

I've added dew point estimation - this uses the temperature and relative humidity to estimate the dew point. It's a good measure of how humid the day feels. Also, when the ambient temperature is within a few degrees of the dew point, fog will form. It's sometimes nice to photograph the sunrise when it's foggy! So this will help warn me when it might be a foggy morning.

This information is now also uploaded to my website.

In addition, I've also added approximate sunrise & sunset times for my location in Sydney. The times are displayed on the LCD and change during the day - if it's after sunrise, then it will display today's sunset and tomorrow's sunrise. If it's after sunset, then it will display both times for tomorrow.

This is also uploaded to my website.

2016-03-06 19.18.44-1