0
\$\begingroup\$

I have a digital speedometer which outputs the signal obtained from the hall sensor of a motor with 23 activations per revolutions. This is a bit too much for my MCU to deal with it using interrupts. Is there a simple way to convert a digital signal with a 50% duty cycle but varying frequency to an analog signal?

\$\endgroup\$
  • 2
    \$\begingroup\$ Frequency to voltage converter such as the LM2907 \$\endgroup\$ – vini_i Jan 17 '17 at 17:46
  • 1
    \$\begingroup\$ When you have a perfectly good digital signal, why would you want to convert this to analog just to digitize it again?? Any F-->V-->Digital is going to introduce errors and require considerably more hardware. Why don't you feed the digital signal into a Timer with external input and create a simple frequency counter? The interrupt is now just at your timebase frequency which could be 100 mS to 1 S depending on your accuracy need (and rotational speed of the motor). \$\endgroup\$ – Jack Creasey Jan 17 '17 at 18:37
2
\$\begingroup\$

The LM2907/LM2917 Frequency to Voltage Converter appears to be exactly what you're looking for. (In fact, the first application described for it is a tachometer!)

\$\endgroup\$
2
\$\begingroup\$

Convert each of the 23 pulses per rev to a fixed width pulse then use an averaging filter. As pulses get closer together (higher speed), the net duty cycle increases and the low pass filter output rises linearly with revs per second.

\$\endgroup\$
  • \$\begingroup\$ perhaps a re-triggerable monostable is preferable to a monostable that ignores pulses while active. A re-triggerable monostable has a flat-line response above full scale. \$\endgroup\$ – glen_geek Jan 17 '17 at 18:32
  • \$\begingroup\$ Thank you, this looks very interesting as I need a simple circuit with an output from 0 to 5V. How can I convert to pulse width? \$\endgroup\$ – Eliott W Jan 17 '17 at 18:42
  • \$\begingroup\$ As glen said above, use a monostable (like a 555 timer), but the devil is in the detail and knowing what the input pulse shape looks like across the range of rpms is crucial to making good design choices here. Sometimes you need to condition the pulse to make it very thin if too fat or use a non-retriggerable monostable (unlike glen's suggestion) and more like Tony's answer where he uses an exor gate to make the incoming pulse very thin. \$\endgroup\$ – Andy aka Jan 17 '17 at 19:10
1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

LM2907-N is very good at $1 (1k)

In my early days with SCADA, I wanted to send motor current on a couple servo motors to some remote panel meters and had no more digital channels left except for a couple spare bits in the status bytes, so I used Current converted freq. with a super linear VCO and then S/R flip-flop to the synchronous data channel ( set to send bit, reset when sent ) which was very important to prevent aliasing from metastable conditions then receive the bit and re-create the frequency with a 1 shot so that average voltage was the current detected. This measured the motor torque and probe friction being pushed and pulled by the motor and all worked out nicely being a range of 0 to almost 8kHz in a 8KHz frame rate and defying Shannon's Law while getting zero aliasing with the Flip Flops to ensure perfect sample counting.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.