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

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

What do I have to do to get the pre programmed PIC and a display?

Send me a PM with your mailing address, and we'll get it worked out

Also, where did you pic off the info from the bike's electronics??
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. Look for a black connector that 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.

Neat way you get the info into the chip. While reading the thread I thought you would use a eprom burner or some such.
The program logic itself is burned into the PIC's on-board flash eeprom program memory using something akin to an eprom burner. But it's much faster than the old days. And infinitely more re-usable. Actually not infinite. The device spec sheet says it's good for 100,000 re-program cycles.
The PIC16F88 has 256 bytes of on-board EEPROM data memory. And you can write your code in such a way so as to store real-time data, at runtime, into that area of storage. If you look at the source code, you'll see a routine called "WriteEE". This is the instruction sequence for writing data to the on-board EEPROM data memory. The chip itself has an on-board flash eeprom burner (of sorts) that you control via manipulation of certain special function registers (look at the program for the instruction sequence and registers). The way I've written the program, I use 8 bytes of that memory to store the information gathered during the "learning" process.
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

well, I might be buying a second micro from you because I like the added "possible" option of a photosensor...
 
Re: My home-built DIY gear position indicator - includes plans

well, I might be buying a second micro from you because I like the added "possible" option of a photosensor...

The microcontroller is re-programmable. If there are updates to the code in the future, you can;
1) Erase and re-load the flash program memory (if you have the software and PIC programmer, or know someone who does)
2) For a couple $ postage, send it back to me and I'll do it, then send it back to you.
 
Re: My home-built DIY gear position indicator - includes plans

PD way cool. Your project makes my home brew electric jacket controller and aux led light projects look like mud pies.

..mud pies.. :D I know what you're talking about, DAS. Reminds me of this old Dilbert comic I have on the wall in my office:

(you might have to click on image if you can't read it clearly)

<<edited out copyrighted material>>

And yes, PD, way cool!
 
Last edited by a moderator:
Re: My home-built DIY gear position indicator - includes plans

I bet that's exactly what the photo cell does.

Honestly, I seldom do any night riding, so I never really gave much consideration to the brightness of the LED display at night (duuuuhhhh :eek:: ). My main concern was making it bright enough to see on bright sunny days. But, that super bright LED is sooooo bright that it is likely going to be tooooo bright in night time riding conditions. I mean that thing so bright, it lights up my whole shop if I turn off the shop lights.

So, here's a great new innovation to add to the project.

I can think of a couple ways to do this using a photo cell.
1) Put a photo-cell in series with the common anode leg of the seven segment display.
2) Use one of the MC's unused pins (fortunately there is one available) as an analog input pin, and use the MC's on-board A/D converter to compute the ambient light conditions based on the voltage drop across the photo-cell. The resulting A/D conversion would then be used as an input to the routine that turns on the segments of the seven segment display. The routine that turns on the seven segment display's segments could easily be altered to vary the duty cycle of the "on time" for those segments (right now they are just "always on"), effectively dimming them by only turning them on for a short while every few microseconds. Because of the phenomenon called "Persistence of Vision", the human eye does not see this on/off flickering. It'll just appear to be a little dimmer.

#1 probably won't work. The photo cell would have to dissipate too much power. Maybe some of the EE's in the crowd could chime in here.
I think I'll play around with option #2 this weekend. I'll let you know what I come up with.

Great idea... thanks Hashimoto

Ok, so I spent some time fiddling around with algorithms for option #2 over the holiday weekend. I did eventually get something working. But it was just too non-deterministic. Ultimately, I decided on a blended software and hardware solution.

Using a standard cadmium sulfide photo-cell (got a 5-pack of em from Radio Shack), I set up a simple voltage divider made up of a fixed value resistor (10k), and the photo cell. The junction of these two components is connected to pin 1 (AN2) of the PIC. The software configures the AN2 pin as an analog input pin, and routes it to the internal A/D converter. Depending on the ambient light conditions, the voltage will vary anywhere from a few tenths of a volt, up to 5 volts. Upon doing the A/D conversion, a number from 0 - 255 will be generated. 0 = intense ambient light. 255 = very low ambient light. Very simple, very easy.

The electrical charateristics of the photo-cell I'm using are; 100 ohms max light, 2 megaohms min dark.
But anything in the <10K max light, >1M min dark, range should work just fine.

Rather than varying the duty-cycle of the display's on-time, I decided to use another transistor as a switch that controls the amount of current flowing thru the seven segment display. When the sensed ambient light is intense, the transistor is turned on, allowing the display to draw more current (thus making it very bright). When the sensed ambient light is low, the transistor is turned off, forcing the display current to flow thru a current limiting resistor (thus making it dimmer). The transistor is controlled via software that controls the logic level on pin 2 (RA3) of the PIC.

An A/D conversion is done on the ambient light sensor approximately every 100 ms or so. The code that does the A/D conversion of the ambient light sensor, includes an algorithm that computes a rolling average of the last 16 samples (so over a period of about 1.5 - 2 seconds). This provides a measure of hysteresis, and helps prevent false triggers, such as might be the case if a car headlight briefly falls on the sensor at night.

Due to variability in the electrical characteristics of cadmium sulfide photo-cells, not to mention rider preferences, I decided to add a "learn" feature to the code. Much like I did with gear ratio "Learning" process. This gives each individual rider the ability to set the ambient light level threshold at which he/she wants the display to switch from bright to dim. To activate the ambient light level "learning" feature, the motorcycle must first be turned on and in neutral. Simply holding the "learn" button down for one second will cause the current ambient light conditions to be locked in (i.e. stored in EEPROM) as the threshold from that point forward. This can, of course, be changed at any time, and as often as you want.

It's kinda cool... I've modified one of my prototypes, and it's sitting here on the kitchen table. We have a dimmer switch on the light above the kitchen table. So I can raise and lower the intensity of the light. I've set all kinds of different thresholds. I raise the ambient light's intensity, and the seven segment display shines brightly. I lower the ambient light's intensity and the seven segment display intensity lowers.
I also hooked it up to the ST this afternoon, for a sanity check. A quick regression test confirms that it still correctly indicates which gear the ST is in. And the display intensity changes, as it should, if I push it out onto the driveway, and then push it back into the garage. I just wish I could take her out for some real-world night time riding now... Oh well, guess I'm just gonna have to wait till spring :(

Anyhow, for V1.3 of the code, aside from the addition of the code for handling the ambient light sensor, the rest of the code remains largely unchanged. I did clean up a bunch of typos, fixed readability/formatting issues, and corrected a bunch of errors in the code comments. See the opening posts of the thread for updated schematics and source code.
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

Wow... Way, way over my head... but way, way cool... You going to 'go into business'? :D
:cool:
 
Re: My home-built DIY gear position indicator - includes plans

... I just wish I could take her out for some real-world night time riding now... Oh well, guess I'm just gonna have to wait till spring :(

Well, if you need a Winter time beta tester, I guess I could sacrifice myself for the good of the cause. :)

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

You know, this is a really nice gift to the community here - p. You picked an appropriate time too - gift giving season. Thanks again.

Just so I understand about the new photo-cell "Learning threshold". When you say the current lighting threshold is locked "from that point forward", is that considered the minimum light level at which the transistor is turned on to make the seven-segment LED bright? And anything darker than the threshold will turn off the transistor, causing the LED to be go into dim mode?

If this is the case, I would think you'd want to teach it in dusk-like conditions, like in your garage with the door open, or with your hand semi-covering the photo-cell (i.e. no direct sunlight). This would make it stay bright in diffused lighting situations, so it wouldn't be too sensitive (and wouldn't switch to dim mode too quickly), like when riding past a building that casts a shadow over the bike. I like the idea of using the rolling average to help keep the brightness stable from spurious fluctuations.

This is an elegant, practical device you've come up with. Thanks for sharing it with us! :bow1:
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

If you come to Florida to escape the cold this winter I'd be more than happy to let you experiment on my ST1300...you can even ride it.

Unbelievable the skill levels of folks on here...I can hardly boil water..Congratulations on your ingenuity..I wish I had that kind of talent.:bow1: :bow1: :bow1:
 
Re: My home-built DIY gear position indicator - includes plans

You know, this is a really nice gift to the community here - p. You picked an appropriate time too - gift giving season. Thanks again.

Just so I understand about the new photo-cell "Learning threshold". When you say the current lighting threshold is locked "from that point forward", is that considered the minimum light level at which the transistor is turned on to make the seven-segment LED bright? And anything darker than the threshold will turn off the transistor, causing the LED to be go into dim mode?

If this is the case, I would think you'd want to teach it in dusk-like conditions, like in your garage with the door open, or with your hand semi-covering the photo-cell (i.e. no direct sunlight). This would make it stay bright in diffused lighting situations, so it wouldn't be too sensitive (and wouldn't switch to dim mode too quickly), like when riding past a building that casts a shadow over the bike. I like the idea of using the rolling average to help keep the brightness stable from spurious fluctuations.

Exactly. Right on all accounts. I think you've got it. ;)
 
Re: My home-built DIY gear position indicator - includes plans

When I did the in-dash install of my Digi gear indicator, I de-soldered the light dependent resistor for the PHOTO-CELL and replaced it with a 2K ohm resistor. This made the display run at full bright at all times and looks perfect, night or day.

:04biker: :)
 
Re: My home-built DIY gear position indicator - includes plans

Obviously, you have a talent for this and I totally get it when you say,"Im not in a position start mass producing.." Thanks for sharing.
Oh one more thing, I want one too.
 
Re: My home-built DIY gear position indicator - includes plans

Wanted to add also... Very Impressive! wish I had the time etc to get involved in something like that.

On the note of "just try to upshift, you'll know what gear yer in"... or the "just count the shifts" :

Most dont' have a big problem with the 5th gear thing, but myself for sure (and others I'd bet), around town, lots of traffic keeping you busy watching etc... upshifting downshifting quite a bit, I found coming up to a corner... am I in 2nd or 3rd?

I dont want to downshift to 1st, too low of a gear, and if I'm in 3rd I dont want to lug the engine around the corner... so yeah, a gear shift indicator is the shiznit.

That said, why hasn't Honda done this? Yamaha has one on the fjr? Here this guy goes to all this work and gets one to work, very impressively too, but why are any of us havring to go to so much trouble? Really they need to fix that.

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

That said, why hasn't Honda done this? Yamaha has one on the fjr? Here this guy goes to all this work and gets one to work, very impressively too, but why are any of us havring to go to so much trouble? Really they need to fix that.

Regards,

Because guys like me do not want just another gizmo that could fail. It's not important for me to know what gear I am in since it's all by feel for me anyway (don't snap out the clutch, ever!)
 
Re: My home-built DIY gear position indicator - includes plans

My 1978 Suzuki GS750E had a digital gear indicator, and I thought it was a nice feature. Hmm...that's about 30 years ago!

I generally watch the relative positions of Tach needle vs Speedo needle and can tell where I am...but I still liked the indicator better.

Anyway, nice work on your project.

My head hurt after the first few sentences, so I don't think I'll be a candidate to take this project on.

If it hits the market, I'm in!

Regards,

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

sheesh.......rocket science...(i got a headache just reading the techno stuff)

very impressive project to say the least...

as i was carving the twisties today out in the hill country i never once thought about what gear i was in :D


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

Great job PDFRUTH.

Not trying to offend anyone, but it never seizes to amaze me that someone can spend his time and effort to come up with a variation of a gearshift indicator. Something that is loooooong overdue on the ST. What’s more incredible is that this remarkable individual took his time to share his project with all of us (for free I may add) by providing detailed schematics and a list of parts.

Yet, there are some of us, who for whatever reason, vehemently insist and find all kind of justifications as to why the gearshift indicator is not needed. I’d rather have it and not use it, then not having it and whishing that I did. I bet that if it came standard with the bike, every one of us would use it (a lot).

Did I say “Great Job PDFRUTH”? I’ll say it again “Great Job” and thanks for sharing you project with us. Maybe one day ST will have it as standard.

Have a Happy, Healthy and Prosperous New Year everyone.
 
Last edited:
Re: My home-built DIY gear position indicator - includes plans

Great job PDFRUTH.

Not trying to offend anyone, but it never seizes to amaze me that someone can spend his time and effort to come up with a variation of a gearshift. Something that is long overdue on the ST. What’s more remarkable is that he took his time to share his project with all of us (for free I may add) by providing detailed schematics and a list of parts.
Thanks Kinzer1... and all well-wishers

Yet, there are some of us, who for whatever reason, vehemently insist and find all kind of justifications as to why the gear indicator is not needed. I’d rather have it and not use it then not having it and whishing that I did. I bet that if it came standard with the bike, every one of us would use it (a lot).

No worries. It's all good.
It was not really my intention to start a holy war here... but then I guess I left the door open, didn't I :)


Indeed, I myself, have been riding for upwards of 35 years now. I've never had a gear indicator on any of my bikes. And I've never really felt a need for one either. That is, until last season. There were a couple times, riding the RC51 at the track, I really wished I had one ;)

As I stated in my opening post. This little project was simply a means to an end. I wanted to educated myself on Microchip's PIC family of microcontrollers. I needed a real-world application. And I wanted to have something useful to show for it. I picked this one. It's been a great learning experience. One I wanted to share with others who may also have similar interests, and need a place to start.

While interesting... To debate the merits of having a GPI, or not, is most likely a never ending debate. Everyone is likely to have an opinion. And no one's opinion is wrong.

So, It is my sincere hope that this thread stays focused on innovative ways to improve the project. And based on the PM's & emails I've been getting, it sounds like it has already sparked the imagination of other techno junkies out there. Exactly what I was hoping would happen. :D

I'm keeping an open mind. The possibilities are endless.

I'm REALLY looking forward to trying this thing on my RC51, at the track, next season.
 
Re: My home-built DIY gear position indicator - includes plans

I'm going to attempt to build one just for the fun of making it. It's not that I really need it, but I think it might be cool to make and have. I haven't done any circuit work for over 30 years so it will be interesting to see if I can do it without making a mess of it. I should have all the parts soon.

Anybody know of a box made just for seven segment displays 1" x 3/4"? I notice the Digi-gear system has the display mounted in a small box.

Or where to get thin red acrylic I can make my own display holder?

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

Yeh, you’re right. It’s all good. I’ll keep checking this forum for when your design becomes available and I’ll be the first to buy it.

Safe riding.
 
Back
Top Bottom