Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Issues removing offset from Square signal

Status
Not open for further replies.

eliotroyano

New Member
Hi friends. This is first post after reading these useful forums during some days. I am from SouthAmerica and have some time working with electronics. I post this my first topic looking for some ideas.

I have been looking for simple circuit solution about removing an offset from automotive square signal (tachometer or rpm signal from car ECU - engine control unit) that you can see it attached here. The signal is a more or less stable 50% duty cycle frequency variable (25-256Hz) signal with a 9VDC offset that lives from 9 to almost 14VDC. To be usable for my datalogging purposes I only need the frequency variable square part of the signal, without the offset. I mean from ground or 0 level, or at least that reach less than 1VDC for a low level and more than 3VDC for a high level.

I have tested a simple high pass filter with a series capacitor (0.1uF) and a clampling diode, but the signal goes almost to the ground level as small non usable erratic pulses around 0.5VDC. I also try to reconstruct that signal using a comparator (LM311) and 12VDC reference with a resistor and 12V zener diode. But on bench it works quite good but in the car it only show a Hi level signal as an output.

Well friend, I appreciate some tips and ideas to solve this little issue that is going big. :confused::confused::confused:
 
Hi. That highpas filter idea should work. You could always give a clue by upload the schematic of the high pass filter.

And I cannot see any voltage labels on the scope picture.

You say that the offset (assuming you mean the average DC value) is varying. What makes the offset change? RPM?
 
Hi. That highpas filter idea should work. You could always give a clue by upload the schematic of the high pass filter.
And I cannot see any voltage labels on the scope picture.
You say that the offset (assuming you mean the average DC value) is varying. What makes the offset change? RPM?

Thanks Grossel for you fast answer. Here I attach my hi-pass filter and comparator ideas that doesn't work. I also attach the oscilloscope pic with levels indicated.

The offset (average DC value) in the signal is fixed all time, 9VDC aprox. The offset does not change, is the frequency of the square signal that changes and have the RPM info in it. That is the signal that I need (the square signal without the offset).
 
Last edited:
Perhaps use a level-shifter like this?
 
Hi.

The cap/diode connection won't work because it makes a clamping circuit rather than a filter.

A bigger cap and replace the diode by a resistor should do the job.

But - do the math. You should ensure that the cap actually discharges for the lowest possible frequens.
 
Hi.
The cap/diode connection won't work because it makes a clamping circuit rather than a filter.
A bigger cap and replace the diode by a resistor should do the job.
But - do the math. You should ensure that the cap actually discharges for the lowest possible frequens.

I will try it and I will tell you. But my concern is why the signal gets down when I connect some load.
 
The comparator should have worked. What did you see on the scope?
 
Can you elaborate a little about the level-shifter idea?
Looking at your original waveform it appears to be a 5V square-wave clamped to the 'high' side (+14V level). In my circuit any input voltage a volt or so below the high level causes Q1 to turn on, which turns on Q2 also. I have assumed you want an output signal in the 0-5V range, so have included a 5V source (it could be any other value you choose). As Q2 turns on and off the output goes from 0 to 5V.
 
Last edited:
The original idea to use a high pass filter should have worked.
At an idle speed of 600 RPM, the rotation is 10 per second and, for a 4 cylinder motor, there will be 2 pulses per rev. ie, 20 pulses per second or a time period of 50 milli sec. Each half of the square wave lasts for 25 msec.
The time constant of the filter needs to be around 100 to 125 mSec. Rather than a diode, there should be a resistor to ground. For a 0.1 uF capacitor, the resistor should be around 1 megohm.
The question is, why the original filter did not work.
The CRO trace shows the peak to peak voltage is around 6 Volt. It should not change when the datalogger is connected, but it possibly will and this may be your problem with no input. I suggest you check the source impedance of the square wave source. Do this by measuring the voltage with the CRO and then put a resistor in parallel with the cro. When the voltage waveform amplitude reduces to 3 volt, the the resistor value is the same as the source resistance. Similarly with the datalogger; you need to know its' input impedance. This input impedance can be used to calculate the time constant of the CR network. Note that the diode is probably not required. There may be some negative overshoot after the input pulse falls to 'low'. If this causes a problem, the diode will clamp the overshoot to around 0.5 volt. Alternatively, increase the size of the capacitor.
Hope this helps.
 
The original idea to use a high pass filter should have worked.
At an idle speed of 600 RPM, the rotation is 10 per second and, for a 4 cylinder motor, there will be 2 pulses per rev. ie, 20 pulses per second or a time period of 50 milli sec. Each half of the square wave lasts for 25 msec.
The time constant of the filter needs to be around 100 to 125 mSec. Rather than a diode, there should be a resistor to ground. For a 0.1 uF capacitor, the resistor should be around 1 megohm.
The question is, why the original filter did not work.
The CRO trace shows the peak to peak voltage is around 6 Volt. It should not change when the datalogger is connected, but it possibly will and this may be your problem with no input. I suggest you check the source impedance of the square wave source. Do this by measuring the voltage with the CRO and then put a resistor in parallel with the cro. When the voltage waveform amplitude reduces to 3 volt, the the resistor value is the same as the source resistance. Similarly with the datalogger; you need to know its' input impedance. This input impedance can be used to calculate the time constant of the CR network. Note that the diode is probably not required. There may be some negative overshoot after the input pulse falls to 'low'. If this causes a problem, the diode will clamp the overshoot to around 0.5 volt. Alternatively, increase the size of the capacitor.
Hope this helps.

Great ideas friend. But the signal degradates with just a capacitor (0.1uF) in series and oscilloscope (>500KΩ impedance) as load and not diode at all. I was using the diode to clamp the signal, I mean avoid negative values. I will test source resistance first as you suggest and let you know.
 
Well finally I solve my problem. In the most weird way, but it works.

I test buffering the signal without luck. The Non Inverting Op Amp circuit only show me a hi-level all the time. Then I start measuring output resistance of the signal emitter circuit when I notice that with a 100KΩ and 50KΩ, signal remains as mentioned. But I change for a 20KΩ it starts to drop it offset. I also test 10KΩ, 5KΩ and 2KΩ, getting the best signal approx to ground, with a clean 0-12V square wave signal using a simple 2KΩ resistor. Weird but it works quite good.

Here are some pics. I don't why it happends like this. Maybe the output is from some open stage, like a transistor without any load as reference. Then hi impedance deforms and contract whole signal.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top