PDA

View Full Version : Building your (my) own electronic speedo



FlyingDutchMan
15th November 2005, 21:01
Well I've built my own speedo with an LCD read out. It works quite well at the moment - I have a few mods in line for it, but the only bad thing about it at the moment is having to clean IR speed sensor ever few hundred ks or so.

The readout accuracy is +-1km/h, the odo readout increment is 600mm (yes only 0.6 meters!) and tacho readout. It also has a trip meter with the distance, engine running time and the number of revolutions the engine has done on the trip!

Some of guys have expressed interest in making one for them selves so I'm sticking the code and schematics that I used up here.

Heres the schematic: (Big gif)
http://middleparkmadness.homeip.net/pictures/speedo_sch.gif

Righty, the assembler code is now available. Heres the zip file:
http://middleparkmadness.homeip.net/speedo_code.zip

I used MPLAB to assemble and for programming - you'll still need some hardware in which to connect between your PC and the chip though. You can download MPLAB for free from the Microchip website: http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 or if doesn't work just follow your nose from http://www.microchip.com/

The main file to assemble is speedo.asm - this includes all the other ones automatically.

The programming hardware I used was a ICD2 - you can get them from microchip for about $160US or find someone to borrow off.

skelstar
15th November 2005, 21:12
Cool dude. Im assuming you used MPLAB for the software? (I use it for my job).
[edit] woo and Protel :)

cowboyz
15th November 2005, 21:20
being as I am extremely incompetent how much (or are you willing) to build one for my gsx600 to the stage where I can bolt it onto the bike. Would love a digital speedo and wouldnt mind a warning lights at 100k Maybe a small light that is in your corner vision that is on under 100k/hr and turns off over 100k so you can see when you need to make that slight speed adjustment for oncoming police cars. Being as I criuse a little over 100k/hr (to stay out of traffics way) it would be better if the light was off over 100.

mattt
15th November 2005, 21:52
Some of guys have expressed interest in making one for them selves so I'm sticking the code and schematics that I used up here.

Heres the schematic: (Big gif)
http://middleparkmadness.homeip.net/pictures/speedo_sch.gif

I'll be putting the assembler code up soon (once I've tidied it up a little!).

Mmmm - I think I used to beat up guys like you at school.
Why not just buy a $30 LCD speedo from a cycle shop and hook that up. Will give you speed / average speed - Odometer - max speed, all to the nearest meter, or so. Takes 2 min to install.

Aiolos
15th November 2005, 22:10
Why do anything yourself?
Why cook? Why shower?
Why ride an NC30? You would get there much faster on a litre biker.

What speed do bicycle speedos max out at?
Bicycles speedo have small displays generally, and no tacho, which FlyingDutchMan's design does.
This design is also customisable, and I like cowboyz' idea.

R1madness
16th November 2005, 08:41
Cool man. Do you do a simple tacho with a lap counter and water temp for racing? You could make a few dolllars if you market the idea.

R1madness
16th November 2005, 08:41
Cool man. Do you do a simple tacho with a lap counter and water temp for racing? You could make a few dolllars if you market the idea.

skelstar
16th November 2005, 08:52
The trick is going to be putting it into a nice enclosure and making it water-proof.
Ive thought that making a race-specific box would be the go. Avg/Max speed, data logging (not that much room in your chip), lap-timer using a big easy reach button on the handle bars...possibilties are endless.

mattt
16th November 2005, 09:12
What speed do bicycle speedos max out at?


299.9kph, but on my old bike I only ever got it to 272. :stupid:

Flyingpony
16th November 2005, 10:09
Great idea. This is something that I've thought about too but don't have the technical knowledge and equipment to do it. Therefore, semi and/or fully pre-built units would be great for those of us without the right knowledge and equipment.

What I'd like to see is an adjustable speed limiter warning system. So if I'm in a 50km zone and have it preset to 57km/hr, it'll use a configurable combination of lights and/or buzzers to warn if the current speed exceeds this. A 30 second hush button might be required for over-taking purposes.

Be good if the warning speed can be powered by a volume type control switch and have a LCD digit screen displaying the new warning limit - makes for easy adjustment while on the move.

How small or large will this unit be for mounting on a bike?
With each bike model being different, how would this system plug into our bikes to gather information?

Would this system also work on a car?

FlyingDutchMan
16th November 2005, 12:04
I dunno what my speedo maxes out at, but I have managed to make it read 1,450+ km/h (by pointing a TV remote at the receiver). I think it will suit the needs of anyone on wheels.

FlyingDutchMan
16th November 2005, 12:23
Mmmm - I think I used to beat up guys like you at school.
Why not just buy a $30 LCD speedo from a cycle shop and hook that up. Will give you speed / average speed - Odometer - max speed, all to the nearest meter, or so. Takes 2 min to install.

Because I can, and because its far superiour and you can read it day or night no matter the lighting conditions.

Sniper
16th November 2005, 12:25
Congrats on the build. And I like the diagram mate. Good luck with it.

Badcat
16th November 2005, 12:34
i'd buy one (if it wasn't to expensive)

FlyingDutchMan
16th November 2005, 12:57
Cool man. Do you do a simple tacho with a lap counter and water temp for racing? You could make a few dolllars if you market the idea.

I'm not quite sure how lap counters work (rider pushes a button or is there an RF signal or what?), but water temp can be done... just have to re-arrange the wiring to free up an Analogue input pin.

FlyingDutchMan
16th November 2005, 12:58
i'd buy one (if it wasn't to expensive)

I don't think it would cost much - probabaly $40-50, but when you add packaging on... well its time to start running.

Hoon
16th November 2005, 13:08
Hey I've got a few unrelated questions you might be able to answer? I've been toying with the idea of datalogging using the BS2 as I have a few of them lying around.

What format does the tacho signal come across as? I see you tidy up the signal into a pulse input in your bottom left diagram. Do you then measure the time between pulses to calculate RPM or does the PIC have a function for this which returns a value?

Coyote
16th November 2005, 13:11
That is awesome. How do you learn this electronics stuff?

FlyingDutchMan
16th November 2005, 16:39
Hey I've got a few unrelated questions you might be able to answer? I've been toying with the idea of datalogging using the BS2 as I have a few of them lying around.

What format does the tacho signal come across as? I see you tidy up the signal into a pulse input in your bottom left diagram. Do you then measure the time between pulses to calculate RPM or does the PIC have a function for this which returns a value?

Calculating the revs by the time between pulses requires division... trying to do that in assembler on an 8 bit micro which doesn't even have a multiply instruction :sick:

I cheated - I count the number of pulses (4 pulses per revolution for the CBR250 - it has an output transistor which pulls the line high - there is nothing to push it low) in a 0.3 second interval and multiply it by 50. Gives me a number between 0 and 17,200 with increments of 50 - the real rev limit is at 17,230 so its pretty good. Could use any time period with 1ms increments - the longer the time the more accurate the rev reading but less frequent updates and vice versa.

I do a similar thing for the speedo - count the number of holes in the disk brake that go past in a 0.432 second interval and thats my speed in km/h.
Example (my bike): 15 holes per revolution, 1.8m around (its really 1798mm, but 1800mm is close enough). So for 100 pulses in 0.432 seconds = 231.48 pulses per second /15 = 15.43210 wheel revolutions per second * 1.8m = 27.77777m/s. multiply by 3600 for seconds to minutes and divide by 1000 for m to km and you get 100km/h - the same as the number of holes which went past. Very little math involved! Each hole equates to 12cm travelled, so if I wanted to, I could increment the odo every 12cm.

I just noticed because of your post that I hadn'y put all the tacho cleanup stuff on there - there is extra cap in there now.

FlyingDutchMan
16th November 2005, 16:54
That is awesome. How do you learn this electronics stuff?

Spend faaar too many years of your life (7) at uni doing two degrees in Electrical & Electronic engineering. Actually a single degree would be enough.

Macktheknife
16th November 2005, 16:59
For those of you with an extraordinary budget though you could consider this.
http://www.veypor.com/
I would call this the ultimate performance type accessory thingy. Mine is on its way.

R1madness
16th November 2005, 18:22
I'm not quite sure how lap counters work (rider pushes a button or is there an RF signal or what?), but water temp can be done... just have to re-arrange the wiring to free up an Analogue input pin.
The simpleist lap timers/counters work off a button on the bars (like a stopwatch) but a RF transmitter could be set up on the side of the track if one was available cheaply enough. Perhaps you could make them too? I am interested in a basic lap timer/counter. Can you come up with a price for a complete unit? It would need a large (ish) display so it could be read while on the bike.
Cheers
Ian

Badcat
16th November 2005, 18:49
I don't think it would cost much - probabaly $40-50, but when you add packaging on... well its time to start running.

well - if you want to build them - i'm your first customer.
k

Pixie
19th November 2005, 09:48
Why do anything yourself?
Why cook? Why shower?
Why ride an NC30? You would get there much faster on a litre biker.

What speed do bicycle speedos max out at?
Bicycles speedo have small displays generally, and no tacho, which FlyingDutchMan's design does.
This design is also customisable, and I like cowboyz' idea.
Speedo-199 kmh
Max speed-999 kmh
And the display size is fine,I have used one as my sole speedometer for years,and before you say it, if you are doing 200 kmh+ and looking to see what your speed is you are an idiot.Besides the max speed function takes care of that.

flash
20th November 2005, 13:20
I don't think it would cost much - probabaly $40-50, but when you add packaging on... well its time to start running.

im the same as badcat. if you start making them im highly interested

FlyingDutchMan
22nd November 2005, 08:21
Seems I might have to get some PCBs made up so I can produce a professional looking unit. I'll have to upgrade from the black duct tape packaging I'm currently using though - even if it does look classy.

scumdog
22nd November 2005, 08:30
Seems I might have to get some PCBs made up so I can produce a professional looking unit. I'll have to upgrade from the black duct tape packaging I'm currently using though - even if it does look classy.

Ha ha, yeah, the duct-tape gave it that 'temporary' (you call it 'classy'?) look alright - but it all worked well, I was impressed. (can you make one that will get my Sporty to rev to 17,000rpm???:blink: :thud: )