Engine Tachometer Project!! need brainstromings plz

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greeting!!

As the topic shown above, my car's tachometer was not working anymore and, well, i'm the one that have been doing stuffs with AVR for a couple years. My last project was PID for mini CNC machine.

I got an idea to make a project to measure the engine RPM using AVR microcontroller after my car's tachometer was broken. Indeed, my car is 20+ years old. :wink:

First of all, I need to know that what AVR model would suit my requirements. I have to measure the ignition pulse from ignition coil's sensor and, actually, it was about 5000 to 6000 rpm, before broken. Then I think the microntroller should work at somewhat high frequency enought to capture it all.

Second, small is important. And right now I don't know yet that what is the voltage level of the ignition pulse and current, which was pushed thru the original sensor's line when the coil were ignited.

Third, low power consumption. I do not want my project to waste my batteries :?

If any of you have suggestion about my project, please tell me.

regards,
SCUD88

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Afaics ANY of the AVRs will suit you. You'll need a counter capable of >6000hz (=rpm). I think ALL the AVRs have "timers that count". The code will be minor for the RPM-part, so your display interface will be setting the requirements...

For example a multiplexed 4 digit LED display will take 11pins. But you can of course use a serially interfaced display driver (or a LCD display wit controller, or....)

Cheers,
Anders

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Arhhh

okay

now who else has been working with the car engine--ignition part recently.

I do need to know about ignition process and sensor.

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yess here we go

I have think about the spiky voltage too, but i don't know exactly how high. if it were as you said it could desrtoy my board also.

how could i deal with that?

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I'd go for a small ferrite: A winding or two for the ignition and a fitting number for your AVR input circuitry...
Never did tacho on a car though!

/Anders

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I have think about the spiky voltage too, but i don't know exactly how high. if it were as you said it could desrtoy my board also.

(1) The voltage waveform at the ignition coil terminal will first be at "system voltage", 14 volts.
(2) When the driving transistor conducts (or "points" close) the voltage will drop to near zero,
and stay there a short time, while energy builds up in the coil primary.
(3) When it is time for the spark, the transistor goes open (or the points open). The voltage
at the coil terminal will now rise to a couple hundred volts as the stored flux in the primary
unloads into the coil secondary, inducing a voltage high enough to fire the plug . The actual
voltage will be the voltage across the sparkplug gap divided by the turns ratio of the ignition coil.
This peak will last until the energy in the coil is expended, then the level falls back to 14 volts.
The cycle will then repeat for the next cylinder to fire. The actual peak voltage will vary
depending on the width of the sparkplug gaps, and "environmental conditions"
inside the cyclinders.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did this for hydraulic power take-off in diesel engine trucks and in addition to all the good advice above, I'd recommend debouncing the state transition. Just keep a counter variable for the interrupt that you increment each time you see the voltage high and decrement each time you see it low, then after the count reaches 8 (or so) declare that the voltage really is high and accept that as a low to high transition. Next reverse the same idea, and when the count is back to 0, it is a high to low transition. In my case this took care of a lot of diesel engine noise.

Good Luck,
Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if your car has a computer, you could use the flywheel sensor.

also its not a real biggy to get a relative safe signal from the ignition coil..
Use the ground connection of the ignition coil for sensing ignition repitation rate :)
That ground point will spike with about 0.5 to 2 volts. Throw that signal through a low pass buffer circuit, and feed it to a interrupt input/timer input or a 7400 series counter.

cheers

MY MICROCONTROLLER CAN BEAT THE HELL OUT OF YOUR MICROCONTROLLER /ATMEL

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a very simple idea..... ac couple the ripple from the alternator to the battery to an opamp and comparator. 6000 rpm is only 100Hz.... 10ms between revs, Thats a long time. You could poll for an edge, go out for a smoke, come back before the next edge. How you gonna display it? Graphics lcd? Text lcd? sin/cos aircore motor driven by pwm?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
ac couple the ripple from the alternator to the battery to an opamp and comparator. 6000 rpm is only 100Hz

Using the alternator as a tach generator will work, but the frequency is higher. An alternator spins
faster than the crankshaft (in a car, anyway) and it has multiple poles so the frequency can get
up into the khz range. Open it up and bring a lead right off of a winding for a good solid signal.
Probably easier just to use a lead from the ignition coil, though. I did that for a data logger on
a dragster.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the alternator is 3 phase, there are 3 humps to the battery for each alternator rev, and the alternator is faster than the crank by the pulley sizes.... but there is some integer relation between crank rpm and alternator pole humps....

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The alternator signal is used on early diesel vehicles, but they use an internal tap (maybe off one winding), problem is that the loading on the alternator changes the slip ratio, and it is hard to get precision or multi engine compatibility when having to allow for the pulley ratio.

The method I used, was to use a voltage divider between the coil negative and ground, in the order of 47k:47k (from memory, but you can work this out). Remeber to use appropriately rated resistor(approx 300V). The lower resistor has a 5V zener accross it, so what you get is a voltage signal between 0 and 5V, with the spike chopped off. Also you'll want a small valued cap (nF) to get rid of the uglies. I used the external interupt pin, but think that input capture would be better, definitely some form of software debouncing would be beneficial. Also pays to average the signal over say five revolutions just to remove the fluctation, especially a problem at idle.

If possible, best thing to do would be to take a signal from the crank angle sensor.

What are you using to display the RPM???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks to all good advices above.

Quote:
How you gonna display it? Graphics lcd? Text lcd? sin/cos aircore motor driven by pwm?

Quote:
What are you using to display the RPM???

Answer to these questions, probably be character-LCD 16*2.

Quote:
if your car has a computer, you could use the flywheel sensor.

To MaxK:
My car doesn't have a computer though, it's very old. 20years something.

Quote:
If possible, best thing to do would be to take a signal from the crank angle sensor.

To ashesman:
how can I get that signal? I mean where exactly I would get that signal from. Well, I don't really know much about the car engine stuffs. I think I'm gonna get many helps from my friends, who graduate from Mechanical Engineer--automobile--though.

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Right now, I've done with the display part, using LCD.

And what I'm gonna do next is to check my car out about where can i get the signal from, also how its conditions are--voltage, current, position, etc.

Well I'll get back to you guys as soon as possible.

I've got to work on Tuesday, Monday is Labour Day, it's off!!! It could take me a day or two.

Anyway any advices would be please for me. If you have seen any contents on the internet that might concern to my project, please let me know.

regards,
SCUD88

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you dont have a computer, you probably wont have acrank angle sensor. But thats not really important. If you have electronic ignition, then you need to determine if it is hall, optical or reluctor type. If its any of these, then use the pickup signal not coil negative, if its a points/breaker type system then you will have to use coil negative. If you can use the pickup then circuitry is simple. All you need is basic filtering and limiting circuitry for hall and optical, but for reluctor you will need an AC coupled zero crossing detector (which is simple too). you need to find out which one you have ... I did a reluctor project recently and measurement of RPM was great ...

Good Luck.

Ashley.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Silicon Chip magazine had such a device pulished in April 2000. It used a small PIC 16F84 - you can download the asm code from the magazine site. www.siliconchip.com.au (methinks).

The first hurdle is to process to tacho signal from the coil to get a good clean pulse. I normally use the capture feature to measure the period then use a 32 bit divide to get back to RPM (hz * 60) - you then need to low pass filter this value so it doesn't jump around too much. In fact you only need to work to 100 rpm increments unless you want super accuracy.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Silicon Chip magazine had such a device pulished in April 2000. It used a small PIC 16F84 - you can download the asm code from the magazine site. www.siliconchip.com.au (methinks).

I won't pay for downloads, that's too expensive. :D

ashesman wrote:
If you dont have a computer, you probably wont have acrank angle sensor. But thats not really important. If you have electronic ignition, then you need to determine if it is hall, optical or reluctor type. If its any of these, then use the pickup signal not coil negative, if its a points/breaker type system then you will have to use coil negative.

My car used points/breaker type and now wirings are very messy, this because my car went thru many different fixings and technicians. So they messes it up.

Today I'm trying to figure what line is what. Some lines came loose. Some were disconnected from nowhere. This is really a big problem for me. :shock: :shock: :shock:

But I got your guys' ideas, thanks.

"Chill out with Atmel Corp."
- Scud88.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Once you get your system running, you may want to put in a check to make sure you don't read a really high rpm, so, 20000 rpms. I designed a tachometer a year ago that measured rpm using the tach output from an ECU, and I found that there tended to be alot of high frequency noise on the output, so even at idle my tach would be pegged. A simple check to throw away any reading higher than 20000 rpms fixed it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI, I can tell you if your car have a points distribuitor (i'm prety shure because age) you need frist to clamp the boltage present on the (-) of the ignition coil, and it can be done whit a 100 ohms resistor and 5 volt zenner, also a tip, this is very noisy, may be good to use a shield wire if you do not want an auditive tach at the same time coming from your radio speaker.

frecuency. well remember.. rpm are a unit in minutes so yu have to do RPM max * (cyl) /60= Hz max, an in a 4 cyl engine is like 400Hz max @ 6000RPM, for a 6 cyl 600Hz@ 6000 RPM and for a 8 cyl 800Hz @ 6000.

this far I need some reply if this is helpfull to you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
If possible, best thing to do would be to take a signal from the crank angle sensor.

Quote:

To ashesman:
how can I get that signal? I mean where exactly I would get that signal from. Well, I don't really know much about the car engine stuffs. I think I'm gonna get many helps from my friends, who graduate from Mechanical Engineer--automobile--though.

If your car is 20+ years old, there is a good chance you don't have a crankshaft trigger in its stock form. I added a crankshaft trigger when I went through a distributor change.

Mark

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can always use an inductive pickup. Put it over one of your spark plug wires.

It is a good idea to use an opto-isolator to keep the CPU safe.

Info on getting an RPM signal from an engine:
http://www.megasquirt.info/ms2/p...

On page 2 of this PDF, on the bottom left, there is a circuit that the megasquirt uses to isolate the RPM signal from the CPU:
http://www.bgsoflex.com/v22/mega...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Last time I looked, the code download from www.siliconchip.com was free - you need to pay for the article download though. If you did decide to download the article, I dare say it would solve your problem as it has the exact circuit you require. Your choice - piss about waiting for someone to tell you the solution or pay a couple of $ for the real thing. I know of a few who have built these things and they're happy. Whilst it uses a PIC and the code sucks a little, the hardware is pretty solid. What is your time worth??