• Required reading for all forum users!!!

    Welcome!
    Register to access the full functionality of the GSResources forum. Until you register and activate your account you will not have full forum access, nor will you be able to post or reply to messages.

    A note to new registrants...
    All new forum registrations must be activated via email before you have full access to the forum.

    A Special Note about Email accounts!
    DO NOT SIGN UP USING hotmail, outlook, gmx, sbcglobal, att, bellsouth or email.com. They delete our forum signup emails.

    A note to old forum members...
    I receive numerous requests from people who can no longer log in because their accounts were deleted. As mentioned in the forum FAQ, user accounts are deleted if you haven't logged in for the past 6 months. If you can't log in, then create a new forum account. If you don't get an error message, then check your email account for an activation message. If you get a message stating that the email address is already in use, then your account still exists so follow the instructions in the forum FAQ for resetting your password.

    Have you forgotten your password or have a new email address? Then read the forum FAQ for details on how to reset it.

    Any email requests for "can't log in anymore" problems or "lost my password" problems will be deleted. Read the forum FAQ and follow the instructions there - that's what we have one for...

  • Returning Visitors

    If you are a returning visitor who never received your confirmation email, then odds are your email provider is blockinig emails from our server. The only thing that can be done to get around this is you will have to try creating another forum account using an email address from another domain.

    If you are a returning visitor to the forum and can't log in using your old forum name and password but used to be able to then chances are your account is deleted. Purges of the databases are done regularly. You will have to create a new forum account and you should be all set.

Arduino Tachometer - How to interface w/ ignitor?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Guest
So I have a grand dream of being an electronics whiz, so I tend to dream up projects but never follow through with them when I realize my knowledge just isn't there. This might be yet another one of those projects :)

I found this post going over the use of an Arduino module that has a digital display, LEDs, and multiple buttons.

led1ss.jpg


And after watching the video at the bottom of that page, this would be an awesome way to implement a tachometer, gear indicator, and even fuel level meter (could even do a speedometer) using all of the stock sensors.

http://youtu.be/Rdv0iFGwMco

Now, there are multiple ways that the AVR microcontroller (MCU) on the Arduino can interface with the ignitor unit (well, off of the coil input). One option is an external frequency to voltage converter (read through the data sheet on the LM2907 and got lost), which then gets read on an input to the MCU. Another is to connect the coil input directly (through a voltage divider or something) to an input pin, then poll it or set an interrupt. The code will then calculate the frequency.

However, this is all pointless unless I know how the ignitor works. I read the sticky thread by kokar which is pretty impressive. I know the ignitor on the GS650 is different, but it is pretty much connected the same way. To me it seems that ignitor powers up the primary coil by opening up a ground connection (+ is always connected to the coil), and it uses the signal from the signal generator to know when to close the connection, causing the coil to fire to the plug. If this is the case, couldn't I just check how often the (-) side of the coil is pulled low? Will I have any scary voltage spikes on the primary coil circuit? It's at this point that I tend to get lost when people start talking about how to get a reliable voltage value on an input.

I've done AVR programming before, so I have that covered. I'm just hoping to figure out a simple way to obtain a frequency signal without having to get a degree in electrical engineering. Any help would be appreciated!
 
Look into tapping the wire that comes from the signal generator. I think that's what the call it they sensor at the crank. A certain auxiliary tach I used found a signal there. (A SportVue MC1, speedo works, tach display is so useless I disconnected it.)
 
I'll have to figure out what type of signal is being generated though. Maybe I'll pick up a cheap digital oscilloscope and see what's going on.
 
However, this is all pointless unless I know how the ignitor works.
It works by grounding and un-grounding the ignition coil. Some units also have the advance curve built into them as well, but that has no relevancy on what your intended purpose is.
 
I'll have to figure out what type of signal is being generated though. Maybe I'll pick up a cheap digital oscilloscope and see what's going on.

Have you looked at the open source DSOs? They're cheap enough that I'm tempted to pick one up just in case.
 
I think generally anything on the primary side is going to be close to a low duty cycle square wave between 0-12V but there are positive and negative spike above and below this.

I did quite a bit of signal conditioning for the Innovate MotorSports LM-2. Basically that device has the tach signal going into a counter input of a embedded processor. On the LM-2 there is some signal conditioning but in addition to that I did some clipping between ground and 5V.

The LM-2 manual is available on line and there are some instructions on how to condition the signal. Unfortunately I cant find any of the scope traces that show input and output and the forum over there (where it was all posted) is shut down.
 
I think generally anything on the primary side is going to be close to a low duty cycle square wave between 0-12V but there are positive and negative spike above and below this.

I did quite a bit of signal conditioning for the Innovate MotorSports LM-2. Basically that device has the tach signal going into a counter input of a embedded processor. On the LM-2 there is some signal conditioning but in addition to that I did some clipping between ground and 5V.

The LM-2 manual is available on line and there are some instructions on how to condition the signal. Unfortunately I cant find any of the scope traces that show input and output and the forum over there (where it was all posted) is shut down.

This is great info, thanks! It's those swings outside of 0-12v that scare me, as I don't know how input pins in the microcontroller will handle them. Looking at the LM-2 manual, they seem to only suggest using a potentiometer (variable voltage divider) on the tach input. Maybe this would be enough.
 
Can't you slap a zener diode on the inputs or use an opto-isolator?
 
To make your application a little more universal, why not just trigger it from the ground side of the coil? :-k

Regardless of whether the bike has points or electronic ignition ("igniter"), the coils have a constant supply of 12V at one terminal and the ground terminal is switched, so it is intermittent.

Just remember that there is nothing "magical" about the ingiter, it is simply a box of transistors that do the switching of the coil ground wire, instead of mechanical points.
Except for the later units ('83 and up?), that is all that happens in the igniter box. The newer units also did the ignition advance.

Reading your pulsed signal at the coil would then not matter which type of system you have.

.
 
To make your application a little more universal, why not just trigger it from the ground side of the coil? :-k

That's what I plan to do now. Now I just need to figure out how to do it. And despite this being basic electronics, like I said, I pretty much don't know anything, so it's amazing how long it takes me to think through this stuff.

From the MCU datasheet:

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.

And reading about pull-up resistors here...

img1i.jpg


if I have this right, if I enable the pull-up resistor on the input pin, it should read HIGH whenever the ignitor ("button" in the image above) disconnects the primary coil circuit (firing), and read LOW whenever the primary coil circuit is connected (charging).

Would the only other thing to do then is add a diode between the input pin on the ground side of the coil to prevent current from flowing into the input pin? (well, actually out of the input pin - that positive/negative thing always confused me).

I apologize if this is not the right place to discuss this stuff, or if it's too elementary. One site forum that has a lot of information is allaboutcircuits, but they prevent people from talking about anything automotive related.
 
...
I apologize if this is not the right place to discuss this stuff, or if it's too elementary. One site forum that has a lot of information is allaboutcircuits, but they prevent people from talking about anything automotive related.

Oh, this is the right place, all right. Carry on.

Myself, I'm interested in this thread because I sometimes daydream of an all-Arduino gauge cluster that compares a combination accelerometer and GPS speedo against wheel speed to monitor tire pressure. Readouts would be stepper-driven needles, possibly with digital displays to supplement.

Just a daydream of course. I have far more ideas than time and money, so I have to live vicariously through others.
 
I've also been thinking about building a microcontroller based system for the GS bikes.

I recently got a low end Owon DSO (http://www.saelig.com/PSBEB100/PSBEB100005.htm), so now I can start exploring the electrical system. It'll probably be a few weeks before I can really dig in, but I'll make sure to post everything up here when I do.

JonnyC: The description you have of the ATmega pin is correct, and you'll want to use a Zener clamp to limit the voltages going in (http://sound.westhost.com/appnotes/an008.htm).

The design I've been thinking about has a central brain that controls everything. I wanted to do a custom PCB that can be mounted somewhere near the battery, and allows connections from each of the different sensors (fuel gauge sender, brake light, headlight switch, etc) and the various outputs (headlight, taillight, turnsignals, etc).

The second piece of the system would be the gauges. I've been trying to find an older speedo/tach that I can modify to use steppers. If I don't find that, I'll end up using LEDs and a shift register.

The two pieces will talk with each other via a common bus (UART or CAN). The cool part is that then I can build different displays that would just use the same data from the brain.

Sorry if I hijacked a bit, but this project just got me excited to start my own!
 
I recently got a low end Owon DSO (http://www.saelig.com/PSBEB100/PSBEB100005.htm), so now I can start exploring the electrical system.

Very sweet! I keep trying to think about how the primary coil induces voltage and what effects it has, but there's no better way than just looking at what happens. It would be great if you could post your results.

JonnyC: The description you have of the ATmega pin is correct, and you'll want to use a Zener clamp to limit the voltages going in (http://sound.westhost.com/appnotes/an008.htm).

Ugh, I've been looking at that and other links for a while now, but I still don't get it. For some reason it is very difficult for me to think conceptually when it comes to electricity.

Sorry if I hijacked a bit, but this project just got me excited to start my own!

No problem! Your project is way more ambitious than mine, but it will let me learn a thing or two.

So I found this link that talks about connecting up to the primary coil circuit, and I looked at the Megasquirt link posted. I'm starting to understand the use of an opto-coupler (no need to worry about voltage swings affecting the MCU), but what's odd to me is that instead of using (+) Vcc to power the opto-coupler allowing the TCI to be the ground switch, they are sourcing (+) from the coil when the TCI switch is open (firing the coil). Maybe they needed it to be reversed (input pin LOW when TCI switch is open)? It just seems odd to even involve the coil as that's one more part you need to factor into the equation. There's a very good chance I've interpreted it all wrong though ;)
 
I will absolutely post the results that I get!

Ugh, I've been looking at that and other links for a while now, but I still don't get it. For some reason it is very difficult for me to think conceptually when it comes to electricity.

The best description that I've heard for Zeners is that basically, when the voltage difference across the Zener goes above the breakdown voltage, they no longer act like diodes and instead conduct.

Assume that Figure 2 from the link is using two Zeners each with a 10V breakdown voltage.

an008-f2.gif


If the output voltage is between -10V and 10V, then no current will flow to GND because the Zeners act like normal diodes. As soon as the output tries to go above 10V, ZD1 starts to conduct (ZD2 also conducts in that direction), so current flows to GND until the voltage on the output goes down to 10V. In reverse, when the voltage tries to go below -10V, ZD2 starts to conduct (ZD1 already conducts in that direction), and the voltage is limited to -10V.

This effectively limits the output to +/- 10V.

The alternative is to use a single Zener like this:

a3H2q.png


This should limit the output to -0.65V - 12V (for a zener with a 12V breakdown).

I'm really looking forward to seeing what the COIL- voltages look like to see if they're a good candidate for connection to a micro.

EDIT: I also found this, which gave a great description of the tach inner workings.
 
Thanks (better late than never) for the explanation powderhound. I did more reading on Zener diodes and diodes in general, and I'm understanding them now. At first I didn't understand how the last example allowed negative voltage output, but realized the diode has a forward voltage of about .7v.

I just ordered an ARM DSO Nano for ~$65, so I will be able to inspect the primary coil when I get my bike up and running.

I got my Arduino and display unit, and have a basic RPM calculator using an external switch on an interrupt to simulate the primary coil circuit. Not working so hot because the signal is so crappy (major switch bounce), but I'm not going to bother doing any type of RC filtering if the primary coil signal is close to a square wave. Although it might not hurt either so that it's more universal. I'll be excited to use the signal generator of the DSO to simulate the primary coil circuit.
 
Well I got my DSO Nano and used the signal generator to test the tachometer. Working well so far, although I need to build in some smoothing. I might have to truncate the output resolution down to 3 or 4 digits, as when you're in the 10k RPM range there's no need to know the exact RPM.

I'll be excited to measure the coil signal with the DSO, but I still have a lot of work to do before I get the bike wired up and running.
 
What signal are you using right now? I'd love to see how you've wired everything up.

It sounds like you've made a ton of progress. Unfortunately, it's going to be a while before I can get our scope hooked up to the bike as I just ripped out the carbs and airbox for a rebuild and then got slammed at work.
 
Back
Top