Article [13] ST1300 - Gear Position Indicator (Do It Yourself)

pdfruth

P.D.Fruth
Joined
Jan 28, 2005
Messages
228
Age
62
Location
Somewhere near Denver, CO
I've been chatting about this over on the RC51 forum. Thought I'd post over here, since the good folks of the ST community might find this interesting too. I'm never really sure which category to post into, so I'll stick it in the "General" section. Mods, please move this as appropriate.

I've undertaken a renewed interest in embedded micro-controllers lately. Over the past 20 years, I've puttered around with various MC's. I've worked with MC's such as - Intel 805x, Motorola 68xxx, 6502, and Zilog Z80. But never MicroChip PIC MC's. So, I wanted to educate myself on PIC MC's. This little project was simply a means to and end.... learn PIC16Fxxx microcontrollers, using a real-world application. And have something to show for it in the end.

It all started one day a few weeks ago. A buddy and I were talking (he has a Suzuki TL1000R)... he says "I wish I had a gear position indicator". I said "I think we can do that". So, after some research and development, I built him a GPI using a PIC16F88. Turned out to be a rather easy task. Since the Suzuki has a wire coming out of the transmission carrying a voltage ranging anywhere from 0 to 5 volts, depending on what gear it's in, I just used the PIC16F88's A/D converter to read the voltage, and convert it to a gear number. Once the gear number is known, it is a simple matter of displaying it on a seven segment LED, which is now velcro'd to the side of his instrument cluster.

Voila... Now he has a GPI, and I have a good bit of real world experience on PIC micro-controllers.


But noooooooo...that wasn't good enough, I was thinking.... Now I gotta have a GPI too.

So, I set out to build a GPI that'll work on my ST1300 and my RC51.
However, because Honda doesn't have a wire coming out of the transmission (like the Suzuki's do), a very different approach was required.

Here is the approach I took -
- Hondas have a vehicle speed sensor (mine do anyway), which emits a very nicely formed 5v digital square wave. The square wave's frequency varies in direct proportion with wheel speed, via a variable reluctance sensor coupled to one of the gears on the final output shaft (aka, counter-shaft).
- Hondas also have an Ignition Pulse Generator (IPG). The IPG emits a very nicely formed semi-square A/C signal. The frequency of the signal varies in direct proportion with engine speed, via a variable reluctance sensor coupled to the flywheel. There are exactly 12 pulses/cycles per crank shaft revolution.
- Hondas also have a neutral switch. When the bike is in neutral, the switch provides continuity to chassis ground.
- Hondas also have a clutch switch. When the clutch lever is pulled in, the switch provides continuity to chassis ground.

Given those four signals....
Using a PIC16F88 micro-controller, I've written code that essentially counts pulses, monitors the neutral & clutch switches, and outputs a result on a seven segment display. The micro-controller's on-board microprocessor, running at 4Mhz, does this over and over, very quickly (like a few hundred times per second). If the neutral switch is closed, I know to display a zero (my choice for indicating I'm in neutral). If the clutch switch is closed, I display a dash (my choice for indicating I'm between gears).
The core algorithm, essentially just counts pulses arriving from the speed sensor, and at the same time tallies up the number of ignition pulses that arrive for a given number of speed sensor pulses. Given this ratio of speed sensor pulses -to- ignition sensor pulses, it calculates which gear the bike is in, and displays that gear number on a seven segment display. Very easy, and very elegant.
I've also included an "Initialization routine" that allows me to put the code into "Learning" mode. The learning procedure essentially allows the user to tell the micro-controller, via interaction with a single pushbutton on the back of the display, how many gears the motorcycle has (cuz the ST1300 is a 5-speed, and the RC51 is a 6-speed). And then allows the code to "learn" how many IGN pulses per given set of speed sensor pulse for each gear. These learned values are then stored in nonvolatile EEPROM memory built into the micro-controller. Thus, this "learn" mode only needs to be performed once, upon initial installation of the GPI.

It took me a week or so to develop the code, and build a prototype. I just installed it on my ST, and took her for a spin (on a lunch break). I'm happy to report, it worked beautifully. Solidly indicates which gear I'm in at all speeds (up to legal limits, of course) and all engine RPM's.

I did do a fair bit of googling, to see if anyone else had done something like this. I found a few commercial offerings, but no home-brew stuff.
So, in case there are others out there with a propensity to do so, and are a little handy with a soldering iron... I thought I'd share the intellectual capital here. It's a pretty simple circuit. It only took me one night to build (once I had debugged it on a breadboard). With the exception of the micro-controller and the seven segment display, all the components are readily available at places like Radio Shack, Jameco, DigiKey, or Mouser. There's one IC (a PIC16F88 micro-controller), a seven segment display, three transistors, two diodes, a couple capacitors, a 5-volt regulator, and a hand full of resistors. The seven segment display turns out to be a critical component. The first one I used (out of the junk box) just wasn't bright enough to see on a sunny day. I eventually managed to find a super-bright red seven segment LED display at Kingbright (www.us.kingbright.com), and it is very visible in direct sun light.

I'll post a schematic, and source code for the micro-controller, in a few minutes.

Before anyone asks "Can you make me one", or "Will you sell me one"... I just wanna set expectations up front. This was just an experiment for me. Like I said, it was a means to an end. I built this thing using nothing more than a few junk box parts. I am in no position to start mass-producing GPI's. It is, however, my sincere hope that, by committing the intellectual capital to the public domain, and GPL'ing the source code, others will benefit. I also hope that other like-minded, talented, innovators out there will pick it up, improve/enhance/change it, and contribute those innovations back here to the community.

Here is a quick pic of the thing installed on my ST1300. The ST is sitting on the center stand, idling, in second gear (as can be seen on the display). The GPI display is velcro'd to the base of the handle bars, just back from the ignition switch.

Edit: 12/28/2008 -
Added updated circuit schematics & code for V1.3. Changes include the incorporation of a photo-cell, so that the seven segment display's intensity will automatically adjust according to ambient light conditions.

Edit: 2/8/2008 -
I've stocked up on all the components required to build the GPI. I can source individual parts and/or a complete builders kit.
I have 4 different types of builders kit. Each contains all the discrete components necessary to build a GPI, containing.... either;
1) External .8 inch LED display, with red acrylic display enclosure components, and ambient light sensor
2) External .8 inch LED display, with red acrylic display enclosure components, and no ambient light sensor
...... Note: see post #4 for an example of the prototype of the above two variations
3) In-dash .56 inch LED display (no display enclosure components), and ambient light sensor
4) In-dash .56 inch LED display (no display enclosure components), and no ambient light sensor
..... Note: see post # 154 and post # 161 for scoutdriver73's example of in-dash mounting.

All builders kits now include the custom printed circuit board (see post # 166 below). The kit contains a blank circuit board, and all the discrete components necessary to build the circuit. The microcontroller comes pre-programmed with the latest version of the code. You get to solder "everything" together, and integrate it into your bike. See post # 4 below for a document containing the steps taken to install it on my ST.
I stock only RED superbright seven segment LEDs from Kingbright. And only the two sizes noted above. If you want a different size and/or color, you are on your own.

PM, or email, me with your needs. Prices and availability may vary, depending on my suppliers & supplier costs.

Edit: 4/15/2010
The last of the remaining kits is gone. I do not plan to re-stock the kits. From this point forward, you're on your own for parts/components. Sorry.
 

Attachments

  • ST1300-GPI-Installed.jpg
    ST1300-GPI-Installed.jpg
    68.6 KB · Views: 6,060
Last edited by a moderator:
Re: My home-built DIY gear position indicator - includes plans

Here is the schematic and the custom PCB art work

For those who need it, here is a link to the data sheet for the PIC16F88 -> http://ww1.microchip.com/downloads/en/DeviceDoc/30487c.pdf
Here is a link to the data sheet for the .8 inch seven segment display -> http://www.kingbrightusa.com/images/catalog/SPEC/SA08-11SRWA.pdf
Here is a link to the data sheet for the .56 inch seven segment display -> http://www.kingbrightusa.com/images/catalog/SPEC/SA56-11SRWA.pdf

Edit: 12/28/2008
Added updated schematics (V1.3) for the auto-brightness feature. There are two variants. The first includes components to sense ambient light conditions, and adjust the display's intensity accordingly. If you don't care for this feature, then use the second variation (tie pin 1 to ground, and leave pin 2 open).

Edit: 2/25/2008
Added custom PCB (Printed Circuit Board) artwork for those who may wish to etch their own boards. This is a double layer board.

Edit: 4/7/2008
Pulled the old V1.2 schematics. If anyone still needs them, send me a PM or email.
 

Attachments

  • HondaGPI-V1.3-schem-ALS.pdf
    28.5 KB · Views: 1,233
  • HondaGPI-V1.3-schem-noALS.pdf
    25.8 KB · Views: 493
  • HondaGPI-V1.3-botcopper.pdf
    11.2 KB · Views: 438
  • HondaGPI-V1.3-topcopper.pdf
    9.5 KB · Views: 405
  • HondaGPI-V1.3-silkscreen.pdf
    26.5 KB · Views: 451
Last edited:
Re: My home-built DIY gear position indicator - includes plans

Here is the micro-controller source code.
Due to file size limits for .txt file attachments, I had to split it into multiple files.
You will have to concatenate them upon downloading.


Edit: 12/28/2008
Added new code (V1.3) for the auto-brightness feature.

Edit: 4/7/2008
Pulled the old V1.2 code. If anyone still needs it, send a PM or email.
 

Attachments

  • HondaGPI-V1.3-part1of4.txt
    18.4 KB · Views: 662
  • HondaGPI-V1.3-part2of4.txt
    14.7 KB · Views: 317
  • HondaGPI-V1.3-part3of4.txt
    12.5 KB · Views: 298
  • HondaGPI-V1.3-part4of4.txt
    10.7 KB · Views: 261
Last edited:
Re: My home-built DIY gear position indicator - includes plans

Here is a picture of my completed prototype, and an Installation & Setup manual.

I used;
- A small Radio Shack 3x2x1 project box (Radio Shack part # 270-1801).
- A Radio Shack grid-style prototype PC board (Radio Shack part # 276-150). I have since had a custom printed circuit board manufactured.
- For the cable between the black box and the display, I cannibalized an old computer 15-pin VGA monitor cable.
- To connect the black box to the bikes wiring harness, I cannibalized an old 6-pin keyboard extension cable I had laying around.
- For the display enclosure, I had a friend cut some 0.1 in. red acrylic on his laser cutter, which I then glued together (w/ Plumbing GOOP) to make a nice tidy little box.

There is a mini pushbutton switch (S1 in the schematic) soldered to the back of the circuit board inside the display enclosure. The pushbutton switch is used during "learning" mode. The back of the display enclosure has a small hole, thru which I insert a straightened paper clip to operate the switch. I use a piece of tape to close that little hole once the "learning" process is complete.

Edit: 2/25/2007 - Added an updated Installation & Setup manual. Due to file size limitations, it had to be split into 4 parts. It's a 40 page .pdf file (about 5.5MB total) containing lots of digital pictures.
 

Attachments

  • GPI-Protype.jpg
    GPI-Protype.jpg
    43 KB · Views: 2,317
  • GPI InstallSetup V1.3 part1of4.pdf
    1.4 MB · Views: 1,116
  • GPI InstallSetup V1.3 part2of4.pdf
    1.5 MB · Views: 686
  • GPI InstallSetup V1.3 part3of4.pdf
    1.6 MB · Views: 743
  • GPI InstallSetup V1.3 part4of4.pdf
    1.1 MB · Views: 760
Last edited:
Re: My home-built DIY gear position indicator - includes plans

For those of us that are electronically challenged . . . . are you going to be making these so we can buy them?

Ok I re-read your post. Does anyone else want to jump in here and make a few. I'd buy one!!

JD
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

I mounted the little black box on the inside of the left inner fairing. The attached picture was taken with the left mid-fairing removed, showing the little black box velcro'd to the inside of the left inner.

Then I ran a cable back to the area near the fuse boxes & relays on the left side, just under the seat. Turns out, all six of the connections needed are all right there. The job was especially easy since I have a speedo-healer already installed.

For the ignition pulse generator - if you remove the seat, you'll see a white 2-pin connector right next to the right frame tube, right there atop the main wiring harness. This connector has two wires in it (yellow, and white/yellow). The yellow wire carries the ignition pulse generator signal.

For the speed sensor - I cheated (sort of). I have a speedo-healer installed. And (my) speedo-healer is physically situated up by the fuse boxes & relays on the left hand side of the ST. Since the speedo-healer is already tapped into the speed sensor signal, I just piggy backed on their connector. If you have a speedo-healer installed, it's the white wire on their connector. If you don't have a speedo-healer, then you'll have to tap into the ST's wiring harness connector. It's on the right side. You have to remove the right-side mid-fairing. You'll find the connector just back from the tip over wing. The connector has three wires in it. Black, Green, and Pink. The Pink wire carries the speed sensor signal.

For the neutral switch and clutch switch - These are both on the back of the fuse box that holds the clutch diode, on the left side of the ST. The light-green wire is the neutral switch signal. The green/red wire is the clutch switch signal.

For power & ground - I cheated again. I piggy backed on the speedo-healer connector's red and black wires.
 

Attachments

  • GPI-mounting-location.jpg
    GPI-mounting-location.jpg
    80.5 KB · Views: 2,190
  • GPI-wiring-location.jpg
    GPI-wiring-location.jpg
    95.3 KB · Views: 2,009
Last edited:
Re: My home-built DIY gear position indicator - includes plans

You lost me after the first word, some people have such a talent, you should build and market them, I'm sure it would be worth your while. :biker:
 
Re: My home-built DIY gear position indicator - includes plans

For those of us that are electronically challenged . . . . are you going to be making these so we can buy them?

JD

I thought I'd get this question... which is why I addressed it in my opening post, quoted below


pdfruth said:
Before anyone asks "Can you make me one", or "Will you sell me one"... I just wanna set expectations up front. This was just an experiment for me. Like I said, it was a means to an end. I built this thing using nothing more than a few junk box parts. I am in no position to start mass-producing GPI's. It is, however, my sincere hope that, by committing the intellectual capital to the public domain, and GPL'ing the source code, others will benefit. I also hope that other like-minded, talented, innovators out there will pick it up, improve/enhance/change it, and contribute those innovations back here to the community.
 
Re: My home-built DIY gear position indicator - includes plans

A home-brew speedo-healer sounds like a good project, too.

Ya, I've considered that too.
I'm working on adding it to the GPI as we speak.

Would love to hear from others, who have familiarity with micro-controllers, on the programming approach/strategy. If there's anyone out there with ideas, please chime in. That's why I made this thing open-source.
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

You lost me after the first word, some people have such a talent, you should build and market them, I'm sure it would be worth your while. :biker:

Believe me... I've thought long and hard about it.
I'm just a poor schmuck, with a full time job, like everyone else (well most of us on this forum anyway:D ). I don't see myself spending all my nights and weekends soldering these things together.
There are already commercially available products out there in the market place, with similar capability. And at a pretty good value too. I, in no way, intend to compete with that.
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

I'm an electronics technician (shhh- I'm at work now!) not an engineer...but if I could get my hands on a speedo-healer schematic and the schematic for an ST1300 speedometer ...

And just what are the differences between the ST1300 and ST1300P speedos, electronically, that is?
 
Re: My home-built DIY gear position indicator - includes plans

My gear indicator is my left foot. When it can't shift up anymore, I'm in 5th! You are too smart for me!
 
Re: My home-built DIY gear position indicator - includes plans

I would like to buy a preprogramed IC and display from you if I can. I shouldn't have any problem building and installing the unit, but I'm not familiar with programing the microprocessors. My electronics training is pre microprocessor going back to vacuum tubes even.

As for the work you have done-----you da man :bow1: :bow1:

Phil
 
Re: My home-built DIY gear position indicator - includes plans

Believe me... I've thought long and hard about it.
I'm just a poor schmuck, with a full time job, like everyone else (well most of us on this forum anyway:D ). I don't see myself spending all my nights and weekends soldering these things together.
There are already commercially available products out there in the market place, with similar capability. And at a pretty good value too. I, in no way, intend to compete with that.
pdfruth:

Neat work! I want one. I also understand why you don't want to go into the manufacturing and distribution business.

With that said, I'd bet that if you contact the nice folks who make the Speedo Healer http://www.speedohealer.com/eng/intro.htm at

Sales Inquiries:
sales@healtech-electronics.com
Product Inquiries:
info@healtech-electronics.com
Technical Support:
support@healtech-electronics.com

that they would be happy to make these for you/us. They have a version of your Gear Indicator for Suzuki and Kawasaki bikes (http://www.gi-pro.net/), but not for Hondas. I suspect that they would be happy to pass on to you some form of gratuity.

Just a thought.

Marshal
 
Re: My home-built DIY gear position indicator - includes plans

Sa-weeet! It's a real kick to read about situations like this, where someone gets curious and does something really cool.

John
 
Re: My home-built DIY gear position indicator - includes plans

Pat,

Looks like you just gave me a project to work on this winter. Thanks for laying the groundwork!

:bow1: :bow1: :bow1:
 
Back
Top Bottom