ATMega168 Tachometer help using LM2907 chip

Hey all i am trying to make a tach that i can read the cars RPM's. I am only looking for the chip to see what the RPM's are and not display it out to the user.I've draw up how i think it should be hooked up but I'm still now 100% sure.

I am using the LM2907 chip and tapping into the tach wire from the ECU of the car. I'm looking at it as if the RPM's are 200+ (200,300,400,...1000, whichever) then the car is started. I would guess that any number above 50 would be considered started as 0 would indicate that the engine is not running. I'm checking because i will be remote starting the car and need to know when the stop cranking it.


http://www.national.com/ds/LM/LM2907.pdf (Page 8)

Any help would be great! :slight_smile:

David

Hi,
if your tack wire is already giving pulse.
Just make sure it is 0-5Volt signal and directly enter it on pin 2 or 3 and make a interrupt on raising.
you could easily make it work without the LM chips

Doest all tach wire give out pulses in DC? I'd rather use the LM2907 since its designed to do stuff like this.

What do you mean "make a interrupt on raising"?

David

What do you mean "make a interrupt on raising"?

Check out attachInterrupt() from the reference: http://www.arduino.cc/en/Reference/AttachInterrupt

Hi,
if your tack wire is already giving pulse.
Just make sure it is 0-5Volt signal and directly enter it on pin 2 or 3 and make a interrupt on raising.
you could easily make it work without the LM chips

I would like to use the analog input to detect this. Could i use a 4.7u capacitor between the analog pin 1 and the tach wire?

David

it would be probally a resistor and a cap!
But for the value it depend on the PWM of the signal, the time on vs time off.

it would be probally a resistor and a cap!
But for the value it depend on the PWM of the signal, the time on vs time off.

Still don't get teh PWM stuff. It seems safer using the LM2907 chip.

David

Hi StealthRT,

I was able to get a crude tacho hooked up using the following code and a simple voltage divider:

/*
Tachometer circuit:

Low tension from distributor >---24k-o-> input 2
                                     |
                                    11K
                                     |
                                     0v
  
*/

volatile int tachCount = 0;
long time;
long rpm = 0;

void setup()
{
  attachInterrupt(0, tachPulse, RISING);
  time = millis();
}

void loop()
{
  //Runs every 1/4 second
  if (millis() - time >= 250)
  {
    // rpm = number of interrupts counted in 250ms
    //  *4 to make per second
    //  *60 to make per minute
    //  /2 for 2 pulses per rotation (4 cylinder)
    //  /10 for some reason???
    rpm = (((tachCount*4)*60)/2)/10;
    
    //Do things with the RPM value here (update display etc)...
    //

    tachCount = 0;
    time = millis();
  }
}

void tachPulse()
{
  ++tachCount;
}

I'm waiting for a couple of chips (bootloaded Atmegas) to finish the project (with a nice display etc) and I haven't added prtoection to the input (zeners etc) yet.

Hope it helps,

Easty.

Easty: thanks for your example and code :slight_smile:

The input 2 would be an analog or digital input?

Wouldn't the LM2907 chip already handle all those resistors and such?

David

I was using it as a digital input and using the interrupt as suggested by the earlier answers.

I'm not sure if the chip you're looking at would remove the need for another components as I have no experience with them.

For me a 2 resistor voltage divider and a zener to protect it from over voltage seemed like the simplest option.

I imagine that if I ever finish the project and make up a board it would save a ton of space as well!

Easty.

Alright let me know if this looks like what it should :slight_smile:

David

I think the zener goes in parallel with the 11k to ground...

I know there are some posts on here about protecting inputs.

I'm in the middle of cooking dinner but here's a link to a bit of really bad quality video I took on my phone last year of it working with just the resistors and without a zener (I didn't damage the board as I'm still using it!)

Video

Well i found this as well

Seems to be the same thing-maybe. You think this would work better? Seems it uses the LM324 chip instead.

David

updated the drawing.

David

That worked for me without the zener, the resistor values were made up of odd ones I had lying around using the formulas here:

I can't guarantee it won't damage yours though!

It's been many years since I played with all this stuff and so I'm on a learning curve of my own!

StealthRT, did you get the tachometer to work. If you did what was the final solution.

\Frisken