# GPS speedo design in the making

**URL:** <https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183>\
**Category:** Projects\
**Created:** [21 November 2021 10:18 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183 "2021-11-21T10:18:25Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [8 March 2022 04:12 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/41 "2022-03-08T04:12:01Z")

</div>

> [@Liam](#):
>
> PS: I’ve added two sets of 3x back quotes (same key as Tilde ~) ``` around the outside of your code so that it formats itself nicely.

Thanks for doing that, Liam. Looks brilliant. There are some clumsy pieces of coding in there. I think I’ll leave them and users might exercise their coding skills and refine what I’ve done.

Hi Alan. I’d never be able to learn assembly to tackle this. Why do you only work in assembly? Do you design embedded devices? There’s a notion around that the Arduino processor runs much faster than the serial port so there should be no problem doing tasks between reading the serial buffer. I’m finding I can’t trust that notion. i think I need to grab and store all NMEA in a cycle while doing an absolute minimum of tasks, and when I have them all use the rest of the cycle to run the “mainline” work. The serial buffer is 64 bytes; the sentences transmission takes about 0.4 sec leaving 0.6 sec for the mainline work.

Thanks for the interest everyone.

---

<div class="post-metadata">

**Author:** ![Alan73922](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Alan73922](https://forum.core-electronics.com.au/u/Alan73922)\
**Post date:** [8 March 2022 06:39 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/42 "2022-03-08T06:39:37Z")

</div>

> [@John74406](#):
>
> Hi Alan. I’d never be able to learn assembly to tackle this. Why do you only work in assembly?

Good question! Part of it is frustration with microprocessor C, one is not sure what goes on in the background. Part of it is the desire to wring the last ounce of performance from an 8 bit processor rather than cave in to ‘get a bigger hammer’ syndrome. And I like the puzzle aspect - how can this be done?

It is possible to combine assembler and C, I did this for an ATmega328/P a few years back. From memory the C compiler allowed in line Assembler, and ISR (Interrupt Service Routines) to be declared ‘naked’ which means C doesn’t put a wrapper around the interrupt and the assembler handles it all.

Back to your problem. You seem comfortable with the idea of waiting until all NMEA messages arrive before going off to process the data. I don’t know how much memory you have available, but a possible way out is to handle the serial input in an ISR written in C. All the ISR need do is write incoming characters to a circular buffer say 32 bytes. When the 32nd byte is written, start again with the first byte. Excuse my code, it is pseudo C

```auto
#include <avr/interrupt.h>
ISR(ADC_vect) //vector names provided by compiler
{
buffer[inpointer++]=RxChar; // move character from UART to memory, increment pointer
if (inpointer>31)inpointer=0;
}

```

The mainline has a pointer also that tracks inpointer. While mainpointer=inpointer there is nothing to do.

```auto
If mainpointer<>inpointer // lots to do
{
If readingflag=yes then
   { If buffer[mainpointer]=* then {readingflag=no; call a function to analyse the message[]
     else message[x++]=buffer[mainpointer];
   }
else If buffer[mainpointer]=$ then {x=0; readingflag=yes}

}
if (++mainpointer)>31 then mainpointer=0
}

```

The reason for this somewhat roundabout method is you can read 32 characters from the UART while processing the previous message. That should be plenty of time to extract what you want from the message.  
Once you have all the data you want from the messages then do other processing, come back to the  
If mainpointer\<\>inpointer  
section. It doesn’t really matter if the pointers don’t match, readingflag is no until a $ is read.

Hope that makes some sense.

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [8 March 2022 12:49 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/43 "2022-03-08T12:49:07Z")

</div>

> [@Liam](#):
>
> Those TinkerCAD drawings and comments in the code look amazing 😃

Thanks. I made the effort to create accurately dimensioned models of all the boards and components. I then used those models to create the spaces to receive the actual components. I turned the Nano model into a hole and lowered into the box shape. It leaves indentations exactly where the pin-holes of the real Nano will lie.

So the Tinkercad drawings are not just a realistic representation of the finished assembly but are key to the design process.

 ![Speedo box](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9e177e736f716b5a0f44f43481e37c0a7f89569b.jpeg)

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [11 March 2022 03:03 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/44 "2022-03-11T03:03:42Z")

</div>

Circuit drawing.

 ![GPS Speedo_circuit dwg](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/c/ca656d6d6e85ee670c87f2538cc37560c7379f57.jpeg)

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [14 March 2022 11:09 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/45 "2022-03-14T11:09:28Z")

</div>

With the current design it is difficult to install the wiring between the components. The housing is a hollow box. There are apertures for each board and the other components. The interconnections are made by placing short lengths of wire inside the box and soldering the ends to thru holes on the boards and the pins of the buzzer and dip switch. This is awkward and time consuming – there is not much space; wires need to be long enuf to be manipulated but if too long they push back like springs when the boards are put into their resting place.

 ![open box_3](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/97a871d39412ea3b6de4dc09d69e33fd2e6afd30.jpeg)

I’ve found a technique that might make the job easier.

Introducing the monobloc:

 ![monobloc_4](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/b/b5c3e62df05d02575915a35c28eaf2dd6d62d498.jpeg)  
 ![monobloc_3](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/e/e4d09652fe8a8ac494adde506bb45187aab7d919.jpeg)  
 ![monobloc_2](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/1/17c6c9cf9f1932c245ed55864928b091ef5e279d.jpeg)

Here, the housing is a solid block, not an open box. The inside of the block is hidden and inaccessible. Small ducts are designed into the monobloc to provide conduits for wires to connect thru hole to thru hole. The idea is a wire is pushed into the opening at one end of a duct until it emerges at the opening at the other end. So the wires will be precisely where they are needed and don’t have to be manipulated. Looks promising. Have to suck it and see.

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [14 March 2022 23:59 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/46 "2022-03-14T23:59:27Z")

</div>

Hi John,

Very interesting problem! I’d also take a look at [this forum topic for some ideas](https://forum.core-electronics.com.au/t/project-by-michael-kipad-a-custom-macro-keypad-for-kicad/9524/3) 😃 Given you are working from all sides rather than one there’s a chance it would be harder but worth a look into!

Liam.

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [15 March 2022 05:28 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/47 "2022-03-15T05:28:02Z")

</div>

![monobloc with wires](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9840029d26ceb27305e39382935d1128e73b15f5.jpeg)

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [15 March 2022 06:43 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/48 "2022-03-15T06:43:10Z")

</div>

These are jumper wires. They fit snugly into the ducts which are 2.0 mm diameter. So i was able to get these thru each duct but I think it will be too tricky to solder to the boards. The insulation wud have to be stripped back to the housing surface. They are multi core which makes them nicely flexible but the fine wires are tricky to get into a thru hole for soldering. I found, when soldered, they can break easily if manipulated too much.

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [15 March 2022 09:42 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/49 "2022-03-15T09:42:32Z")

</div>

Here I’ve used single copper core hookup wire. Have inserted all wires. I can strip off as much or as little insulation as I need to. Once the wires are soldered to the boards and the boards flush against the housing I’ll trim off the excess copper wire. This is turning out to be a good technique.

 ![monobloc_5](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/8/8f0068e2d4a98e3d4d03d7826b42acd98adbb56b.jpeg)  
 ![monobloc_6](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/8/8add753cbf95ee1eefc0c414a31c3b6432962031.jpeg)  
 ![monobloc_7](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9776d271a2f3ec8ac676629483ad19beb860eb10.jpeg)

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [16 March 2022 07:38 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/50 "2022-03-16T07:38:47Z")

</div>

This Tinkercad image shows the bundle of ducts that are inside the solid box. The ducts are “holes” in Tinkercad terminology.

Ducts are typically a straight tube connected to a right angled elbow. A bit tricky to get them just right, but I now know how to do it.

![ducts_3](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/c/c9ada30b0e4ffa55e5c6bc82aaf85f125e207985.png)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [16 March 2022 08:33 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/51 "2022-03-16T08:33:07Z")

</div>

Hi John

> [@John74406](#):
>
> Here I’ve used single copper core hookup wire

Be very careful with this. When stripping do not touch or nick the copper. If you do it stands a very good chance of breaking when you push a unit back into position.

I am surprised you found stranded wire breaking. In my experience stranded wire withstands flexing much more readily than solid. The exception here is if too much solder “wicks” down the wire, then it is likely to break where the solder wicking finishes.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [16 March 2022 09:14 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/52 "2022-03-16T09:14:34Z")

</div>

> [@Robert93820](#):
>
> When stripping do not touch or nick the copper.

Hi Bob. Thanks, I’ll try to avoid nicking the wires, which I often do.

I put the breaking down to too much manipulating of the boards and hence the soldered connections and the fine wires themselves. Also, I can’t be sure I’ve soldered all the individual wires into the thru holes. The real problem is the cramped working space because the boards have to be close to the housing while I solder the connections – if the wires are long they can’t be pushed back into the housing. I’m hoping that with this new method I’ll be rid of this problem. We’ll see.

John.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [16 March 2022 09:34 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/53 "2022-03-16T09:34:10Z")

</div>

Hi John

> [@John74406](#):
>
> I can’t be sure I’ve soldered all the individual wires into the thru holes

Sounds like your soldering skills could do with a brush up.  
Cheers Bob  
PS. Otherwise you have done an excellent job here with this project. Congratulations.

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [16 March 2022 10:32 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/54 "2022-03-16T10:32:14Z")

</div>

Here’s a view of the ducts that might be easier to comprehend. Each has to be the right length, height and at the right angle. And they musn’t foul each other. A good puzzle.

![ducts_2](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/4aa96c5a8515b8b2e12a6aa864fa9132160e09c2.png)

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [4 April 2022 14:08 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/55 "2022-04-04T14:08:23Z")

</div>

These pics show my progress in assembling the monobloc design.

 ![pic 1](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/8/8ef4739b443de5920981386897615c9fed727282.jpeg)  
 ![pic 2](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/3/3aa70f8c7ca33c4eb6aa3e1f1ca0393d90dd6c33.jpeg)  
 ![pic 3](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/8/88d74318e8f353c49137527d45a0e98e1b83967d.jpeg)  
 ![pic 4](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/9/9007b48dfa7f1411cc83d46ed959fd4afc6dbb35.jpeg)  
 ![pic 5](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/a/a19933ac2137bbea6c418bf93ebda905cd9fcc2e.jpeg)  
 ![pic 6](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/4/407bc9733cf6957d5752f29913782dd1a38bee43.jpeg)

continued…

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [4 April 2022 14:10 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/56 "2022-04-04T14:10:12Z")

</div>

![pic 7](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/c/cdf87cb82afe53a9ef76890093366a94313fdf69.jpeg)  
 ![pic 8](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/7/76582c313746f7a9611d528c1299018cc7527d5e.jpeg)  
 ![pic 9](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/5/5515c77c18c5700a348d98b0ac35b9e6963d991f.jpeg)  
 ![pic 10](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/a/a7384cc43451027f7056333504ccafc2de58952b.jpeg)  
 ![pic 11](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/c/cf72b79474c16f8e757c6c4225c2df15abf80670.jpeg)  
 ![pic 12](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/e/e46ef9af400b50047dcd320dc71b981db2e2d7db.jpeg)

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [5 April 2022 01:39 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/57 "2022-04-05T01:39:07Z")

</div>

Hi John  
I am not trying to be too critical here. You have gone to an immense amount of trouble to get an extremely good project up and running and congratulations are well in order.

BUT. At the end of the day you seem to have used bare, untinned copper wire. I don’t quite understand.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [5 April 2022 06:08 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/58 "2022-04-05T06:08:29Z")

</div>

Hi Bob.  
Don’t mind criticism - it all helps.

Bare wire? Well, PCBs use bare copper traces, don’t they?

John.

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [5 April 2022 07:31 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/59 "2022-04-05T07:31:18Z")

</div>

Hi John

> [@John74406](#):
>
> PCBs use bare copper traces, don’t they?

Not good ones.  
Cheers Bob  
PS. I was referring to untinned mostly when I said “bare”.

---

<div class="post-metadata">

**Author:** ![John74406](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@John74406](https://forum.core-electronics.com.au/u/John74406)\
**Post date:** [5 April 2022 09:06 UTC](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183/60 "2022-04-05T09:06:24Z")

</div>

> [@Robert93820](#):
>
> PS. I was referring to untinned mostly when I said “bare”.

Bob, I don’t understand. Is there a problem with them being untinned?

[Previous page](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183.md?page=2)

[Next page](https://forum.core-electronics.com.au/t/gps-speedo-design-in-the-making/12183.md?page=4)
