Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Motorcycle gear indicator

Status
Not open for further replies.

thejonesyboy

New Member
I'd like to build a system that displays the current gear, based on the ratio of engine speed to wheel speed.

I've decided that the final solution will run on an Android IOIO board with a connected Android phone used as the display, but for now I'm just tackling the tacho / engine speed measurement problem.

Connecting an oscilloscope to a wire wrapped around one of the two ignition leads (capacitive pickup) shows a spike wave, spaced at ~75ms (13.3Hz) with a peak of about 100V. Given a wasted spark condition (spark also fires during exhaust phase), this correlates to 400rpm.

View attachment 66228

It doesn't matter that there is a secondary interference pulse, I plan to correct this if it is detected by the microcontroller.

Ideally, I'd like to convert this signal into a square wave with 50% duty cycle, and the same frequency. A microcontroller might not have a high enough sampling frequency to detect the rise and fall of the short spike (Android IOIO definitely does not), so delaying the fall time would make it detectable as a digital signal. I know I won't be able to produce a perfect square wave from this, but I need some ideas as to how to approach it - for example, if with a parallel or series capacitor then what capacitance and why?

I know I might have to make considerations for over voltage protection with a zener diode or equivalent.

There a many other threads here with similar issues, but many seem to approach it using zero crossing detection which wouldn't really help here.

Hoping that someone can give me an idea, and some constructive criticism would be great too :)
 
If you don't need a symmetrical wave you can just use a 555 one-shot with the period shorter than the time between maximum RPM pulses from the engine.

If you actually need 50% duty-cycle (I'm don't see why), then you could use a divide-by-2 flip-flop after the one-shot. But that reduces the frequency by 1/2, of course.

So take your pick.
 
Last edited:
If you don't need a symmetrical wave you can just use a 555 one-shot with the period shorter than the time between maximum RPM pulses from the engine.

If you actually need 50% duty-cycle (I'm don't see why), then you could use a divide-by-2 flip-flop after the one-shot. But that reduces the frequency by 1/2, of course.

You're right - there's no particular need for 50% duty cycle, as I only really need a pulse width that stays within maybe %20 and %80 duty cycle across all possible input frequencies (rpm). I'll have a go at choosing an effective time constant for the 555 timer and see what happens.

I did some reading on the 555 timer in monostable mode. If I choose Vcc = 5V (for example), then my signal isn't really appropriate for direct connection to the TRIG input, because it expects a signal that falls from 5V to below 1/3 of Vcc and then back to above 2/3 of Vcc. I can get an inverted pulse from the pickup by reversing the connection, but I'd need to pull it up to 5V right? Am I on the right track to be thinking about using a pull-up resistor here? Then, the voltage would be normally be at 5V until a spike hits, and it would drop well below 1.666V (1/3 of 5V).

Thanks for your help!
 
Just trigger the 555 via a capacitor with a pull-up resistor. Vcc can be anything you like (within the spec limits).
 
Just trigger the 555 via a capacitor with a pull-up resistor. Vcc can be anything you like (within the spec limits).

Could you please explain the resistor/capacitor configuration a bit further? I understand that this would make the trigger input high when the input signal is zero, but for example if it spiked to -10 volts, then what happens? Aren't I in danger of damaging the Vcc source? This isn't really a normal case of using switched input with a pull up resistor is it?
 
If you actually need 50% duty-cycle (I'm don't see why), then you could use a divide-by-2 flip-flop after the one-shot. But that reduces the frequency by 1/2, of course.

I vote for the Flip-Flop. You get square waves and the 1/2 frequency is easier to work with.
 
Last edited:
I see no reason to invert it. In this application does it matter whether the positive or negative edge is used? We're only interested in the pulse repetition rate.
 
I see no reason to invert it. In this application does it matter whether the positive or negative edge is used? We're only interested in the pulse repetition rate.
The trigger input is not edge triggered, it is level triggered (which you undoubtedly know). You have the input biased up to vcc. A short, cap-coupled positive pulse will drive the input above vcc. The 555 triggers when the trigger input goes below vcc/3.
Maybe you intended to differentiate the pulse, but I don't think the values you used will do that with his pulse. The time constant is about 5 milliseconds. I suspect his pulse is narrower than that.
I suppose the OP can change caps until it works, if 10nF is too high.
 
Last edited:
It looks to me like his pulse needs to be inverted before being applied to the 555.
You may have to use a transistor or CMOS inverter for that purpose.
 
The trigger input is not edge triggered, it is level triggered
Quite right. Senior moment :eek:.
Maybe you intended to differentiate the pulse, but I don't think the values you used will do that with his pulse. The time constant is about 5 milliseconds. I suspect his pulse is narrower than that.
Perhaps so.
Just reverse the pick-up coil connections if pulse polarity needs to be changed?
 
Quite right. Senior moment :eek:.
Perhaps so.
Just reverse the pick-up coil connections if pulse polarity needs to be changed?
Unfortunately, there is no pickup coil.:(
Connecting an oscilloscope to a wire wrapped around one of the two ignition leads (capacitive pickup) shows a spike wave, spaced at ~75ms (13.3Hz) with a peak of about 100V.
See attached.
 
Last edited:
a wire wrapped around one of the two ignition leads
Ok, so not a coil.
Your circuit looks better than mine Roff; pulse width is less critical. +1.
 
Here is a solution that won't require a timer.

It uses the gear shift lever to count up and down.

Every motorbike has a built in zero gear switch, enabling the engine to be started if the gear box is switched to neutral, thus preventing accidents at engine start.

The switch should be connected to the counter circuit for reference gear = 0.

Two Hall switches are activated upon shifting gears up or down. The sensors are approximately 50mm apart.

One super magnet is glued to the shift lever. Every time the magnet activates a Hall switch the counter counts up or down.

Hall switches used are TLE4905 which will close to ground when ever they "see" the magnet South pole of the activator.

The software is available as source code and hex file. Standard setting is five gears, but may be changed by adapting the source file accordingly.

I found that little interesting circuit at Elektor and designed single sided PCB layouts for it.

You might want to use that circuit for your application and not use timer circuits which might easily mess up the result.

You might select either one of the two displays, one being 13mm and the other one 10mm.
 
Here is a solution that won't require a timer.

It uses the gear shift lever to count up and down.

Every motorbike has a built in zero gear switch, enabling the engine to be started if the gear box is switched to neutral, thus preventing accidents at engine start.

The switch should be connected to the counter circuit for reference gear = 0.

Two Hall switches are activated upon shifting gears up or down. The sensors are approximately 50mm apart.

One super magnet is glued to the shift lever. Every time the magnet activates a Hall switch the counter counts up or down.

Hall switches used are TLE4905 which will close to ground when ever they "see" the magnet South pole of the activator.

The software is available as source code and hex file. Standard setting is five gears, but may be changed by adapting the source file accordingly.

I found that little interesting circuit at Elektor and designed single sided PCB layouts for it.

You might want to use that circuit for your application and not use timer circuits which might easily mess up the result.

You might select either one of the two displays, one being 13mm and the other one 10mm.
This is useless without the code and a description of how the circuit works.
I am baffled as to how the CD4026 can count up and down. I'll go out on a limb and say that it can't.
Furthermore, unless only one segment is on at a time (?), the single current limiting resistor in series with the cathode pin will cause brightness to be a function of the number of segments being driven.

Can you provide links?
 
Last edited:
This is useless without the code and a description of how the circuit works.
I am baffled as to how the CD4026 can count up and down. I'll go out on a limb and say that it can't.
Furthermore, unless only one segment is on at a time (?), the single current limiting resistor in series with the cathode pin will cause brightness to be a function of the number of segments being driven.

Can you provide links?

Hello Ron,

very nice and extraordinarily polite. I just tried to get the attention to a circuit which will work without timers. Using timers for gear indication depending on engine rpm is certainly the wrong way - especially driving in mountainous terrain! Do you agree?

The CD4026 is a multistage Johnson counter decoding the outputs for a seven segment numerical display.

Of course the display would be of equal brightness if there was a current limiting resistor for each segment.

A live circuit built for my friend doesn't show significant brightness changes if six (numeric 0) or just two (numeric 1) segments are being driven. The indicator counts to the valid gear indication as soon as the shifter returns to the neutral position, which is the position after the gear definitely has changed.

If the OP is interested he might contact me using the PM function to provide his email address to send him the source and hex-file. He might go another way and find the circuit at ELEKTOR paying for it. ;)

The circuit description is easily to understand by reading the net names on the schematic. The CD4026 does of course not count down. That's why it receives a RESET while shifting gears. With every movement of the shift lever the counter starts at zero when shifting to a lower gear.

I won't provide links in order to leave some work to you.

Last not least I wonder how a forum member with 7,512 posts has such a negative attitude.
 
Hello Ron,

very nice and extraordinarily polite. I just tried to get the attention to a circuit which will work without timers. Using timers for gear indication depending on engine rpm is certainly the wrong way - especially driving in mountainous terrain! Do you agree?

The CD4026 is a multistage Johnson counter decoding the outputs for a seven segment numerical display.

Of course the display would be of equal brightness if there was a current limiting resistor for each segment.

A live circuit built for my friend doesn't show significant brightness changes if six (numeric 0) or just two (numeric 1) segments are being driven. The indicator counts to the valid gear indication as soon as the shifter returns to the neutral position, which is the position after the gear definitely has changed.

If the OP is interested he might contact me using the PM function to provide his email address to send him the source and hex-file. He might go another way and find the circuit at ELEKTOR paying for it. ;)

The circuit description is easily to understand by reading the net names on the schematic. The CD4026 does of course not count down. That's why it receives a RESET while shifting gears. With every movement of the shift lever the counter starts at zero when shifting to a lower gear.

I won't provide links in order to leave some work to you.

Last not least I wonder how a forum member with 7,512 posts has such a negative attitude.
I didn't realize I was projecting a negative attitude. I just didn't understand how it works.
I do now realize that the brightness doesn't change much between characters because the primary current limiting occurs in the output drivers of the CD026.
I also figured out how the counter "counts down".
Regarding the links, I don't really give a flying frick, but people who are actually interested in building one might. I did a little Googling before you reamed me, but I couldn't find it.
Thanks for the warm fuzzies.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top