How do I know if the engine is running (Auto Headlight Switch working)

Started by SK Racing, June 04, 2021, 06:51:58 AM

Previous topic - Next topic

SK Racing

I realize that I may get some funny answers, but I'll risk it. :icon_lol:

Is there a way to get a signal somewhere on the GS500 when and only when the engine is running? I.O.W. when the speed is above cranking speed.

I've been measuring the voltage of one phase of the alternator, but the R & R is messing me around. The alternator output (one phase) drops from about 11.9V to 4.9V once the battery is fully charged - at idling speed. I'm measuring AC volts in case someone is wondering.

You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

The Buddha

That's why they recomend testing the alternator without R/R plugged in.
I dont believe you can separate cranking from running in any case. Maybe with a ignition advancer that has only the dwell modified to be say 12 degrees at 1200 rpm, without the static advance of stock you would have literally rpm based advance so a 300-400 cranking rpm would result in 3-4 degree advance. However with that advancer you'd have a bike that may not even start.

Now, a CA advancer has the thing set to 5 degrees. Those do start the bike, and the instant it idles I'll bet the dwell based is 12 degrees. So you have likely 8 degrees at cranking rpm and 17 at idle.

Someone who knows more about this can correct me. IIRC the CA advancer is 5-28, and the 49 state is 12-28. So the interpretation I have is, 5 degree minimum set by angle of slot to the nose. Then the dwell based advance is added to it peaking at +28 about 4000 rpm. So at 300 rpm CA would be around 7 degrees while 49 would be 14 degrees. At 1200 rpm CA is ~15 and 49 is 22.

Someone who knows better pitch in please.

Cool.
Buddha.
-----------------------------------------------------------------
I run a business based on other people's junk.
-----------------------------------------------------------------

SK Racing

Thanks for your reply, Buddha. The reason that I want to know when the engine is running is for something else, not for advancing the spark timing. So, most of what you wrote is of no concern to me. But you did confirm my latest idea - of using the spark signal.

While I was waiting for replies I did think of maybe picking up the spark signal from the igniter unit and counting the number of signals during a predetermined time slice - measured in milliseconds. If it exceeds a certain number of signals during that time slice, I can then deduce that the engine has started. Kind of how an electronic tacho works. I'll be using a microprocessor, so measuring, sensing and doing calculations will all be possible.

If anyone has any other ideas, I'd like to hear about them.

Btw, the reason for this is to switch the headlight on only when the engine is running, and having it off while starting - all done automatically. That part of my circuit is already working fine. I'm using a Mosfet to do the switching.
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

Bluesmudge

#3
Microprocessor and GS500 do not mix. I think you are over-thinking this. The 2006+ GS500 wiring already cuts off power to the headlight while starting, so you should just copy that from an '06+ wiring diagram. There is a headlight cutoff wired to the starter button so that any time the starter is running the headlight is not.

Another option, If you have a bike with an oil cooler, you could also wire in a hydraulic pressure switch to the oil cooler line. Have it trigger a relay for the headlight that passes current if oil pressure reaches the correct value.

mr72

I think if I read correctly, you want the headlight to go off when the key is on unless the engine is actually running, right? So the starter cutout won't get the job done.

I mean, if you really want to do this, and make it analog, then you can do it using an RC circuit (capacitor and resistor), and either a comparator or you can use your MOSFET. Use the ignitor output signal. Tune the RC time constant so that the voltage only stays above the comparator voltage when the frequency is high enough for the engine to be running, say over 500Hz. Comparator output goes high only when the input signal is above threshold voltage.

You could use a uP but why? analog will work.

SK Racing

Quote from: Bluesmudge on June 04, 2021, 08:40:35 AM
Microprocessor and GS500 do not mix. I think you are over-thinking this. The 2006+ GS500 wiring already cuts off power to the headlight while starting, so you should just copy that from an '06+ wiring diagram. There is a headlight cutoff wired to the starter button so that any time the starter is running the headlight is not.

Another option, If you have a bike with an oil cooler, you could also wire in a hydraulic pressure switch to the oil cooler line. Have it trigger a relay for the headlight that passes current if oil pressure reaches the correct value.

My GS is a 2004 model with oil cooler, but I would rather do it electronically - not with hydraulics.

I like playing with microprocessors (Arduino) and actually had the headlight auto switch working before, but due to the varying voltage output of the alternator, it is not reliable.

I will check out the 2006+ wiring diagram. Thanks for the heads up.  :thumb:
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

mr72

You can still feed your arduino with a comparator output, or a transistor, or whatever, based on an RC time constant coming from the igniter. It's just a DAC... or you can step it down and use a frequency counter in code.

SK Racing

#7
Quote from: mr72 on June 04, 2021, 08:53:48 AM
I think if I read correctly, you want the headlight to go off when the key is on unless the engine is actually running, right? So the starter cutout won't get the job done.

I mean, if you really want to do this, and make it analog, then you can do it using an RC circuit (capacitor and resistor), and either a comparator or you can use your MOSFET. Use the ignitor output signal. Tune the RC time constant so that the voltage only stays above the comparator voltage when the frequency is high enough for the engine to be running, say over 500Hz. Comparator output goes high only when the input signal is above threshold voltage.

You could use a uP but why? analog will work.

Yeah, thanks for the analog idea. I'd rather use Arduino code ported to an ATtiny85 because I can make it really small. As I said, most of the circuit is working. It's just the voltage divider part that measures alternator voltage that is unreliable. I'd rather write C code than mess with a comparator.

Who said microprocessors and GS don't mix? What do you think is inside the Igniter? (That was meant for Bluesmudge)  :icon_lol:
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

SK Racing

Quote from: mr72 on June 04, 2021, 08:53:48 AM
I think if I read correctly, you want the headlight to go off when the key is on unless the engine is actually running, right? So the starter cutout won't get the job done.

That is exactly what I want. I've also built in a 3 second delay so the headlight only goes on after the engine has started properly.
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

mr72

Quote from: SK Racing on June 04, 2021, 09:08:52 AM

Yeah, thanks for the analog idea. I'd rather use Arduino code ported to an ATtiny85 because I can make it really small. As I said, most of the circuit is working. It's just the voltage divider part that measures alternator voltage that is unreliable. I'd rather write C code than mess with a comparator.


Sure. Then use the 12V igniter signal through a divider or better yet a transformer to step it down to 3V or whatever you can handle on the microprocessor, probably also with whatever signal conditioning you need to not blow up your microprocessor. I'm pretty sure I'd put a zener on it.

Bluesmudge

Quote from: SK Racing on June 04, 2021, 09:08:52 AM
Who said microprocessors and GS don't mix? What do you think is inside the Igniter? (That was meant for Bluesmudge)  :icon_lol:

Yeah I know the GS isn't 100% analogue but its pretty close. Personally, I wouldn't want to make it any more digital but it sounds like this is a fun project for you. This thread has gotten over my head so I'll just be watching from here on out.

sledge

Quote from: mr72 on June 04, 2021, 09:56:11 AM



Sure. Then use the 12V igniter signal through a divider or better yet a transformer to step it down to 3V

A DC transformer?.....so where can i get one?

:D

SK Racing

Quote from: mr72 on June 04, 2021, 09:56:11 AMSure. Then use the 12V igniter signal through a divider or better yet a transformer to step it down to 3V or whatever you can handle on the microprocessor, probably also with whatever signal conditioning you need to not blow up your microprocessor. I'm pretty sure I'd put a zener on it.

Both the Arduino that I use for development work and the ATtiny that will be used in the final product can handle 5V. So, you're right, the 12V signal will first go through a voltage divider and then a 5V Zener. That's all that's needed to not blow up the uP.

So I'll tap into the signal from the igniter for one cylinder and count the number of pulses in say 500 milliseconds (0.5 second). If normal cranking speed is about 400 RPM, as Buddha suggested, then I can expect 1.66 pulses for one cylinder per 500 ms period. If there are 2 pulses (480RPM) or 3 pulses (720RPM), then assume the engine has started and let the Mosfet switch on the headlight. That's easy enough.

Thanks to everyone who has replied so far. You helped steer me in the right direction.
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

SK Racing

I have to say that you guys are great. I was expecting some crazy suggestions. Like mounting a microphone near the exhaust and if the noise exceeded a certain level, then switch on the headlight.

That won't work because the headlight would come on if a HD passed within half a mile.  :icon_twisted:
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

chris900f

Since you have an 2004, could you tap the 5v signal tach signal and then program the Arduino to turn the headlight on at a specific rpm voltage, eg. above 1000rpm?

SK Racing

Quote from: chris900f on June 04, 2021, 12:58:10 PM
Since you have an 2004, could you tap the 5v signal tach signal and then program the Arduino to turn the headlight on at a specific rpm voltage, eg. above 1000rpm?

Now that is a good idea! Wow, thanks.  :thumb:  :woohoo:
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

SK Racing

Looking at the 2004 wiring diagram, I see there is a 12V wire going into the tach. Why is that? There is also a signal wire and a ground.

You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

chris900f

#17
12v is for the tach light and probably the base power for the tach needle and the signal wire B/R is the 5v tach send from the ECU


SK Racing

Quote from: chris900f on June 04, 2021, 10:00:14 PM
12v is for the tach light and probably the base power for the tach needle and the signal wire B/R is the 5v tach send from the ECU

Thank you.  :thumb:
You don't stop riding when you get old, you get old when you stop riding!
1939 Panther 600cc Single - Stolen, 1970 Suzuki 50cc - Sold
1969 Triumph Bonneville 650 T120R - Sold, 1981 Honda CB750F - Sold
1989 Suzuki GS500E - Sold, 2004 Suzuki GS500F - Current ride

chris900f

#19
No problem  :cheers:

SMF spam blocked by CleanTalk