Odd Software for Odd Jobs

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.