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.