Counting pulses

Counting pulses

People often ask us whether we have a little something enabling people to count pulses or even to measure the frequency of an electric signal. Usually, we cunningly answer that the best would be a Yocto-PWM-Rx, but that this module doesn't exist yet. Well, this is going to change because the Yocto-PWM-Rx is finally now available. We imagine that some are already jumping for joy :-)


Presentation

The Yocto-PWM-Rx is a small 54x20mm board with two distinct channels. Schematically, it's a small, and very fast, voltmeter detecting whether a signal is above or below the 0.7V threshold while timing transitions. It can then compute:

  • The signal frequency
  • The duty cycle and pulse width
  • The number of detected pulses

The new Yocto-PWM-Rx
The new Yocto-PWM-Rx


The Yocto-PWM-Rx accepts signals in a wide range: from -30V to +30V. It detects signal frequency as long as it is between the 0.05Hz and 250kHz bounds.

Pulse counters

Each channel has a pulse counter. Each counter is associated to a timer. It is therefore trivial to obtain the number of detected pulses since the last counter reset. Pulse counters work between 0 and 250kHz. To be accurate, the counters actually count the transitions: they are therefore incremented by two for each pulse.

Insulation

The Yocto-PWM-Rx has insulated inputs. This means that the USB part is electrically insulated from the measuring part. You can therefore connect the Yocto-PWM-Rx to a device with a potential different from that of your control computer without risking to fry everything. A typical case is devices powered on distinct phases. However, the two inputs are not insulated from one another: they share a common ground.

Open drain

The Yocto-PWM-Rx can work with transmitters sending open drain signals. Generally, when you want to carry a signal, the transmitter provides the current carrying the signal. It's the most intuitive case, but it's not the only one. In open drain mode, the transmitter simply lets, or not, the current flow. This current comes from elsewhere. Basically the sensor works like a switch. The open drain mode is interesting because it enables you to chose the voltage at which you want to work with the sensor. It so happens that the Yocto-PWM-Rx can provide some current as a small 3V pull-up. You can thus interface an open drain output without needing an external power supply.

Using the pull-up to interface a sensor with an open drain output.
Using the pull-up to interface a sensor with an open drain output.


Applications

Flowmeter

One of the main applications of the Yocto-PWM-Rx is to interface flowmeters. Almost all flowmeters are built on the same principle: a moving fluid drives a small turbine containing a magnet. A Hall effect sensor detects the magnet movements. This Hall effect sensor generates one or several pulses for each revolution. Thus, the frequency provides the instant flow and the pulse counter gives the volume of the liquid which has gone through the flowmeter.

The flowmeter: a typical application
The flowmeter: a typical application


The only sore point is the flowmeter power supply. You can use an external power supply, hence the interest of the Yocto-PWM-Rx insulation. It so happens that the flowmeters that we used for our tests work with 5V, so we made it simple and took the power from the USB bus.

External power supply / 5V power supply from the USB bus
External power supply / 5V power supply from the USB bus


There is a flowmeter variant using a reed switch instead of a Hall effect sensor. It's a typical case of open drain output sensor.

Rev counter

You can easily build a simple rev counter with a Yocto-PWM-Rx and an electric motor. Indeed, if you force an electric motor to turn, the motor behaves like a dynamo and generates an alternative current that has a frequency and amplitude proportional to the revolution speed. You must simply connect an electric motor directly on the Yocto-PWM-Rx to create a rev counter in a jiffy. Obviously, the motor must turn fast enough to generate a signal going above the 0.7V threshold. You'll obtain better results with a brushless outrunner motor. It works much less well with a conventional motor.

You can use a brushless motor as a rev counter
You can use a brushless motor as a rev counter



Here is a short video illustrating these two applications.

  


Conclusion

You now know most of what you need to know on the brand new Yocto-PWM-Rx. However, note that if you only need to count pulses generated by an open drain output without needing insulation, the Yocto-Knob is probably more attractive. Indeed, the Yocto-Knob also has pulse counters. It even has five of them.

Add a comment No comment yet
Back to blog












Yoctopuce, get your stuff connected.