I'm trying to measure the speed of a washing machine motor. The motor has a speedometer attached to it, which generates a sine wave with frequency equal to rotation frequency of the motor. I'm attaching the image of the sensor output signal below:

sensor output signal

I'm trying to convert the signal to a 0-5V TTL signal for a MCU to measure the frequency. What is the best approach ?

  • \$\begingroup\$ Check this comparator LM339. It produces TTL O/p \$\endgroup\$ – seccpur Jun 25 '18 at 16:56

If you can share a GND with the sensor then a good way to convert that signal to a TTL digital signal would be to use a simple common emitter NPN transistor configuration. Feed the signal through a resistor of say 10K ohms into the base of the transistor. Place a diode with its cathode also to the base of the transistor. The transistor emitter and the diode anode both connect to GND. The purpose of the diode is to protect the transistor when the input signal goes negative. The collector of the transistor goes to a resistor of say 1K ohms that comes from the MCU +5V rail. The collector side of the 1K resistor also goes to the MCU input.

You will have to carefully evaluate the sensor connections however. If they are in any way not isolated from the mains AC voltage then it would not be recommended to connect your MCU to the sensor without some isolation. An opto-coupler would be a suitable way to provide isolation. Recommending a circuit connection for the opto-coupler could only come when more is known regarding the sensor connections.

| improve this answer | |
  • \$\begingroup\$ I like the NPN idea. I'd insert a spike-filter (I see narrow spikes in the provided scope display), at 100Hertz. Or maybe 200Hz. Built this by splitting the 10Kohm into series 4.7K ohm (Requivalent of 2.3Kohm). Hang a 1uF ceramic (non-polarized) from midpoint of the 2 resistors, to GND. \$\endgroup\$ – analogsystemsrf Jun 26 '18 at 16:07
  • \$\begingroup\$ @analogsystemsrf - Make sure to test the actual filter components at the highest RPM of the motor to make sure your time constant is not too large. You may also want to try the NPN circuit without the filter but connect the base resistor and GND from your circuit to the sensor location using a twisted pair wire. There is a possibility that the high frequency content that you see in your scope traces maybe pickup by the scope probe tip to ground clip loop at the end of the scope probe. That noise probably comes from PWM switching in the motor windings. \$\endgroup\$ – Michael Karas Jun 26 '18 at 18:54

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.