Heart rate counter using timer and counters

In this project I’ve designed a simple heart beat rate counter using basic building blocks of electronics like timer and counters, OPAMPs etc. My challenge here was to design it without using any microcontroller and to give it a retro look like the 80’s and early 90’s. So I fabricated it on a preff board and soldered the connections using wires.

The main function of this device is to count pulses form your finger tip for 1 minute. After a minute the 7 segment display will freeze for 10 seconds, the value on the display will be your heart beat rate or BPM. Then by pressing a RESET button all the timer, counters and registers are reset back.

1. heart RATE  sensor design
ECG response. Image source : Internet

The electrocardiogram is the best way to see the electrical response of our heart whenever it pumps blood. From the graph it can be seen that the R peak is the highest peak of the signal. The counters counts only in the presence of clock signal. CLOCK signals are basically a train of square wave at a certain frequency. So the main objective of the heart rate sensor will be to generate square wave which will be triggered by the R peaks of the signal. My first attempt was to use a contact microphone with an amplifier which will generate the exact response as shown in the image and using a comparator I can easily  generate square waves from the R peaks. But keeping the deadline of the project in mind I’ve to change my plan and I decided to use infrared sensor instead. This technique is known as Photoplethysmography where we use a pair of infrared LED and an infrared receiver to generate electrical signals corresponding to the intensity of blood flow through our finger due to the systolic and diastolic pressure.

For the IR transmitter and receiver I am using the TCRT5000 module because the package design is suitable for this project. The image below will show the pin diagram and the most basic interfacing of the TCRT5000 which will output a voltage that can be used for taking ADC readings also.

Basic things needed to interface TCRT5000. R2 limits the current for IR transmitter. R1 controls the sensitivity of the output
Top view and pin out diagram of TCRT5000

 

 

 

 

 

 

 

The receiver of the TCRT5000 is a phototransistor which allows current to flow whenever the base is triggered by the photons emitted by the IR transmitter. To get an output voltage we need to add a resistor which will create a voltage drop across it. Now to get our pulses we need some more add-ons. The circuit below is the actual circuit I used to generate CLOCK pulses for the counter.

With the following passive high pass filter and active low pass filter it is forming a band pass filter which allows the frequencies between 0.7 Hz to 2.34 Hz that also have a gain of 101.  The output LED is to give us visual feedback whenever there is pulses. The output is feed to a comparator circuit which will output the clock pulses for the counters. The 10K trim pot is used to adjust the sensitivity of the comparator.

2. pulse counter and display driver

The CD4026 is the appropriate IC I used for this, it is a counter plus 7 segment decoder in one package. The following circuit diagram will show the connection of the 7 segment displays with the CD4026.

  • Pin 1 is the CLOCK pin. The output of the heart rate sensor is attached with it.
  • Pin 5 is the CARRY OUT pin so the pin 5 of the first CD4026 is connected with the CLOCK pin of the second CD4026. So that after 9th count the first counter will get reset and start counting from zero but the second counter will count 1 and it will display 10.
  • Pin 15 is the RESET pin which resets both the counters whenever the push button is pressed.
  • Pin 2 is the Disable CLOCK pin. If it is pulled HIGH then the counter will no longer response to the clock pulses. This pin is connected with a precision 1 min timer which makes the pin HIGH for 10s after 1 min. Thus the display freezes and we get the heart rate.
  • Pin 3 is the Display Enable pin which needs to be pulled up to +5V to make the display work.
  • Pin 16 is the Vcc pin.
  • Pin 8 is the Ground pin.
  • The other pins are the output pins which is connected to the segments of the display.
3. precision 1 min timer

This circuit consist of a 555 timer running in astable mode with 50% duty cycle. The frequency of the timer needs to be 1Hz  (1/(on time + off time)). The output of the 555 timer is feed to the CLOCK pin of the 1st CD4017 decade counter IC which will shift it’s output every 1s. There are 10 outputs so we are getting a time of 10s now the CARRY OUT pin of the 1st CD4017 is connected to the CLOCK pin of the 2nd CD4017. So after 10s the Q0 pin of the 2nd CD4017 goes HIGH after 20s Q1 pin goes high and so on. So at pin Q5 we will get exactly 60s or 1min and Q5 will be HIGH for 10s. That will activate a flip flop (IC7474) which will then make the CLOCK DISABLE pin of the two CD4026 HIGH for 10s. The circuit diagram for the precision 1 min timer is shown below.

4. power supply

To make it portable I’ve used a 2000mAh cell phone battery with a DC-DC boost converter to provide 5V to the circuit which gives a run time of 7 days in a single charge.

Future modifications : I’m working on a digital stethoscope which will be added in this circuit.

Advantage of using microcontroller : If this project is done using a microcontroller the circuit would be more simple. We don’t have to wait 1 min to get the reading as in the software part we have the freedom of doing calculations. But in this method we will learn the core of digital electronics.

Here is the video demonstration of this project

Written by : Subhadeep Biswas
Advertisements

The Dark Detector

/Basic concept

This blog will go through one of the useful applications of npn transistor & the voltage divider circuit. The npn transistor BC547 is configured to work as a switch.

So from the datasheet of BC547 transistor we can see that the maximum value of Vbe(on) is 0.7 V. That means if the base to emitter voltage is less than 0.7 V, no current will flow through collector to emitter of the transistor and it will remain off. When Vbe will be greater than 0.7 V, current will flow from collector-emitter, switching on the transistor. Now if a load is connected to the collector it will be switched on. Now in this circuit we implemented a voltage divider, the output of the voltage divider is connected to the base of the BC547. The voltage divider is the combination of a resistance and LDR.

/The voltage divider circuit
Voltage Divider Circuit
Voltage Divider Circuit

 

It is a very useful circuit which is implemented in different applications. The combination of R1 & R2 will affect Vout.Vout = Vin.(R2/R1+R2) so if we want to make 5V to 2.5V, R1 must be equal to R2. Here we take R1 = R2 = 1KΩ, and it gives perfect 2.5V.

 

 

64

 

/The Dark Detector Circuit
2
Dark Detector Circuit

Here the output of the voltage divider which is generally a combination of R1 & LDR is connected to the Base of the BC547 & a white LED is connected to the  Collector. The 220Ω resistance limits the current and prevents the LED from getting damaged.

When light falls on the LDR the resistance offered by LDR is very low. Let, R1 = 220 KΩ & R(LDR) = 4.6 KΩ. If Vin is 9V then voltage on the Base of BC547 = 0.184 V which is less than 0.7V so the BC547 is now off and the LED will not glow. Now when it is dark the resistance offered by LDR is very high in order of MegaΩ. Suppose practically R(LDR) = 150KΩ so Base voltage of the BC547 is 3.648V which is greater than 0.7V. Now current will flow from C-E of the BC547 & the LED will glow.

There are different sizes of LDR available in the market. Sometimes small LDRs don’t work properly in the circuit, so to increase the sensitivity connect two small LDRs in parallel or change the value of R1 which can be calculated from the Voltage Division formulæ.

/Results

8 7

I’ve made a video describing some basic concept of a NPN transistor, this project is described well in the video.

Written by : Subhadeep Biswas

Making a simple FM Transmitter

FM Transmitters are that type of gadget which gives you the feelings of a RJ. You can make your own short-range radio channel and air any songs, audio clips as well as your voice in the form of radio frequency. The transmission process is done by following steps which are audio pre amplification followed by modulation then transmission. There are two types of modulation Amplitude Modulation(AM) & Frequency Modulation(FM) both are the part of Radio Frequency (RF). 88 MHz to 180 MHz is generally known as the FM Band.

Audio signal from media player, microphones are very low level signal, of the order of mill volts. This extremely small voltage needs to be first amplified. A common emitter configuration of a bipolar transistor produces an amplified inverted signal.

Another important aspect of this circuit is the oscillator circuit. This is a LC oscillator where energy moves back and forth between the inductor and capacitor forming oscillations. It is mainly used for RF application.

When this oscillator is given a voltage input, the output signal is a mixture of the input signal and the oscillating output signal, producing a modulated signal. In other words, the frequency of the oscillator generated circuit varies with the application of an input signal, producing a frequency modulated signal.

transmitter
A simple Fm Transmitter Circuit

Some details about the design of the circuit :

1.Selecting the Vcc : This circuit uses a NPN Bipolar Junction Transistor (2N3904) or you can use BC547 or equivalent. The Vceo of the transistor is 40V so minimum Vcc is 9V.

2.Selecting the Capacitor C1 : The capacitor modulates the current going through the transistor. A large value indicates bass or low frequency whereas small value indicates treble higher frequency. Here 1uF, 25V electrolytic capacitor is used.

3.Selecting L1 & C4 : Here L1 & C4 is the oscillator known as LC oscillator. Frequency of oscillation is obtained from the formula, f = 1/(2Π√LC). 

Here is some pictures of my complete and decorated setup :

breadboard setup
Breadboard setup
decorated setup1
Decorated setup1
setup2
Complete setup
Written by : Subhadeep Biswas