0
Offline
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« on: March 15, 2009, 09:49:33 pm » |
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  Any help would be great!  David
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Full Member
Karma: 0
Posts: 185
Arduino rocks
|
 |
« Reply #1 on: March 15, 2009, 11:20:38 pm » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #2 on: March 15, 2009, 11:30:38 pm » |
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
Full Member
Karma: 0
Posts: 164
Hello World
|
 |
« Reply #3 on: March 16, 2009, 12:40:40 am » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #4 on: March 16, 2009, 03:20:53 pm » |
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
Full Member
Karma: 0
Posts: 185
Arduino rocks
|
 |
« Reply #5 on: March 16, 2009, 05:59:12 pm » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #6 on: March 16, 2009, 10:08:51 pm » |
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
Full Member
Karma: 1
Posts: 114
|
 |
« Reply #7 on: March 17, 2009, 03:57:37 am » |
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.
|
|
|
|
« Last Edit: March 17, 2009, 04:00:48 am by Easty »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #8 on: March 17, 2009, 01:46:15 pm » |
Easty: thanks for your example and code  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
Full Member
Karma: 1
Posts: 114
|
 |
« Reply #9 on: March 17, 2009, 02:17:21 pm » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #10 on: March 17, 2009, 02:28:59 pm » |
Alright let me know if this looks like what it should   David
|
|
|
|
|
Logged
|
|
|
|
|
Bagshot, UK
Offline
Full Member
Karma: 1
Posts: 114
|
 |
« Reply #11 on: March 17, 2009, 02:38:30 pm » |
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
Full Member
Karma: 1
Posts: 114
|
 |
« Reply #12 on: March 17, 2009, 02:57:41 pm » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #13 on: March 17, 2009, 02:58:12 pm » |
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
Full Member
Karma: 0
Posts: 127
Arduino rocks
|
 |
« Reply #14 on: March 17, 2009, 03:01:40 pm » |
updated the drawing.
David
|
|
|
|
|
Logged
|
|
|
|
|
|