Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spark plug wire inductive pickup for RPM 4

Status
Not open for further replies.

ziploc

Aerospace
Apr 22, 2012
36
0
0
US
This is kind of a repeat of a very old thread:
I'm looking to read RPM on my paramotor (120cc two-stroke engine) with an Arduino. The part I'm particularly curious about is sensing the spark and conditioning that signal. As mentioned in the older thread, there are very simple tachs on the market that simply use a wire wrapped about 4 times around the spark-plug wire (with one end completely free). I've seen a few approaches to conditioning the signal, but it sounds like "itsmoked" had a slick approach that unfortunately didn't appear in the old thread. Hopefully he can chime in here.

Thanks in advance for any tips.
 
Replies continue below

Recommended for you

ziploc said:
I don't see how the points closing could cause a second spark, but I could be wrong. Also, the time between the first and second set of pulses does not change with RPM.

I find this all quite curious so set about modeling a very simple ignition circuit. See the attachment for circuit and results.
[ul]
[li]The battery is Vbatt and the series resistance limits the current in the coil to 3.5A (slightly lower than typical).[/li]
[li]The coil is K1. It has a typical 1:100 ratio and fairly typical leakage and primary inductance (maybe a little lower).[/li]
[li]The points are S2, driven with 50% duty at 260Hz. The condensor is C2 and is roughly typical value.[/li]
[li]S3 is a hack to allow a small current in the secondary during the "charge" (points closed) phase. Without it I couldn't get the primary current to rise quick enough.[/li]
[li]S1 is a very hacky model of the spark plug. It shorts to 5 Ohms when the voltage across it rises to 1120V. C1 then keeps it operating for a millisecond or so to simulate the ionisation effect.[/li]
[/ul]

The results show expected spark behaviour - at the moment the points open, the coil voltage shoots up to 1120kV at which point the spark plug operates (without the spark plug the secondary voltage reaches about 100kV). Spark plug voltage drops suddenly while it's operating, and the energy in the coil cycles until it dissipates.

When the "ionisation" voltage falls below 880V and the spark "extinguishes", something interesting happens. The small amount of energy left in the coil now appears as a large voltage across the spark plug. It's not enough to "reignite" the spark, but it's still a good 1kV or so. Since there is no conduction, this second spark plug voltage oscillates until the energy is all dissipated. The point in time this happens is entirely dictated by the SPARK threshold voltage.

The circuit model has plenty of flaws, but I think it's plausible that it's demonstrating something realistic.

So I think you're quite correct - my original suggestion that the secondary ringing could be caused by the points reclosing is probably baloney. But perhaps it is the spark extinguishing that gives rise the second ringing? Once the arc is established, I wouldn't actually expect a lot of voltage across the plug. If there's still energy in the coil however, and the distributor has not disconnected the plug, then a significant plug voltage ringing is plausible.
 
 http://files.engineering.com/getfile.aspx?folder=85efe436-87f0-407b-aadc-d7276e1f823a&file=ignition_circuit_simulation.png
That's very interesting. If I'm understanding you correctly, you believe that the first pulse is the actual spark. Then there's a significant gap, followed by ringing in the ignition circuit - not in the detection circuit.

I have to confess that I don't understand why there would be ringing when the voltage is below that which would cause the spark, but it does make sense in an intuitive way. I guess the current would flow back and forth trading current for electromagnetic field until it decays through normal resistive losses(?)

DISCLAIMER: whenever you read stuff from me that sounds like I don't know what I'm talking about... it's because I probably don't.
 
This is Eng-Tips but maybe we should go back to basics. I started with a NPN transistor because everyone has one and I don’t like tying an input directly to a micro. There is a chance that you could make it work without the transistor gain. I believe the first largest pulse is probably negative. The transistor circuit could be flipped upside down and a PNP used. Then a negative pulse would cause a positive pulse. The UNO can use either type of pulse.

The 100K resistor is there because the base should always be tied to the emitter with a linear resistance. With no bias the collector is at +5V except when a strong positive pulse is at the base. Increasing the bias, the 1 or 2M resistor makes it more sensitive. This could be increased for more gain till the collector voltage dropped to about 4V.
The pot and capacitor suggested on the input was to cause AC loading to reduce the gain so only the strongest positive pulses caused the collector to go to near 0V. Gain reduction could also be accomplished by reducing the 100K resistor to 10K or lower.

This bias could be increased until the transistor is fully conducting with the collector normally at 0V. Then a large negative signal at the base would cause the collector to go positive. This may be the best option requiring only a change in software.

The capacitor from the collector to emitter suggestion was to stretch the pulse. The transistor shorts out the capacitor then the pull up resistor charges the capacitor at a known RC time constant.

There are a dozen ways to do this, I can only guess at an approach. You have a test setup and a scope. Looking at the signal on the base should indicate what approach to take. Never assume anything with an emission system. My Ford DIS system fires two plugs at a time. One plug at each end of the coil. One gets a positive and the other a negative. For thaat reasin the correct plugs use platinum at each end of the electrode

 
Thanks again. There's a surprising amount I don't know still. I'm reading up on this business of biasing and gain setting in the manner you describe. It seems like it should be obvious to me, but it's taking me some effort.

Should I be asking these basic questions on a different part of the forum?
 
Should I be asking these basic questions on a different part of the forum?

No way man. Some of us are trying to crack the same nut, and hoping you get there first, so that we can follow! Any tool you need to use along the way is best picked up right here.

My own efforts with a 2917 tacho chip have utterly failed twice now. Probably always same problem; the system I'm trying to measure has a lot of "noise" and when the main signal dies off (probably due to my poor circuit design knowledge) the noise takes over, and the tach's output goes bonkers.

Thanks OperaHouse for the circuit diagram - I've got those components in my spare parts bin, too, so I'm going to give it a try. I don't have an o'scope though. My datalogger will show either garbage, or a steady proportional reading. We'll see.

STF
 
If it works at idle it will work better at higher rpm. Idle/low load is the lowest spark voltage. As compression pressures icrease the spark gap voltage has to inscrase. Ringing should stay at about the same voltage. Adjusting the bias voltage high so the transistor conducts all the time except when it picks up a negative pulse should eliminate a lot of noise.
 
Thanks again for all the great info. This project is on hold for me again as I'm completely focused on the upwind cart thing. This weekend and next we've got the North American Land Sailing Association out to observe our record attempts to go directly upwind faster than the wind. Hopefully we'll put that to bed and I can focus on this again.
 
If anyone is interested, and if you can (or want) to access the igntion coil, the megasquirt tach circuit Megasquirt works very well. The following are captures with the circuit connected to the coil on my Honda VT500 Ascot motorcycle. The Ascot has electronic ignition.

Scope In

Scope Out


 
Well, I've got the spark sensor working and I think it's reporting RPM correctly. But when I use it on my paramotor the LCD display goes completely bonkers. I imagine the noise of the spark is running through the circuit and doing horrible things. I'd appreciate any thoughts on how to solve this. I'm thinking an opto-isolator, but not sure if that will get rid of the high frequency content that's causing the trouble.

Here's the circuit as it stands now.
 
 http://files.engineering.com/getfile.aspx?folder=93921488-ed4f-4968-a11b-aa14361dabdc&file=As-built_circuit.gif
Looks like that attachment didn't work. Let's try this:

As-built%20circuit.gif
 
What makes you think it is reporting RPM correctly? What have you measured?

What LCD? How is the LCD connected?

You might be right, but at the moment it could be many other things too. Is the uC getting the signal okay? If so then it could be a grounding issue instead. Best to show the complete circuit, including the LCD.
 
I think it's reporting RPM correctly because I'm recording the time periods between pulses and they're now very well behaved. I've been meaning to put it back on the scope and verify the periods recorded are in agreement with the pulses I see - but it seems unlikely I'll find an error there. I'm also keeping a count of how many time periods fall outside of the expected range (of about 1K to 10K RPM). The count hovers pretty close to zero until I get the ignition simulator spinning faster than 10K. The "ignition simulator" is just a coil and distributor mounted on a board that I spin with a variable speed cordless drill. It's set up to spark on all 8 cylinders so it's very easy to get an equivalent single cylinder 10K RPM with the cordless drill.

This is the LCD display: "20 x 4 LCD, 5 volt, based on the popular HD44780"
Here is how the LCD is connected to the Arduino:

Display Arduino
------------- ----------------
1 (VSS) GND Arduino pin
2 (VDD) +5v Arduino pin
3 (contrast) output of pot (Gnd-to-5V)
4 RS Arduino digital pin 12
5 R/W Arduino digital pin 11
6 Enable Arduino digital pin 10
7 No connection
8 No connection
9 No connection
10 No connection
11 LCD Data4 Arduino digital pin 6
12 LCD Data5 Arduino digital pin 5
13 LCD Data6 Arduino digital pin 4
14 LCD Data7 Arduino digital pin 3
15 Backlight No connection
16 Backlight GND No connection

I'm pretty sure display pins 7-10 are optional data inputs. They currently have no connection and are not specified to be in use. Do you suppose I need to tie them high or low?

>> Is the uC getting the signal okay?

Yes. I can also stream the results to the laptop via USB serial comms - and that continues to show good results after the display has gone wacky.

>>it could be a grounding issue instead.

Interesting. Can you tell me more?

>> Best to show the complete circuit, including the LCD.

Do you mean a circuit diagram or a photo? I can try to provide either. The whole thing is haywired on one of those proto-boards with jumper wires - it occurs to me that all those wires could be behaving as antennas for all this high freq noise. Not sure how to handle that on a proto-board.

For now let me describe the basis of how the parts are hooked together...

I'm powering the Arduino from a 9V battery. The Arduino provides a regulated 5V output. I use the Arduino Gnd and 5V regulated output to the Vcc and Gnd rails of the proto-board. This is how I power the 555, transistor, display, etc. Does that make sense?

Thanks very much for any tips. If you think sharing power and Gnd between the transistor, 555, and display (and the shield of the ignition pickup wire) is the problem, could you suggest a cheap isolated supply to power the transistor? I would then keep that as a completely separate circuit that would communicate with the 555 through an opto-isolator.

Disclaimer - I'm a complete hack.

Thanks!
 
A 9 volt battery may not have enough capacity to power your display and processor and be sagging quite a bit under the load of the backlight. A typical 4x20 LCD draws about 5ma for the display and 60-100ma for the backlight. Another item to look at is the capacity of the regulator on the Arduino.
 
Thanks for the tip. I don't think that's an issue for two reasons. First, it works perfectly until I fire up the ignition system that it's measuring, and secondly because I'm not using the LCD backlight. But I can certainly measure the draw and voltage of the LCD and check the specs on the Arduino.
 
Pins 7-10 aren't needed in 4-bit mode. Once you tell the LCD you're in 4-bit mode, they're ignored, so it doesn't matter if they're floating.

The noise hypothesis seems unlikely: the signals are all relatively low impedance sources and relatively high impedance sinks, 5 volt, digital and fairly slow. You'd need a fair bit of noise to corrupt that. Additionally, you're conditioning your input signal from the coil so by the time it reaches the uC, it's just normal 5V signal. I think you'd actually have to wrap the lead from your coil around some of the other signal lines to get enough noise to cause a problem.

Grounding could still be a problem, because if your ground reference bounces up enough, the 5V signal will look like a 0V signal. Still, as long as you have a short ground wire between the uC and the LCD, it's unlikely. Have you connected the -ve terminal of the battery to the common of the spark generating circuit?

You could be right - perhaps isolating this and boosting that will help, but without taking some measurements it's hard to know! If you can get a CRO onto those signals to the LCD, things might be a lot clearer.

If you post the complete schematic we might be able to spot any likely areas for immediate investigation.

I've had lots of fun with the HD44780 family - sometimes it seems it's completely dead and then you swap the order of one particular instruction or something and boom, everything works!
 
Good job.....even if you did use a 555. So why didn't you ground the shield? I think the problem is all those leads acting as an antenna. Sticck your circuit in a plastic bag and then wrap some grounded aluminum foil around it.

Unrelated but a good story. I worked at this place and their ESD testing consisted Of two large contactors wrapped in foam doing a relay race and this vintage cattle prod. I had just finished a pump control using one of Microchips 8 pin micros running the internal clock. I actuall ran pump pressure data serially out a pin that operated the ON LED. I brough from home an old LSI blue pig and fitted it with an opto isolator to that pin. We all liked to destroy stuff so I had that cattle prod arcing to every place on that circuit board. Data just kept clocking out with no sign of a glitch. I was set on zapping it till something happened. Finally it did. I took out the opto isolated LSI pig. The micro kept on working. I have no hard data on it but it just seemed that the micros with internal clocks were a lot more stable than those with crystals.

 
Opera,

I thought that said "ESD testing consisted of two large contractors wrapped in foam doing a relay race and this vintage cattle prod." I was wondering how often you went through contractors, if you gave them hazard pay for the cattle prod work, etc. Didn't see the reason in them being big, maybe other than they couldn't easily catch you.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Sorry for the delay guys. I'll try to respond to your questions here. I sure appreciate the tips.

>> Grounding could still be a problem, because if your ground reference bounces up enough, the 5V signal will look like a 0V signal.

Hmmm... It's probably a 5" wire between uC and display Gnd. It's a skinny piece of wire that's routed through the rest of the jumble of wires around the Arduino and 555. The transistor and the coax pickup wire are on the other end of the proto-board at least a couple of inches away.

>> Have you connected the -ve terminal of the battery to the common of the spark generating circuit?

I've run it both ways. No noticeable difference.

>> If you can get a CRO onto those signals to the LCD, things might be a lot clearer.

I just tried my digital scope between the Vcc and Gnd pins on the LCD. I couldn't see any significant noise there. What I did find surprising is that it showed only about 3.7V when I was running the circuit from a decidedly tire 9V battery and about 4.75V when I was running the circuit from the USB cable from my laptop. The LCD display is being powered from the Arduino 5V regulated output.

>> If you post the complete schematic we might be able to spot any likely areas for immediate investigation.

I don't actually have a good way to draw a schematic. This is the basic circuit: I'll have to describe the rest. The Arduino is powered by either a 9V battery or the USB cable. It has a regulated 5V output. I simply use the Arduino Gnd and regulated 5V output to power the display, 555, transistor, etc. Basically those are my power and ground rails throughout.

>> So why didn't you ground the shield?

Good question. I actually got that wrong. The shield has always been grounded to the circuit. The other end of the shield has never been grounded. But I have tried also grounding the circuit to the engine or ignition simulator. That hasn't helped. I have since tried connecting the shield to the circuit ground through a 22 pF cap. I just thought I'd try capacitively coupling it so there is no DC connection at all to the engine. This didn't change anything. The circuit still performs well, and the display still gets wacky.

It turns out that the circuit far more unhappy when hooked up to my actual 2-stroke motor than when it's hooked up to the ignition simulator.

>> I think the problem is all those leads acting as an antenna. Stick your circuit in a plastic bag and then wrap some grounded aluminum foil around it.

Good call. I'll give that a try. What I have found is that the LCD display is fine when I don't have the spark sensing wire attached to the spark plug cable. I can leave everything right where it is, and the LCD has problems when I hook up the sensor wire to the spark plug wire, but no problems when I don't. This leads me to believe the noise is coming in through that wire. Is that a reasonable conclusion?
 
Couple of ideas that might work. That coax shield acts as an antenna bringing the noise
to your circuit. You may be inducing that noise by where you terminate the shield because
of leasd inductance of your circuit ground. Try attaching the shield at different locations
where the ground copper is larger. Since ignition noise is your signal, the only real purpose
is eliminate possible RF. Try attaching the shield only at the engine. If that does nothing,
modify the pickup end in this way. Cut the pickup center lead to less than a half inch.
Attach a 47K 1/2W resistor to that lead and solder a 4 inch solid wire to the other end of
the resistor so it can be wrapped around the ignition lead. Cover with heat shrink tubing.
 
Status
Not open for further replies.
Back
Top