RPM Window & WOT switch, 2x lm2907 + lm111 voltage comparator ?

Thread Starter

carl0s

Joined Apr 25, 2010
39
Hi. I am thinking about building an RPM window & wot switch. It's to control the clutch of an automotive A/C compressor. The compressor must only be active if engine RPM is between, e.g. 1,200rpm and 4,800rpm, and if the gas pedal is not floored (wide open throttle..WOT).

So, I guess I need the LM2907 frequency to voltage converter ("tacho chip"). I suppose I need two of these do I ?

The WOT will come from the electronic throttle pedal or throttle butterfly, which in this application is a lowering voltage, so the further the pedal is pressed, the lower the voltage is (5v down to 0v), so WOT would probably be detected as ~0.2v and below.

I think I'd like to have three little trim pots.. low rpm, high rpm, wot point.

Am I correct that I should be looking at 2x LM2907 and 1x LM211 ?

I suppose thinking in terms of logic, I would need the first LM2907 to signal "above 1,200rpm", the second one to signal "above 4,800rpm", but have the second one (the "above 4,800rpm") output inverted, and then the two going into an AND gate along with an "above 0.2v" from the voltage comparator (i.e. not WOT), and .. uh.. no, I'm losing myself already.

Any hints for getting a total novice started on the right track? I've recently taken up milling machines, so I probably shouldn't be trying to learn something else new as well, so if I could have some hints, but perhaps something that might lead me to achieving some sense of success in short time would be good if possible :)

I have gEDA and gschem here, but I have no idea what I'm doing with them, and even whether there's any point/benefit on something such as this.

thanks very much
cheers,
Carl
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,221
More like one 2907 and a window comparator - a window comparator consists of two comparators.

An LM211 isn't rated for automotive temp ranges, and you would need two of them.

However, an LM2903 IS rated for automotive temps, and it is a dual comparator.
 

SgtWookie

Joined Jul 17, 2007
22,221
Actually, I think you would be a lot better off just monitoring a MAP sensor that had some hysteresis for turning ON, but was quick to turn off.

Any time the MAP is higher than the threshold, the engine is basically loafing along. If MAP is low, the engine is working harder.

Don't try to tap into an existing MAP, as that could easily be construed as tampering with emissions controls and thus illegal. Add your own to an unused capped-off manifold port.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
Thanks for the replies. I was just reading about LM2907's hysteresis capability, and yes that's something I'd need/want.

Going back to the f to v and window comparator circuit, since this is something I like the idea of as a learning circuit anyway, well, how come I only need one LM2907 ? I am going to buy some breadboard and some sort of frequency generator to play around with I think.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
The window comparator is for dealing with the RPM & WOT, I presume? So does the single 2907 manage the "between 1,200 and below 4,800rpm" function all by itself? If I were using two 2907s I could use the hysteresis as detailed in the application notes PDF (http://www.national.com/an/AN/AN-162.pdf , page 6) for both the high and low RPM. If I use a single 2907, does that become not possible any more? BTW, how does adding a resistor in line with the power supply manage to make the hysteresis function work ? I thought it would be something like a capacitor charge delay or something, but a resistor ?
 

SgtWookie

Joined Jul 17, 2007
22,221
I was just reading about LM2907's hysteresis capability, and yes that's something I'd need/want.
Actually, you'd build that into the window comparator circuit.
Google "Window comparator" for examples of circuits.

Going back to the f to v and window comparator circuit, since this is something I like the idea of as a learning circuit anyway, well, how come I only need one LM2907?
The LM2907's output when used as a tach or F->V converter will have an output voltage that is proportional to the engine RPM.
Why would you want the same output twice?

I am going to buy some breadboard and some sort of frequency generator to play around with I think.
Why not start by using a 555 timer to build a variable frequency square wave generator?
 

SgtWookie

Joined Jul 17, 2007
22,221
The window comparator is for dealing with the RPM & WOT, I presume?
A comparator is set up to change it's output when an input voltage is higher or lower than a reference voltage.

So does the single 2907 manage the "between 1,200 and below 4,800rpm" function all by itself?
No. It just outputs a voltage that is proportional to the RPM of the engine.

If I were using two 2907s I could use the hysteresis as detailed in the application notes PDF (http://www.national.com/an/AN/AN-162.pdf , page 6) for both the high and low RPM. If I use a single 2907, does that become not possible any more?
You'll find that it is much easier to deal with comparators than the LM2907. One in a system is more than enough.

BTW, how does adding a resistor in line with the power supply manage to make the hysteresis function work? I thought it would be something like a capacitor charge delay or something, but a resistor ?
If you have the open collector output tied directly to +V, you'll burn it up.

I don't know which schematic you are looking at.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
Ah, I understand, and yes, I was wondering how to make a frequency generator for testing. I had in mind that the 2907 was being used as an RPM switch (which I now gather is a feature provided when the inbuilt comparator is used), hence why I thought I needed two of them, but I understand now, and it makes sense, cheers :)
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
Right, I buggered up. First of all, I made a 555 timer circuit which flashes an LED at a nice rate. I was hoping to use my soundcard and xoscope to check out the frequency but I haven't managed that yet (Thinkpad mic/line input problems.. xoscope doesn't let me choose a USB soundcard).

So, 555 good.

What's bad is that I bought a load of LM2709 and 2719 chips, but I bought the -8 variety, which are 8pin, but it turns out that the input is tied to ground, and so it requires the input to oscillate above and below ground, e.g. an a/c input. I presume my tach input will be like a DC pulse? Am I screwed? Are these chips for the bin (I bought 10 of each)?

Here's the excerpt from the datasheet:
Two options (LM2907-8, LM2917-8) have one
input internally grounded so that an input signal must swing
above and below ground and exceed the input thresholds to
produce an output. This is offered specifically for magnetic
variable reluctance pickups which typically provide a single-
ended ac output. This single input is also fully protected
against voltage swings to ±28V, which are easily attained with
these types of pickups.
The differential input options (LM2907, LM2917) give the user
the option of setting his own input switching level and still have
the hysteresis around that level for excellent noise rejection
in any application. Of course in order to allow the inputs to
attain common-mode voltages above ground, input protection
is removed and neither input should be taken outside the lim-
its of the supply voltage being used. It is very important that
an input not go below ground without some resistance in its
lead to limit the current that will then flow in the epi-substrate
diode.
 

SgtWookie

Joined Jul 17, 2007
22,221
No, you're OK. You can just use a cap between your sensor and the input, with a resistor from input to ground.

The 8-pinners actually make things a tad easier.

Careful that you don't feed your sound card's line input more than a 1v P-P signal or you can easily blow your sound card.

What will be the frequency of your input signal? How many pulses per revolution of the motor?
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
No, you're OK. You can just use a cap between your sensor and the input, with a resistor from input to ground.

The 8-pinners actually make things a tad easier.

Careful that you don't feed your sound card's line input more than a 1v P-P signal or you can easily blow your sound card.

What will be the frequency of your input signal? How many pulses per revolution of the motor?
Super. Thanks for replying again too.
This is what I have as far as frequency:
RPM signal comes from the cam pulse, so it pulses every other turn. Basically, it sends the same pulse as a 4 cylinder car.
I have yet to figure out what that actually means. I think it means the pulse will be 120th of the RPM. 1 pulse per two revolutions.
So, if I want to measure between 1,200rpm and 4,800rpm, then I will need my 2917 to deal with between 10 and 40hz, or a bit more each way really.

Unless I am misunderstanding of course.
 

SgtWookie

Joined Jul 17, 2007
22,221
Do you have an oscilloscope?

That might be the only way that you will be able to find out. Either that, or a frequency counter.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
Do you have an oscilloscope?

That might be the only way that you will be able to find out. Either that, or a frequency counter.
No I don't, but I was thinking of buying one of these. The engine doesn't actually run yet anyway, haven't found somebody to make headers/exhaust yet, so it's all just "something to do", and learning (although I'm not learning enough.. I am following schematics but I still don't understand why adding a cap in series and a resistor to ground does what it does for the input.. nor do I understand the simple equations like the LM2907's "Easy to use; VOUT = fIN × VCC × R1 × C1" (firstly, what is VCC ? I only have "vIN" don't I? and R1 in what, Ohms? KOhms? Same for C1.. nano,pico,micro what farads ?).

I look at that equation and I see " output voltage = (10 ~ 40)hz x 5v x 100 x 1", so already that's 5,000 - 20,000 volts. Hmmm. I don't think so.

So I'd be happy to build a circuit on my breadboard as a sort of proof of concept really. I really could do with a frequency counter or something though so that I can check out the frequency of my 555 circuit and use that for testing the 2917 circuit.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
I may just buy a cheap DMM with inbuilt frequency counter. I can get one of those locally, rather than waiting for the USB scope from Hong Kong.
 

SgtWookie

Joined Jul 17, 2007
22,221
The PC O-scope will certainly be better than nothing. Actually, it should cover most of your needs. Be sure to get some scope probes, too - 100MHz or better.

I still don't understand why adding a cap in series and a resistor to ground does what it does for the input
Capacitors block DC, but pass the effects of AC. So, you can have an AC signal riding on an arbitrary DC level on one side of the capacitor; but if you have a path to ground on the other side of the capacitor, the average DC level will eventually be the same as ground.

...nor do I understand the simple equations like the LM2907's "Easy to use; VOUT = fIN × VCC × R1 × C1" (firstly, what is VCC ? I only have "vIN" don't I? and R1 in what, Ohms? KOhms? Same for C1.. nano,pico,micro what farads ?)
Vcc is the positive supply voltage to the IC. The 2017's have a built-in 7.5v Zener diode. They need a current limiting resistor from the ignition circuit to the IC; somewhere around 470 Ohms to 560 Ohms.
R1 in Ohms, C1 in Farads.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
The PC O-scope will certainly be better than nothing. Actually, it should cover most of your needs. Be sure to get some scope probes, too - 100MHz or better.



Capacitors block DC, but pass the effects of AC. So, you can have an AC signal riding on an arbitrary DC level on one side of the capacitor; but if you have a path to ground on the other side of the capacitor, the average DC level will eventually be the same as ground.
Having though about that a few times, I think I might sort of get it. Are you in effect shifting the waveform downwards, so instead of being __--__-- at 0 to 5v, you're dropping the whole thing to -2.5 to +2.5. I presume that's what you mean about the average DC level being the same as ground ?

If we didn't have the resistor, what would we have ("the effects of AC") ? Would it just be a very weak +5v DC pulse ?
 

SgtWookie

Joined Jul 17, 2007
22,221
Having though about that a few times, I think I might sort of get it. Are you in effect shifting the waveform downwards, so instead of being __--__-- at 0 to 5v, you're dropping the whole thing to -2.5 to +2.5. I presume that's what you mean about the average DC level being the same as ground ?
The AC signal becomes decoupled from the input DC level; we can then set it to anything we want that is within the range of the power "rails" using a resistor divider network. If the input is a square wave and the duty cycle of the waveform is 50%, then yes, the voltage peaks will be +2.5 and -2.5v.

If we didn't have the resistor, what would we have ("the effects of AC") ? Would it just be a very weak +5v DC pulse ?
The input would "float" to whatever level the comparator input wanted to see. If the input were a FET (which it isn't) it might even be damaged by being allowed to float to an arbitrary level.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
Thanks very much for all your advice. I feel like I would learn a lot from being able to actually 'see' things, so I have ordered one of these.
I have to wait for delivery though which is a pain.
 

Thread Starter

carl0s

Joined Apr 25, 2010
39
OK my scope arrived, finally. I did some experimenting, and it is good to be able to see what's going on.

First thing I noticed is that my 555 timer circuit doesn't have a consistent duty cycle when the frequency is varied. In fact it looks like the signal is predominantly ON, with the frequency variation just altering the frequency of the fixed-duration OFF signals. i.e. the OFF pulse is of a constant duration, but the ON pulse duration is varying due to the increased frequency of the fixed duration OFF pulses. Or something (I think that's correct).

Does that make sense (it's from memory, I was looking at it yesterday), and is it expected? I was expecting a square wave, but this is a .. rectangle wave ?

Other thing I noticed was, regarding the decoupling capacitor. Well, i noticed that without the pull-down resistor, it took some time for the signal to arrive at +2.5v to -2.5v, i.e. it seems to gradually shift down to there. Is this to do with the capacitor needing time to charge ? I used a 1uF ceramic cap. The LED was still in place on my 555 circuit. I just added a decoupling capacitor as well, so that I have both a DC output running the LED, and an AC output for my experimentations.

I also noticed that while a pull-down resistor cured that floaty business mentioned above, it also made the square wave into a sort of sloping square wave. Is this again something to do with the cap charging and discharging? I noticed that varying the resistor value helped with this, and it also helped with the next problem which was:

When I altered the frequency, or what I thought was the frequency (refer to first curiosity.. the duty cycle varying), the signal would shift down, so that it was perhaps -4v to +1v, i.e. it would not stay centred around 0v.

Is this simply a case of needing to find the correct resistor values? I found that with a sufficiently low resistor value, I could keep the signal centered around 0v, but it became more of a pulse signal, a bit like a heartbeat rather than any kind of square or rectangle single. This is basically the slope that I was mentioning before, but with such a low resistor value, the slope had become very sharp. As it happens though this would probably be perfectly fine for my comparator needs.

I feel like I'm learning a lot. I just ordered a function generator too :)

Any advice/things I should learn from the above? Should I be trying to make my 555 circuit fix at 50% DC regardless of frequency, or is this normal? Is my turning the square wave into a pulse a good thing and something you would have wanted me to do anyway ?

thanks for your time!
cheers,
Carl
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,221
OK my scope arrived, finally. I did some experimenting, and it is good to be able to see what's going on.
An o'scope is a handy thing to have, indeed!

First thing I noticed is that my 555 timer circuit doesn't have a consistent duty cycle when the frequency is varied. In fact it looks like the signal is predominantly ON, with the frequency variation just altering the frequency of the fixed-duration OFF signals. i.e. the OFF pulse is of a constant duration, but the ON pulse duration is varying due to the increased frequency of the fixed duration OFF pulses. Or something (I think that's correct).

Does that make sense (it's from memory, I was looking at it yesterday), and is it expected? I was expecting a square wave, but this is a .. rectangle wave ?
555 timers can be connected up in so many different ways that it's practically impossible to document all of them.

So, in order for us to be able to help you figure out what is going on with your particular iteration, please post a schematic of your circuit, preferably in .png format.

Other thing I noticed was, regarding the decoupling capacitor. Well, i noticed that without the pull-down resistor, it took some time for the signal to arrive at +2.5v to -2.5v, i.e. it seems to gradually shift down to there. Is this to do with the capacitor needing time to charge ? I used a 1uF ceramic cap. The LED was still in place on my 555 circuit. I just added a decoupling capacitor as well, so that I have both a DC output running the LED, and an AC output for my experimentations.
Yes, it will take some time to charge the cap; it all depends upon the capacitance value and the resistance through which the cap is charging/discharging.

I also noticed that while a pull-down resistor cured that floaty business mentioned above, it also made the square wave into a sort of sloping square wave. Is this again something to do with the cap charging and discharging? I noticed that varying the resistor value helped with this,...
Yes, the waveform can start to look a bit sloped. If the value of C is quite a bit smaller than the value of R, you will wind up with a really peaky looking waveform. You will then have a "passive differentiator circuit". This is opposite of a "passive integrator circuit", which is also called a low-pass filter.

... and it also helped with the next problem which was:

When I altered the frequency, or what I thought was the frequency (refer to first curiosity.. the duty cycle varying), the signal would shift down, so that it was perhaps -4v to +1v, i.e. it would not stay centred around 0v.
The signal on the other side of the cap will be the average of the voltage output. If your square wave is not a 50% duty cycle, then you will have higher peaks on one side of the 0v reference than the other.

Is this simply a case of needing to find the correct resistor values? I found that with a sufficiently low resistor value, I could keep the signal centered around 0v, but it became more of a pulse signal, a bit like a heartbeat rather than any kind of square or rectangle single. This is basically the slope that I was mentioning before, but with such a low resistor value, the slope had become very sharp. As it happens though this would probably be perfectly fine for my comparator needs.
This is the "passive differentiator circuit" I was speaking of before.

It works great if your input signal is (roughly) a square wave; with fast rise/fall times. If the input signal is more like a sine wave, then passive differentiators don't work as well.

I feel like I'm learning a lot. I just ordered a function generator too :)
I think you're hooked. ;)

Any advice/things I should learn from the above? Should I be trying to make my 555 circuit fix at 50% DC regardless of frequency, or is this normal?
It would be best if you can mimic the actual input signal that you will be using. Why don't you use your 'scope on that signal, so we have a starting place?

Is my turning the square wave into a pulse a good thing and something you would have wanted me to do anyway ?
Don't know yet - you need to look at what your actual trigger signal is.

Also, you are in luck - I just finished making up some LTSpice models for the LM2907 and LM2917 freq-to-voltage converters. They're attached to this thread:
http://forum.allaboutcircuits.com/showthread.php?t=38423

This will help to check the design before you actually build anything. It's much easier to change parts with a mouse than with a soldering iron. ;)
 
Top