wich resistors to use?

Yes its easy to do ....

Set up like this ...

lets assume that the Max signal is going to be 12V and we don't know the Min

We need to scale that to get 12, scaled, somewhere between 0 and 5 we should be aiming for about 4, a bit of wriggle room is always good.

4 is 1/3 of 12 so we a 1:3 ratio or there about ... Using standard resistor values we could try 3K3 (that's 3.3K or 3300 ohms) and 6K8 (6K6 is not a standard value)

Checking ...

We have 10K1 10100 Ohms at 12V (V=IR Ohms Law - Voltage = Resistance X Current) so that is about 1.18mA (12 / 10100)

If the signal was only 9V it would be about 0.89mA, we need to know this to make sure we have enough adjustment if the assumptions RE sensor voltage are wrong.

Now we check the voltage that will be dropped by the bottom 3K3 resistor at both currents.

This is what go's to the op-amp ' - ' and must be within the range we can set as a reference on the ' + '

If the signal is 12V then ... 3300 X 0.00118 = 3.9V

If the signal is 9V then ... 3300 X 0.00089 = 2.9V

Both look OK to me.

We started with a 10K trimmer so I have done the calculation for an overall resistance, the input impedance of the circuit, of 'about' 10K

However it would probably make sense to go a little lower as it will make the circuit, overall, more resilient to noise.

2K2 and 1K, you do the calculations, is still only about 3.7mA overall at 12V giving 3.7V on the op-amp input.

This is where the low bias current into the op-amp comes in, If the op-amp was a low impedance input, taking a significant current, we would have to factor that into the calculations. Perfectly doable but easier if we can ignore it.

You may be thinking that this is easier to do if you just factor the numbers, it is all proportional after all.

You would be right in fact it is easier to do that way but I wanted to show you why it worked not just that it did.

Set your reference to about 3V and then connect the sensor.

Adjust the reference down until the pulses stop, mark the position or count the turns whatever.

Adjust the reference up until the pulses stop, mark the position or count the turns whatever.

Set the reference to the middle of these two points .. all done.

If you can rotate the wheel and get it to output a continually lo and continually high voltage by changing its position then use this to find the upper and lower reference voltages. rather than using the method above.

Shout if you need help .. its no bother

Al