# Frequency doubler - low frequency- square wave

#### teliocide

Joined Sep 26, 2013
99
Frequency doubler - low frequency- square wave

I am using a hall effect device to measure the speed of an enclosed shaft.
The output is fed to a cheap pulse counter that can be configured to display pulses per sec or pulses per min.

The speed of the shaft varies. The normal range is from 5 rotations per sec to a max of 250 rotations per sec.

The problem is that the pulse counter is neither stable or accurate below 10 pulses per second.

The easiest solution is to the double the input frequency.
The counter has x1 , x2 and x10 multiplier for the display.

The doubled the input frequency is easily corrected at the display.

I am hoping some one can direct me to a circuit that can perform the frequency doubling function I require.

Thank you

#### WBahn

Joined Mar 31, 2012
26,398
Can you mount additional magnets on the shaft to get more pulse per revolution?

Another option might be to use the shaft to drive a faster shaft with a 10:1 ratio and measure the speed of that shaft.

#### LesJones

Joined Jan 8, 2017
3,571
One way to do waht you want is to make the counter increment on both edges of the square wave. One way to do this is to use an XOR gate. Connect the signal directly to one input of the XOR gate and connect it to the other input via a delay network. The delay network can be just a resistor in series with the signal and a capacitor to ground from the gate input end of the resistor. If you are using a cmos XOR gate a 10 nf capacitor and a 10k resistor would be suitable values to start with. If you are using TTL gates you would require a much lower resistance value. (Less than 470 ohms with a corespondeing increase in capacitor value.) If you want to build a counter that gives a more stable reading then the is a tachometer design on my website that should do what you want.

Les.

#### DickCappels

Joined Aug 21, 2008
7,988
When shaft rotation slows the rate of change of the magnetic field slows and without proper conditioning, as with a Schmitt Trigger, edge semsitive inputs can "stutter" with low rate of change signals.

If the "stuttering" is happening inside your Hall sensor then you may need to filter its output.

What are your Hall sensor and counter?

#### teliocide

Joined Sep 26, 2013
99
When shaft rotation slows the rate of change of the magnetic field slows and without proper conditioning, as with a Schmitt Trigger, edge semsitive inputs can "stutter" with low rate of change signals.

If the "stuttering" is happening inside your Hall sensor then you may need to filter its output.

What are your Hall sensor and counter?
It is a commercial packaged sensor with Schmitt Trigger built in.

#### teliocide

Joined Sep 26, 2013
99
One way to do waht you want is to make the counter increment on both edges of the square wave. One way to do this is to use an XOR gate. Connect the signal directly to one input of the XOR gate and connect it to the other input via a delay network. The delay network can be just a resistor in series with the signal and a capacitor to ground from the gate input end of the resistor. If you are using a cmos XOR gate a 10 nf capacitor and a 10k resistor would be suitable values to start with. If you are using TTL gates you would require a much lower resistance value. (Less than 470 ohms with a corespondeing increase in capacitor value.) If you want to build a counter that gives a more stable reading then the is a tachometer design on my website that should do what you want.

Les.
Thanks,
My electronics skill set is very basic........
I understand your idea and what an exclusive OR gate is ......I just need a tiny bit more detail.
What IC (that contains the XOR) would you suggest
The Hall effect sensor operates on 12 volts DC
A pencil scratched diagram would be a blessing.

Many tahnks

#### teliocide

Joined Sep 26, 2013
99
Can you mount additional magnets on the shaft to get more pulse per revolution?

Another option might be to use the shaft to drive a faster shaft with a 10:1 ratio and measure the speed of that shaft.
Unfortunately it is a sealed unit,

#### teliocide

Joined Sep 26, 2013
99
One way to do waht you want is to make the counter increment on both edges of the square wave. One way to do this is to use an XOR gate. Connect the signal directly to one input of the XOR gate and connect it to the other input via a delay network. The delay network can be just a resistor in series with the signal and a capacitor to ground from the gate input end of the resistor. If you are using a cmos XOR gate a 10 nf capacitor and a 10k resistor would be suitable values to start with. If you are using TTL gates you would require a much lower resistance value. (Less than 470 ohms with a corespondeing increase in capacitor value.) If you want to build a counter that gives a more stable reading then the is a tachometer design on my website that should do what you want.

Les.
Hi Les

Something like this?

#### Attachments

• 9.9 KB Views: 24

#### BobTPH

Joined Jun 5, 2013
4,051
No, the capacitor goes from input A to ground.

Bob

#### sghioto

Joined Dec 31, 2017
2,424
It is a commercial packaged sensor with Schmitt Trigger built in.
I wonder in that case if the pulse duration at 5 rps is too long for the counter to process. A circuit that will maintain a constant pulse duration may be needed.
SG

#### crutschow

Joined Mar 14, 2008
28,208
Here's the LTspice simulation of an example circuit using XNORs.

#### teliocide

Joined Sep 26, 2013
99
No, the capacitor goes from input A to ground.

Bob
Got that .... Thanks

#### ebp

Joined Feb 8, 2018
2,332
Unless the magnet is a two pole ring, the signal from the pickup will almost certainly be a low duty cycle (either active high or active low) pulse, so the xor circuit will produce pairs of closely spaced pulses. This is unlikely to help accuracy since inaccuracy is due to uncertainty of the sampling window with respect to the signal. The sampling uncertainty issue can easily be seen in the simulation waveform. If the sample window were just an extra millisecond longer it would get one more rising edge of the xor output - 6 instead of 5.

To reduce error due to sampling uncertainty the sample time must be adequately long relative to the period of the signal. For 5 Hz a sample time of ten seconds or 100 seconds would typically be used, which of course means very low update rate. The alternative is to measure the period and compute the reciprocal, but that isn't something most low-cost counters can do.

#### teliocide

Joined Sep 26, 2013
99
Unless the magnet is a two pole ring, the signal from the pickup will almost certainly be a low duty cycle (either active high or active low) pulse, so the xor circuit will produce pairs of closely spaced pulses. This is unlikely to help accuracy since inaccuracy is due to uncertainty of the sampling window with respect to the signal. The sampling uncertainty issue can easily be seen in the simulation waveform. If the sample window were just an extra millisecond longer it would get one more rising edge of the xor output - 6 instead of 5.

To reduce error due to sampling uncertainty the sample time must be adequately long relative to the period of the signal. For 5 Hz a sample time of ten seconds or 100 seconds would typically be used, which of course means very low update rate. The alternative is to measure the period and compute the reciprocal, but that isn't something most low-cost counters can do.
I am not sure of the internal structure of the mechanics of this machine. The shaft is in a welded sealed section. The output from the Hall Effect sensor is such that the pulse length is equal to the NO pulse length (not sure how to state this is correct terms) .... on-time and off-time are the same.

#### crutschow

Joined Mar 14, 2008
28,208
Is the output of the simulated circuit (basically LesJones circuit) in post#11 what you want?

#### teliocide

Joined Sep 26, 2013
99
Is the output of the simulated circuit (basically LesJones circuit) in post#11 what you want?

Yes thank you.
I am currently in the early part of a 4000km drive .... it will be a week or two until I can try it.
If all goes well it ends here ..... if not...... I'll be back

#### crutschow

Joined Mar 14, 2008
28,208
Note that you can add additional XOR circuits to increase the pulse frequency by two for each added circuit, with proper selection of each RC time-constant.

#### ebp

Joined Feb 8, 2018
2,332
If on time and off time are the same the XOR circuit should be OK. That certainly is unlike any shaft pickup I've ever seen, but by no means impossible. Whether it will actually improve anything still depends on the exactly what the counter is doing.

#### teliocide

Joined Sep 26, 2013
99
If on time and off time are the same the XOR circuit should be OK. That certainly is unlike any shaft pickup I've ever seen, but by no means impossible. Whether it will actually improve anything still depends on the exactly what the counter is doing.

The good thing is, if done correctly, there will no further ground for speculation ..... just have to live with reality.