NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Inductive tachometer

November 11, 2010
by Chaosrider
Chaosrider's Avatar

Hi,

I just bought a small airplane and that got me started on a project idea. It is an ultralight with no instruments and I wanted to add a tachometer to it. It is a twin engine plane so I would have to make a dual tachometer but one step at a time.

Here are my ideas so far: I would like to follow the principle of a small device called TinyTach that use a wire wrapped around the spark plug wire as a sensor (voltage to the spark plug create a voltage in the wire through induction). Since I don't know the voltage that would create, I was thinking of using a clamping circuit as this one : http://www.falstad.com/circuit/e-diodelimit.html then, I thought of using a zener diode to further regulate that voltage then feed it to the controller.

The thing is that seems to be a bit too simple. Do you think that would work ?

November 12, 2010
by BobaMosfet
BobaMosfet's Avatar

Chaosrider-

The sparkplug wire itself could be dealing with 35K to 50K Volts. A spark must overcome the air-fuel 'resistor' to complete the circuit, and sufficient voltage is required to do this. Is your sparkplug powered by a magneto, or coil/capacitor combo? You might be able to tell specifically what the voltage rating is from that unit's rating information.

As long as you use an insulated conductor, and wrap it around the plug-wire only 2 or 3 times, it as an inductor, cannot create a very large field- so should be quite safe.

The current induced in the inductor will create a pulsed DC voltage (half a sine wave- the positive half). As such, all you're really looking for is a way to count those pulses over a specific period of time (per second, per minute, per hour, etc). This makes this a relatively easy operation, because amplitude really doesn't play a factor. then display the information on an LCD or 7-segment read out.

Note that this is a digital approach. If you did it solely analog, you would rely upon the induction field to actually move a needle, just the way an analog meter works, against a calibrated scale.

The reason the digital approach is easier in this case, is because you don't know the voltage in the wire, so you cannot create a calibration scale. Furthermore, you have RMS issues to consider either, with the digital approach. You just want a count.

I would recommend getting a count across your smallest reasonable time-frame; like every second, and then simply extrapolating for higher time-frames. You could run a background task that also counts for higher time-frames, but as such it is not responsive to the user- it's timeframe after all is its minimum response granularity. But it could then be used as a self-check at each of its intervals to see if the smaller extrapolation is accurate or needs a skewing 'on the fly'

BM

November 12, 2010
by BobaMosfet
BobaMosfet's Avatar

Chaosrider-- one more thing, I meant to mention. If you want to see what voltage is coming off of your induction coil, put a capacitor in series with one leg of the inductor (Creating an RL circuit). Then set your meter to the highest setting and put it across the free leg of the inductor and the free leg of the capacitor. This is to help smooth out the ripple and (essentially) give you a rough RMS voltage. If we knew other factors, frequency and so forth, we would adjust the capacitor. I would recommend maybe something in the uF range for your initial test.

If your meter doesn't register anything, lower the scale on the meter and test again. If you lower it all the way and get nothing- something else is going on. Otherwise, at some point, you should see your meter climb to a steady (if bouncy) voltage.

Engine must be running so be careful.

BM

November 12, 2010
by Chaosrider
Chaosrider's Avatar

Are you saying it should be possible to plug the sensor wire directly to the controller or was my circuits with the diodes correct?

What is the voltage limit for the controller on the input? I saw in the datasheet VIH wich is VCC+0.5V would taht be correct?

Thanks again for your help

Michael

November 12, 2010
by BobaMosfet
BobaMosfet's Avatar

It is possible IF you can design the inductor so that output voltage is less than 5V. You should (ideally) make it so you are registering millivolt (mV) levels.

If you use a zener, it will consume atleast 1V itself, but is a poor way to cut voltage down (there are trade-offs). But remember you are NOT dealing with the actual voltage on the spark-plug wire. You are dealing with a FRACTION of it generated through an electromagnetic field. We're talking Webbers and Henrys here.

Unfortunately, because I don't know enough electrical specifics about your ignition path, I can't work the math for you to calculate the exact number of turns, the voltage ratio and so forth.

The main thing you need to do, is determine how MUCH voltage you're getting from the induction coil to

  • determine what range is actually there,
  • determine a scale of calibration based on what voltage rating is received, and
  • limit the output voltage down to within 5V (if necessary).

Cool project. Not difficult, but very cool.

BM

November 12, 2010
by Chaosrider
Chaosrider's Avatar

The thing is I would like to make it kind of universal (be able to use it on multiple different engines) and I think the actual voltage registered at the coil would vary depending on the engine and engine RPM so I think a voltage limiter would be prefered.

I am not very advanced in electronics and that is why I came up with the diode setup. Wouldn't the Zenner give me a predictable voltage given that the input is at least a certain voltage (say I want 5V out, I would need at least 10V in) so if it is not reading on a particular setup I could just do a couple more turns around the spark plug wire.

What would be a better way to do it? I saw on avr freak a guy who dit it with a quad op-amp and further someone suggesting the clamping circuit wich is what pointed me in this direction.

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59962&highlight=snowblower

The next step would then be to create the program to read dual input, and then drive 2 quad digit 7 segment displays (I tought of using AND gate to select the panel and digit to activate to limit pin usage) and the finale step would be to include 2 temp sensors for EGT through ADC and send result to either 7 seg displays or LCD.

November 12, 2010
by Ralphxyz
Ralphxyz's Avatar

Chaosrider said:

"The thing is I would like to make it kind of universal (be able to use it on multiple different engines) and I think the actual voltage registered at the coil would vary depending on the engine and engine RPM so I think a voltage limiter would be prefered."

Taking this one step at a time and my understanding of what you are trying to do is limited to the conversation so far and very little electronics knowledge (I have gotten shocked moving around some some spark plug wires).

As far as making your sensor coil Universal all you want to be seeing/sensing is the pulsing voltage at the coil, which probable will be small . Wrap a spark plug wire and do as BobbaMosfet said with a capacitor get a voltage reading. RPM should not matter the pulse will just be faster or slower depending on rpm. Once you have a voltage reading (pulse), which should be typical, then you can decide how you want to feed it to the mcu.

A different engine might not even require any changes. I believe you could also get a DC clamp-on Ammeter probe instead of wrapping wire, though I'd like to hear that just wrapping a wire worked. It probable would make a difference with how tight or loose you wrap the wire.

My 2¢ on a interesting project.

Ralph

November 13, 2010
by BobaMosfet
BobaMosfet's Avatar

Chaosrider,

I've thought about this some more, and a few things come to mind:

  • You just want to know when a pulse occurs; amplitude is of no concern
  • You need it to be limited to within 5V for the MCU

Since amplitude is of no concern, it doesn't really matter how you limit the resultant pulse, so long as you don't damp it out of existence if it is smaller than some threshold (for example, a zener consumes about 1V in operation, so if a resultant voltage on the induction coil were less than that, you wouldn't see the pulse at all using zeners).

However, we're actually talking about a voltage value of 35K to 50K on the spark plug wire, along with commensurate current (could be 500 amps). The induction coil used to monitor the pulse should (if done properly) carry that voltage as well (or very close to it), but the coil physics will directly limit the amount of current taken from the field. (Please excuse my previous posting regarding small voltages, I was thinking about current. You're still dealing with Webers and Henry's, but the voltage could/should be significant).

If you can find a zener to handle the high voltage, and clip it to no more than ~5 VDC without itself being fried, you can do this. A very small capacitor probably wouldn't hurt (.1uF).

You can still get a nasty little zap from it without a limiter (like the zener), so you want to be careful.

BM

November 13, 2010
by BobaMosfet
BobaMosfet's Avatar

Chaosrider-

Given where you're at knowledge/skill-wise with electronics, there is a better, cheaper, easier approach and it will do exactly what you want- direct input into the ADC on the ATMEGA168.

Use a Hall Effect Sensor. Linear, ratiometric, bipolar. My personal recommendation (as I have lots of these, is the A1321 (by Allegro). Run you about $1 per depending on where you find them, perhaps less.

No messing with induction, clipping, etc. Just put a bypass capacitor between its leads and see if that won't do what you need. Since I have all the parts for this, I'm building one now. Just got the schematic done.

BM

November 13, 2010
by Ralphxyz
Ralphxyz's Avatar

The discussion on AVRfreaks is very interesting.

"Briefly, the antenna is ac coupled to a unity gain op amp, which is biased to 2.5 V, as it is powered by +5 & Gnd, (Not bi-polar). The signal is clamped by 2 diodes to a max of +/- 0.7 V. The next stage, ac coupled, has a gain of -10. The last stage is a comparator, and converts the pulses to 0/+5 V pulses. "

Also suggested was using a Hall Effect sensor like BobaMosfet suggested.

This sure is intriguing it really has my curiosity peaked, I think I am going to have to try this out.

Ralph

November 13, 2010
by BobaMosfet
BobaMosfet's Avatar

I built one using the Hall sensor, today-- works FANTASTIC.

BM

January 28, 2011
by huzbum
huzbum's Avatar

The hall sensor, it just detects the magnetic field of the voltage in the plug wire, or are you using it with a flywheel or something?

I am building a similar device (I have the program working, using ICP1 to calculate RPM of each revolution) I was going to use a wire coiled around the plug wire, (which produces about 20-50 volts on my motor cycle) but a hall sensor sounds more reliable.

What kind of hall sensor are you using? Do you suggest anything specific?

May 08, 2011
by Chaosrider
Chaosrider's Avatar

Just tought I would give an update.

I kept the sensor portion for the end and went ahead with the code. I think I am mostly done with some little things to be done but here is how I made it so far :

I planned to use the sensro schematic from AVRFreaks so I must assume inputs need to be debounced to 1 ms resolution.

I plan to use standard nerdkit LCD for now

Each "beats" trigger an external pin interupt and increment a counter.

I debounced the input by setting a bit to 1 the first time the interrupt fires and the setting up a timer to 1ms to reset it to 0. If the bit is set (1), the counter does not get incremented.

I read the "beat" counter in an interupt on a timer set to 1hz. So that gives me a count of beat for the last second that i can then multiply by 60 to get a RPM value.

I simply update the display in my main() loop twice per second (500ms)

I will try to share the code as soon as I find somewhere to post it There is still some work to be done but I think most of the logic is there.

May 08, 2011
by Chaosrider
Chaosrider's Avatar

Just got around to sharing it :

http://ubuntuone.com/p/rir/

That adress should give you my complete code folder.

I use Eclipse so it does not include a proper MAKEFILE and I would have to research how to link multiple files but I don't think it would be very hard.

May 08, 2011
by Ralphxyz
Ralphxyz's Avatar

Great Chaosrider, got it!!

I have not looked at your code yet but thanks a lot, lots of people here need RPM monitors.

Ralph

May 08, 2011
by Chaosrider
Chaosrider's Avatar

Just keep in mind timers and pins are made for the teensy board but it should be pretty easy to adjust to nerdkit.

I will keep that link updated as I go but there is minimal work left to do, mostly testing

In any way, post any question you may have.

May 08, 2011
by Chaosrider
Chaosrider's Avatar

Finaly got some real testing done tonight.

It is good to see my logic was sound and just needed some adjustments. What is left to do now is to find a solution for the debouncing problem.

On my test rig(another MCU(actually my nerdkit) programmed to send pulses similar to what I expect to see from the engine), I get mostly the result I expect but keep getting parasite "beats" wich makes the value fluctuate. Also, I need to tweak the debouncing to get my target maximum RPM.

I should be able to post my updates for everyone to see later tomorrow.

Michael

May 09, 2011
by Ralphxyz
Ralphxyz's Avatar

Yeah please keep us posted.

For my Weather Station project I will be using a IR photodetector to generate the pulse. I do not believe I will have to worry about de-bouncing. I can actually look at the signal with my scope now to see how much noise there is.

I have not look at your code yet, are you using PB0 for your pulse input? If so there is built-in debounce filtering.

15.2.1

The Input Capture Register can capture the Timer/Counter value at a given external (edge triggered)
event on either the Input Capture pin (ICP1) or on the Analog Comparator pins (See
”Analog Comparator” on page 244) The Input Capture unit includes a digital filtering unit (Noise
Canceler) for reducing the chance of capturing noise spikes.

Also I do not know how much bounce you would get from a Hall Effect Sensor.

I got some hall effect sensors but I could not comprehend anything I was getting from them.

I wanted to have an alternate rpm sensor method.

Ralph

May 09, 2011
by Chaosrider
Chaosrider's Avatar

I will certainly be checking out the hall effect sensor.

My debouncing problem is the input I expect to be getting from my "antenna" is multiple pulses lasting about 1ms so that would be my debouncing period.

I will try to do some more math and get accurate values for my timers to debounce at this interval.

If the hall sensor can get rid of that, that would solve the issue entirely.

Also, you should re-download the code on the link above since to get the modifications I made yesterday.

As I said, it is running on a teensy board with the test_mcu file being for the nerdkit (wich is my "engine simulator" right now).

Right now as it is, it does kind of work up to maybe 7000 rpm with some variation (I would say +- 1 beat so 60 rpm). For my purpose that would be an acceptable tolerance.

The thing is for my purpose I need at least 2 RPM inputs plus maybe later on 2 to 4 ADC input for temp sensors and maybe a timer so I cannot simply disable the interrupts to debounce but for a single input that may work better.

Does anyone else use teensy board? I think they are a great step from the nerdkit (wich is a better first step IMO to know how all the parts work together) as it makes for a cleaner setup.

From here here is the plan : Tweak the debouncing timer some more to get as accurate reading as possible. Create a MAKEFILE to compile it all together

Then I think it would be trivial to change it to work on a nerdkit as I did not notice any significant difference between the ATMEGA32U4 and the ATMEGA168.

May 14, 2011
by Chaosrider
Chaosrider's Avatar

Hi,

Update on my progress. Looks like I will need to rethink my debouncing technique. As I suspected for some time, the debouncing interval is fine but the timing of the input pulse vs the debouncing timer is causing the problems. At this point, I am thinking of either use one debouncing timer per input, which I think would amount to a lot of hardware per channel or doing some debouncing logic in the main loop with delays instead of timers.

In this case, access to an oscilloscope was VERY helpful in finding the cause as I can trigger an output pin on my different interrupts and have a look of what gets fired when vs my input.

May 14, 2011
by Chaosrider
Chaosrider's Avatar

Got it working now with a slightly different method.

I think if I really wanted I could use one less timer but since it's there, I'll just keep using it.

The slight variation I get now (+- 1 beat = 60 rpm) might be because of my polling intervals, I'll look into it.

I should be able to update the online version shortly with my changes.

May 18, 2011
by Chaosrider
Chaosrider's Avatar

Ok so here is the deal right now.

My new methods gives a blanking interval of 1-offset +1 ms interval (offset is delay between the timer "tick" and the actual input) so I have a theorical maximum blanking interval of 2ms (offset = 0) giving a theorical maximum input of 30 000 rpm which is well above my design target of 10 000.

Now I still have a slight variation of +- 60 rpm which I attribute to my polling interval. I will try to tweak that then adjust my main loop a bit and I should have a pretty functionnal product.

Once that is done, I will post my finished code and keep you updated.

After that comes the hard part (for me) : designing the input circuit and PCB and packaging all that nicely.

September 23, 2011
by Chaosrider
Chaosrider's Avatar

Ok, I know it's been a while, but I finally have been able to work again on this project

I think I got mostly done with it as far as design is concerned. I settled to debounce my input with a 555 timer (1 per input channel), with a monostable setup so basically, I adjust it to give me the proper trigger period (in my case about 1ms), and use it's output as my input on the controller.

All that is left to do is build the input sensor circuit (wich have been shown on a previous link)

So in the end, it's pretty much the code I posted earlier, but with all the debouncing routines commented out.

Of course, I still have to test it real world, but I think my simulator (the nerdkit is used for that in my current setup) is pretty good (it actually produces ringing for as long as I want, so gives me a good test for my debouncing filter).

September 23, 2011
by Chaosrider
Chaosrider's Avatar

Ok now I am lost. During testing I encountered a very strange bug. On first boot, the value of my RPM var gets trashed (way too high) but after a soft reset (basically, reprogramming the teensy board), everything is normal up to the theorical limit of my input (13 000 rpm, limited by my 555 timer)

Any idea what would cause that ?

Post a Reply

Please log in to post a reply.

Did you know that NerdKits also has extra parts available for its customers? Learn more...