# Very low frequency counter

I currently teach an introductory course to electronics that is mostly analog, but can incorporate some digital circuits. On our function generators, we have an arbitrary heartbeat shaped waveform and I thought it would be nice to try to make a heartbeat counter.

Obviously, the easiest approach would be to feed the function generator to any microcontroller and do the calculation using an ADC and code, but I want to create a simple electronic solution.

My first design idea revolved around the way nurses manually calculate heart rate over 15 seconds.

simulate this circuit – Schematic created using CircuitLab

Essentially, you press or use a monostable to count the rising edges over 15 seconds and you are left with a binary representation of that particular 15 seconds. It doesn't have any problem digesting the painstakingly slow normal heartrate frequencies (1Hz to 3Hz.) I plan on using a 74LS393 to count the pulses. If needed be, it is straightforward to increase the maximum value to an 8 bit format. We might have 8 bit counters sleeping somewhere, too.

It will not, however, behave in such a way that you can modify the frequency on the fly and see the output value change accordingly on a ''real time basis.'' The user will need to run another 15 seconds sweep.

In code, I would simply create a threshold, monitor a moving average divided by time and call it a day, but I need some inspiration to translate that concept into a circuit that is simple enough for first year technicians.

It is a small proof of concept and it can be completely flawed.

The heart wave is ficticious and free of noise.

Any ideas?

Post-Mortem:

The digital version of it worked properly.

The accepted answer worked also properly.

Finally, we also tested this circuit which uses a 555 to generate a monostable wave and thus we get a duty cycle value at the output and it worked too.

• You can cascade the two counters in a 393 to get an 8-bit counter (then cascade more 393s to get as many bits as you want).
– Mat
Commented Apr 28, 2023 at 4:17
• Yes, I know that this part is not an issue and it will most likely be mandatory to at least get 8 bits! Commented Apr 28, 2023 at 17:27
• Can you post an image or specification for the heartbeat waveform? Commented Apr 29, 2023 at 4:13
• The heartbeat is a perfectly smooth replica of a PQRST heartbeat waveform. It is adjustable in frequency to whatever the function generator can provide and we can scale it's amplitude up to 30 V. There are slight negative values here and there to perfectly mimick the polarisation of the heart. It is a built-in ''project'' waveform. Commented May 1, 2023 at 15:16

## 4 Answers

Since you already plan to use code, you can just run a timer to find the time between heartbeats, and take the reciprocal to get the frequency. Of course you also need to scale the result to get beats/minute.

You might also explore various tachometer circuits, like the one shown here, although you would need to change the components by a factor of about 30 for heartbeats. 6000 RPM / 30 = 200 b/m.

simulate this circuit – Schematic created using CircuitLab

This is a simple way to get a voltage that changes with frequency from 1 Hz to 3 Hz (60-180 beats/minute).

It might be a good idea to see how long it takes for those frequencies to produce a stable output for measurement:

simulate this circuit

The output filter capacitor had to be increased to 470 uF to get a well filtered DC level. For 1 Hz:

And for 3 Hz:

This works well for a sine wave, but the heartbeat signal is probably more like a series of short pulses, perhaps 100 mSec, spaced 1 second to 300 mSec apart. The same circuit should work, but would be based on the duty cycle.

(edit) A practical implementation might trigger a one-shot on a transition of the heartbeat signal, so that the pulse width is not dependent on amplitude or wave shape, and duty cycle will be proportional to frequency.

simulate this circuit

(edit) There is also another possible method for reading low frequency signals with greater precision. A CD4046 phase locked loop in conjunction with a CD4518 dual BCD counter may be able to produce a frequency 100 times the measured frequency, so for a 1 Hz to 3 Hz heartbeat, it would provide 100 to 300 Hz, and a frequency counter with a 1 second gate would read 1.00 to 3.00 Hz. A 0.6 second gate would read 60 to 180 beats/minute, and a 6 second gate would read 60.0 to 180.0. For an example of this circuit, see:

https://e2e.ti.com/support/logic-group/logic/f/logic-forum/1018089/cd4046b-frequency-multiplication-circuit-with-at-least-100-times-magnification

• I actually do not want to use any form of code. Your solution is really nice! Commented Apr 28, 2023 at 17:28
• Post mortem of the project: your initial solution worked well enough. we had roughly 0.6V of difference between 1 hz and 3 hz. The Peak height was much lower than what you simulated which explains why the difference was 0.6. All in all, thank you for your time. It was fun to push past the class requirement and challenge those students while keeping the circuits simple enough. Commented May 5, 2023 at 17:05
• Hello guys, I was wondering if this circuit would work to measure frequencies of 1Hz to 50Hz?, I am struggling to pick the frequency of a wind turbine Commented Sep 24, 2023 at 15:59

The problem with counting low frequencies is that as the frequency gets lower you need more and more time to get enough counts and you end up having to wait long periods of time to get updates. At 1000 Hz, you can have a 1 second time base and it will count 1000 pulses in that time, if it misses 1 pulse it's only off by 0.1%. At 1 Hz the same 1 second time base wouldn't work very well, if it misses 1 pulse it's off 100%, the result would probably just go back and forth between 1 and 0. At 0.1 Hz a 1 second time base wouldn't even get one full cycle to count.

The solution to this is to use a period counter for low frequencies, instead of using clock pulses to gate the input signal to the counter you use the input signal to gate clock pulses. This way you can get a reading in as little as one cycle of the input signal. The problem with a period counter is that the lower the input frequency the higher the output count, so you need to calculate 1/count to get the frequency. This is of course easiest done with something like a microprocessor.

• It was about 40 years ago that HP came out with a line of frequency meters which used frequency counters for high frequencies and automatically switched over to 1/period display at low frequencies. Commented Apr 29, 2023 at 2:05
• Another method is a phase locked loop like CD4046 with a divide by 100 dual decade BCD counter like CD4518. I used that method to read 60 Hz mains voltage frequency to two decimal places, like 45.00 to 65.00 Hz. ti.com/lit/ds/symlink/… Commented Apr 29, 2023 at 4:21

If your circuit can include a (digital) voltmeter on the output, the simplest solution would be a long-time integrator circuit which would give you a voltage proportional to the number of pulses.
First you would use a (555, for example, or a discrete circuit) monostable with the triggered pulse being slightly shorter than your shortest expected measured period to give you a fairly long pulse.
Then you would use an (op-amp) integrator to average the pulses to a more stable value which you then measure with a voltmeter. Of course, it would need to be calibrated and there are probably nonlinearities as I haven't done any deeper analysis (and our schematic/simulation capabilities here are limited), but it's a start.
Chances are you have already thought about this.

There is also a paper on analog conversion of sinusoidal voltage to frequency using a "translinear divider and square-rooter circuit". It may be more complicated, but it gives you real-time conversion/response.

TIC, Time Interval Conversion, is by far the easiest way to simply get to 'give me the pulse rate', as answered by GodJihyo. Any MCU will do the job, once the input pulse has been thresholded to a logic level. Or as you say, it could ADC the signal and do the threshholding in software.

As you are in a teaching situation, an older technique might be instructive for your brighter students.

Multiply the pulse frequency with a PLL, Phase Locked Loop. If you put a divider in the frequency feedback, say /1000, then the output frequency will be 1000 times higher, and so easier to count with high resolution. This technique was common on high end counters many decades ago when MCUs had not yet been invented.

Loop settling time is obviously critical to get a usable result. As a rule of thumb, you should be able to get a critically damped loop to settle within five input pulses.