Sunday 3 July 2016

Building a 1 second delay timer using IC-555

A one second delay timer

IC 555 timer (available in 8 pin DIP or TO-99 package) is one of the most popular and versatile sequential logic devices which can be used in mono-stable and stable modes. The inputs and output are directly compatible with both TTL and CMOS logic circuits. The functional block diagram of 555 timer is shown below in Fig 1



Fig 1
Functional Block Diagram

It has two comparators which receive their reference voltages by a set of three resistances connected between the supply voltage VCC and ground. The reference voltage for comparator 1 is 2VCC/3 and for comparator 2 is VCC/3. These reference voltages have control over the timing which can be varied electronically, if required, by applying a voltage to the control voltage input terminal. If this is not required, then a bypass capacitor (0.01microFarad) should be connected between this terminal and ground to bypass noise and/or ripple voltages from the power supply.

555 can be configured as Astable multivibrator or Monostable multivibrator. In the following demonstration, it is configured as Astable (a free running oscillator) that showcases a 1 second delay timer. It can be essentially used as 1 second delay flip-flop or trigger to some event. To configure specific time delay, there is a equation of 555 timer IC and its as follows:

T1 = 0.683*(R1+R2)*C ---- THE ON TIME
T2 = 0.693*R2------------ THE OFF TIME

In my circuit, R1 = R2 = 2200 ohms and C = 10 microFarad, thus we have T1 = 0.6seconds and T2 = 0.3seconds. 

Total time = T = T1 + T2 = 0.9seconds almost 1second delay

Here is Fig 2 which shows the circuit diagram, the popular Astable Multivibrator


Fig 2



Here is the Video which shows the 1 second timer.








Tuesday 28 June 2016

REMOVING NOISE BURRIED IN A SIGNAL

A PHASE SENSITIVE DETECTION CIRCUIT
Introduction

It is often found out that the signal which we want is smaller or hidden within the noise. A good example in this case will be data acquisition systems that measure physical parameters, such as a vector component measurement using accelrometer or a wireless signal of specific frequency to be unearthed from bundle of bandwidths. Phase sensitive detection is a method whereby the signal of interest is "tagged" by modulating at a frequency much higher than any normal changes Which the signal might experience. This tagged signal is then later retrieved amidst the unwanted noise.  

A simple way of understanding phase sensitive operation is to study the circuit shown in Figure 1. Here, the input signal is tagged with a modulating sine wave of a certain frequency. This same modulating frequency is applied to a switch which alternates from sampling the unaltered wave every odd half cycle to sampling the inverted wave every even half cycle. The input and corresponding output are shown on the same time axis. 


Figure 1
Phase detection circuit

·        For positive going input, the switch is in position 1 and the unaltered wave is sampled.
·        For negative going input, the switch is in position 2 and the inverted wave is sampled.

Therefore, in both cases, the output is positive.Since noise will also be sampled along the required signal, but over many cycles it will average out to be zero. Essentially the signal averaging will be done by RC Filter where the time constant is made larger to average over as many ouput cycles as possible. But the catch is, this increase has a limit because variations of signal, occuring due to the changes in experimental parameters, might also be filtered out. Thus, the time constant must be made as small as possible  so that the experimental variations can be tracked. Suppose the this circuit is used for detection of voltage across a temperature sensor, immersed in say, a water bath and if one wishes to measure every 10 oC as the water is heated upto its boiling point and now suppose the water gets heated 1 degree per minute, then the time constant has to be small enough to track the changes every 10 oC.


 Block Diagram


                                                                            Figure 2

Circuit description

Figure 2 is the Phase Sensitive Detector circuit. Since this is a circuit which will enable us to test realtime environment, we will create some signals as noise for us. The above circuit has 3 inputs for:
·        A sine wave which will serve as the noise.
·        A triangle wave which will serve as the signal of interest.
·        A square wave which will serve as the modulation input.

The modulation is controlled by an SW06 FET analog switch. The two boxes in the diagram each represent 1/2 of the entire 16 pin DIP chip. The triangle wave is input into the SW06 switch. Note that the two inputs (pins 3 and 14) go to the same output (pins 2 and 15 which are tied together). Note, however, that the switch is configured such that only pin 3 or pin 14 is connected to the output at any one time. The modulating signal at pin 16 switches the output from sampling the triangle wave to sampling ground. Following the first half of the SW06 switch is a 741 op amp configured as a summing amplifier. It sums the modulated signal of interest and the unmodulated noise. Following this first 741, is a second 741 op amp configured as a straight inverting amplifier. Along with this is a wire which samples the non-inverted wave. The inverted wave must be exactly equal in magnitude but of opposite polarity to the non-inverted wave and hence the resistors here should have 1% precision.

The output of this stage is input to the other half of the SW06 switch. This half of the switch is modulated with the same frequency (and phase) as the other half switch (note the connection from pin 9 to pin 16). Therefore, the output is sampled with the same phase and frequency which has been tagged on the signal of interest. The last stage is the RC low pass filter. Here, as stated above, the RC time constant should be made small enough so that real variations in the signal of interest can be tracked. Therefore the RC time constant should be much smaller than the period of the triangle wave. The modulation frequency should be high enough to assure filtering of many cycles within one RC time constant. Therefore, the period of modulation should be much shorter than the RC time constant.



Procedure
Part 1, 1/2 SW06 switch and summing amplifier.

Construct the first two components of the phase sensitive detector circuit, the first 1/2SW06 switch and the summing amplifier. For the three inputs, we will use a 60 Hz, ~ 6 Vp-p sine wave for the noise input, a 50 Hz, 2 Vp-p triangle wave for the signal of interest, and a 700 Hz, 0 to 5 volt square wave for the modulation input. Your signal to noise ratio is therefore 1:3. Use the same + 12 V supply voltages for the SW06 switch and the 741 op amps. The datasheet for the SWO6 switch indicates that it will operate at supply voltages down to + 12 V.

To trigger the oscilloscope, use an external trigger from the triangle wave input. Draw this portion of the circuit. Measure the voltages at points A and B of the circuit.



Part 2 - Remaining circuit
Construct the remaining portions of the phase sensitive detector circuit, save for the RC output filter. As an initial check, make sure that the voltages you measured at points A and B in this circuit are still the same. Now, for the RC output filter, you would like to try to make the RC time constant large enough to average over many modulation cycles, but small enough to retain your original input signal. Therefore, the period of the modulation cycle << RC << the period of the input signal. This is hard to do since the input signal period and modulation period are not that much different. Let's increase the modulation frequency to 10 kHz. Now make RC such that 10Tmodulation < RC < 0.1Tinput signal. Record your values for R and C. Attach your RC filter to the output of the circuit. Draw the entire circuit. Now, using 10 kHz for your modulation frequency, measure points C, D and finally the output of this circuit on the oscilloscope.

The final output the triangle wave without the unwanted noise will be observed.
This is how you retrieve a signal buried in noise. Now, adjust your signal frequency and verify that you may still produce an adequate output even when the noise frequency is very close to the signal frequency.
Part 3 is optional test, need not necessarily be included in the article. It is just testing circuit. If this is not included, then in the parts list, Lock-in amplifier should not be mentioned.

Part 3, - Actual signal lock in.
To illustrate the effectiveness of phase sensitive detection, a circuit using a commercial lock-in amplifier is set up in the other room and diagrammed below in Figure 3. A light emitting diode (LED) is powered by a function generator so that the light emitted is modulated at a frequency of about 1 kHz. At the same time, a photoresistor op amp circuit is used to detect the light from this LED. The output of this circuit is monitored on both an oscilloscope and the lock-in amplifier. Also, the function generator is connected directly to the lock-in amplifier so the lock-in "knows" what signal frequency it should be looking for.


Figure 3

Lock-in amplifier set up to measure the output of a light emitting diode. With the lights out in the room, draw the oscilloscope output. Label both the voltage and time axes. Determine the amplitude of the wave that corresponds to the oscillating signal. In
addition, record the output of the lock-in. Now, switch the lights on. Again draw the oscilloscope output labeling the voltage and time axes. The lock-in's output changes appreciably due to the increased noise. To test whether the lock-in detects LED or not, place your hand in front of the LED and see what this does to the signal.

Parts required
·         Oscilloscope
·         Appropriate capacitors & resistors for the RC filter/time constant
·         1 DIP SW06 JFET quad analog switch
·         2 DIP 741 op amps
·         3 function generators
·         Commercial lock-in amplifier such as AD630
  

The result on a 1996 CRO at my home

Friday 10 June 2016

Emergency Battery Tester











Whenever we have the remote control’s pair of batteries down, we have no way to know whether they are or not. Most often time, it is seen that people bang the back of remote and press keys thereafter, when things work, people ignore the low battery and if they don’t we change the batteries. Since this is a luxurious requirement, the problem of low battery of the appliance for hearing impaired or pace-maker holding patients is critical. Here is a simple low battery indicator or tester circuit. The circuit can also be used as a basic demonstration of voltage divider circuit & use of NOT Gate

The circuit is built on a NOT Gate that will drive the LED as an indicator. Input to the NOT Gate is from a voltage divider circuit. The battery under test (BUT) creates the potential across the voltage divider circuit. The drop across one of the resistor is fed as input to the input of the NOT Gate. The entire circuit is powered with 5V DC Supply or +9V Battery.

Whenever the appliance is not working, simply power this circuit, place the terminal of the BUT at the input. If the voltage of the battery is less than 1.6V, the LED will glow, else it won’t.
(For testing purpose, I have used 2 (1.6V each) pencil cells. Together they create 3.2V. The input to the NOT Gate is 1.6V which is taken as HIGH and the LED does not glow. When one battery is removed, the total voltage now is 1.6V & voltage drop at the input of NOT Gate is 0.8V, which is taken as LOW and the LED glows.

The circuit should be soldered and fabricated in a suitable cabinet so that the BUT is placed at terminals and result is seen.

Here is the Video of the circuit built by me.