Pages: [1] 2   Go Down
Author Topic: ATMega168 Tachometer help using LM2907 chip  (Read 4253 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-cool

Any help would be great! smiley

David
Logged

Montreal
Offline Offline
Full Member
***
Karma: 0
Posts: 185
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Patgadget
Montreal

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

U of A, Tucson, AZ
Offline Offline
Full Member
***
Karma: 0
Posts: 164
Hello World
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
« Last Edit: March 16, 2009, 03:21:46 pm by StealthRT » Logged

Montreal
Offline Offline
Full Member
***
Karma: 0
Posts: 185
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Patgadget
Montreal

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Bagshot, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi StealthRT,

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

Code:
/*
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.
« Last Edit: March 17, 2009, 04:00:48 am by Easty » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Easty: thanks for your example and code smiley

The input 2 would be an analog or digital input?

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

David
Logged

Bagshot, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright let me know if this looks like what it should smiley


David
Logged

Bagshot, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Bagshot, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 131
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

updated the drawing.

David
Logged

Pages: [1] 2   Go Up
Jump to: