{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Chapter 9: Specialixed IC Applications" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.1" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R2 is 31.6 kilo ohm\n", "Resistance R3 is 3.27 kilo ohm\n", "Resistance R1 is Open\n", "Resistance R4 is 25.15 kilo ohm\n", "Resistance R5 is 25.15 kilo ohm\n", "Resistance R6 is 1.8 kilo ohm\n", "Resistance R7 is 9.0 kilo ohm\n", "Resistance R8 is 1.5 kilo ohm\n" ] } ], "source": [ "#Example 9.1\n", "#The FLT-U2 is to be used as a second order inverting Butterworth low pass filter\n", "#with a dc gain of 5,cutoff frequency of 2 kHz and Q=10. Determine the values\n", "#of the external components.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "dc_gain=5\n", "f1=2*10**3 # Cutoff freq in Hz\n", "Q=10 # Figure of merit\n", "\n", "\n", "#calculation\n", "R2=(316*10**3)/10 #Resistance R2\n", "R3=(100*10**3)/((3.16*Q)-1)\n", "R4=(5.03*10**7)/f1\n", "R5=R4\n", "R6=1.8*10**3 # Assumption\n", "R7=dc_gain*R6\n", "R8=(R6*R7)/(R6+R7)\n", "\n", "\n", "#result\n", "print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n", "print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n", "print \"Resistance R1 is Open\"\n", "print \"Resistance R4 is\",round(R4/10**3,2),\"kilo ohm\"\n", "print \"Resistance R5 is\",round(R5/10**3,2),\"kilo ohm\"\n", "print \"Resistance R6 is\",round(R6/10**3,2),\"kilo ohm\"\n", "print \"Resistance R7 is\",round(R7/10**3,2),\"kilo ohm\"\n", "print \"Resistance R8 is\",round(R8/10**3,2),\"kilo ohm\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R2 is 100.0 kilo ohm\n", "Resistance R3 is 2.96 kilo ohm\n", "Resistance R1 is Open ohm\n", "Resistance R4 is 10.0 kilo ohm\n", "Resistance R5 is 10.0 kilo ohm\n" ] } ], "source": [ "\n", "#Example 9.2\n", "#Using the FLT-U2, design a second order inverting Butterworth bandpass filter\n", "#with centre frequency f1=5 kHz and Q=10.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "f1=5*10**3 # Center freq in Hz\n", "Q=10 # Figure of merit\n", "R2=100*10**3 # Constant for band-pass filter\n", "\n", "\n", "#calculation\n", "R3=(100*10**3)/((3.48*Q)-1)\n", "R4=(5.03*10**7)/f1\n", "R5=R4\n", "\n", "\n", "\n", "#result\n", "print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n", "print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n", "print \"Resistance R1 is Open\",\"ohm\"\n", "print \"Resistance R4 is\",round(R4/10**3),\"kilo ohm\"\n", "print \"Resistance R5 is\",round(R5/10**3),\"kilo ohm\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.3" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R2 is 100.0 kilo ohm\n", "Resistance R3 is 2.96 kilo ohm\n", "Resistance R1 is Open ohm\n", "Resistance R4 is 10.06 kilo ohm\n", "Resistance R5 is 10.06 kilo ohm\n", "Resistance R6 is 10.0 kilo ohm\n", "Resistance R7 is 10.0 kilo ohm\n", "Resistance R8 is 10.0 kilo ohm\n", "Resistance R9 is 3.33 kilo ohm\n" ] } ], "source": [ "\n", "#Example 9.3\n", "#Using the FLT-U2, design a notch filter with 5 kHz notch out frequency and\n", "#Q=10.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "f1=5*10**3 # Center freq in Hz\n", "Q=10 # Figure of merit\n", "R2=100*10**3 # Constant for band-pass filter\n", "\n", "\n", "#calculation\n", "R3=(100*10**3)/((3.48*Q)-1)\n", "R4=(5.03*10**7)/f1\n", "R5=R4\n", "R6=10*10**3 #Assumption\n", "R7=R6\n", "R8=R6\n", "R9=(R6*R7*R8)/(R6*R7+R6*R8+R7*R8) #Since R6||R7||R8\n", "\n", "\n", "\n", "#result\n", "print \"Resistance R2 is\",round(R2/10**3,2),\"kilo ohm\"\n", "print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n", "print \"Resistance R1 is Open\",\"ohm\"\n", "print \"Resistance R4 is\",round(R4/10**3,2),\"kilo ohm\"\n", "print \"Resistance R5 is\",round(R5/10**3,2),\"kilo ohm\"\n", "print \"Resistance R6 is\",round(R6/10**3),\"kilo ohm\"\n", "print \"Resistance R7 is\",round(R7/10**3),\"kilo ohm\"\n", "print \"Resistance R8 is\",round(R8/10**3),\"kilo ohm\"\n", "print \"Resistance R9 is\",round(R9/10**3,2),\"kilo ohm\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.4" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R2 is 20.0 kilo ohm\n", "Resistance R3 is 14.14 kilo ohm\n" ] } ], "source": [ "\n", "#Example 9.4\n", "#Using the MF5,design a second order Butterworth lowpass filter with a cutoff\n", "#frequency of 500Hz and a passband gain of -2. Assume that a 5,-5 V power supply\n", "#and a CMOS clock are used.\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "f1=500 #Cut-off freq in Hz\n", "Holp=-2 #Passband gain\n", "R1=10*10**3 #Assumption\n", "Q=0.707 #Figure of merit Q is fixed for second order butterworth LPF\n", "#calculation\n", "\n", "R2=-R1*Holp #Using Holp=-R2/R1;\n", "R3=Q*R2 #Using Q=R3/R2\n", "\n", "#result\n", "print \"Resistance R2 is\",round(R2/10**3),\"kilo ohm\"\n", "print \"Resistance R3 is\",round(R3/10**3,2),\"kilo ohm\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.5" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Capacitance C is 1.0 micro Farad\n" ] } ], "source": [ "\n", "#Example 9.5\n", "#In the circuit of figure 9-16(a), Ra=10 Kilo ohm, the output pulse width\n", "#tp=10 ms. Determine the value of C.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Ra=10*10**3 #Resistance in ohm\n", "tp=10*10**-3 #Output pulse width\n", "C=tp/(1.1*Ra)\n", "\n", "#calculation\n", "C=tp/(1.1*Ra)\n", "\n", "#result\n", "print \"Capacitance C is\",round(C*10**6),\"micro Farad\"\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.6" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance Ra is 54.55 kilo ohm\n" ] } ], "source": [ "\n", "#Example 9.6\n", "#The circuit of figure 9-16 (a) is to be used as a divide-by-2 network.\n", "#The frequency of the input trigger signal is 2 kHz.If the value of C=0.01 uF\n", "#What should be the value of Ra.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "f=2*10**3 #Freq of input trigger signal in Hz\n", "C=0.01*10**-6\n", "\n", "#calculation\n", "tp=1.2/f\n", "Ra=tp/(1.1*C)\n", "\n", "#result\n", "print \"Resistance Ra is\",round(Ra/10**3,2),\"kilo ohm\"\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 9.7" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Charging time of the capacitor is 0.42 ms\n", "Discharging time of the capacitor is 0.27 ms\n", "Freq of oscillation is 1.4 kHz\n" ] } ], "source": [ "\n", "#Example 9.7\n", "#In the astable multivibrator of figure 9-21(a), Ra=2.2 kilo ohm, Rb=3.9 kilo ohm\n", "#and C=0.1 uF. Determine the pulse width tc, negative pulse width td and free\n", "#running frequency fo.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Ra=2.2*10**3 # Resistance in ohm\n", "Rb=3.9*10**3 # Resistance in ohm\n", "C=0.1*10**-6 # capacitance in farad\n", "\n", "#calculation\n", "tc=0.69*(Ra+Rb)*C # Charging time of the capacitor\n", "td=0.69*Rb*C # Discharging time of the capacitor\n", "T=tc+td\n", "fo=1/T # Freq of oscillation\n", "\n", "\n", "#result\n", "print \"Charging time of the capacitor is\",round(tc*10**3,2),\"ms\"\n", "print \"Discharging time of the capacitor is\",round(td*10**3,2),\"ms\"\n", "print \"Freq of oscillation is\",round(fo/10**3,1),\"kHz\"\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.8" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Freq of free running ramp generator is 5.16 kHz\n" ] } ], "source": [ "\n", "#Example 9.8\n", "#Referring to the circuit of figure 9-24(a),determine the frequency of the free-\n", "#running ramp generator if R is set at 10 kHz.\n", "#Assume that Vbe=Vd1=0.7 V.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "R=10*10**3 #Resistance in ohm\n", "Vcc=5 #Supply voltage in volt\n", "Vbe=0.7 #Base to emitter voltage in volt\n", "C=0.05*10**-6 #Capacitance in farad\n", "\n", "#calculation\n", "Ic=(Vcc-Vbe)/R #Collector current in ampere\n", "fo=(3*Ic)/(Vcc*C)\n", "\n", "#result\n", "print \"Freq of free running ramp generator is\",round(fo/10**3,2),\"kHz\"\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.9" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Free running frequency of VCO is 2.5 kHz\n", "Lock range frequency of VCO is 1.0 kHz\n", "Capture range frequency of VCO is 66.49 Hz\n" ] } ], "source": [ "\n", "#Example 9.9\n", "#Referring to the circuit of figure 9-33(a),determine the free-running frequency\n", "#fout, the lock range fl and the capture range fc.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "R1=12*10**3 # Resistance in ohm\n", "V_plus=10 # Supply voltage in volt\n", "V_minus=-10 # Supply voltage in volt\n", "C1=0.01*10**-6 # Capacitance in farad\n", "C2=10*10**-6 # Capacitance in farad\n", "\n", "#calculation\n", "fout=1.2/(4*R1*C1)\n", "V=V_plus-V_minus\n", "fl=(8*fout)/V\n", "fc=math.sqrt(fl/(2*math.pi*3.6*10**3*C2))\n", "\n", "#result\n", "print \"Free running frequency of VCO is\",round(fout/10**3,1),\"kHz\"\n", "print \"Lock range frequency of VCO is\",round(fl/10**3),\"kHz\"\n", "print \"Capture range frequency of VCO is\",round(fc,2),\"Hz\"\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.10" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R is 20.0 ohm\n", "Output voltage Vo is 17.0 Volt\n", "Min input voltage Vin is 19.0 Volt\n" ] } ], "source": [ "\n", "#Example 9.10\n", "#Using the 7805C voltage regulator , design a current source that will deliver\n", "#a 0.25 A current to a 48 ohm, 10 W load.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Vr=5 #Voltage in volt\n", "Il=0.25 #Load current in ampere\n", "Rl=48 #Load resistance in ohm\n", "dropout_volt=2 #Constant for IC7805C\n", "\n", "#calculation\n", "R=Vr/Il #Approximate result sice Iq is negligible in the eq. Il=(Vr/Il)+Iq where Iq is quiescent current\n", "Vl=Rl*Il\n", "Vo=Vr+Vl\n", "Vin=Vo+dropout_volt\n", "\n", "#result\n", "print \"Resistance R is\",R,\"ohm\"\n", "print \"Output voltage Vo is\",Vo,\"Volt\"\n", "print \"Min input voltage Vin is\",Vin,\"Volt\"\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.11" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resistance R2_min is 0.71 kilo ohm\n", "Resistance R2_max is 2.03 kilo ohm\n", "Therefore resistance should be varied from R2_min to R2_max values\n", "To do this we take R2 as 3kohm potentiometer\n" ] } ], "source": [ "\n", "#Example 9.11\n", "#Design an adjustable voltage regulator to satisfy the following specifications\n", "#Output voltage Vo= 5 to 12 V\n", "#Output current Io= 1 A.\n", "#Voltage regulator is LM317.\n", "\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Vo_min=5 #Min output voltage in volt\n", "Vo_max=12 #Max output voltage in volt\n", "Vref=1.25 #Reference voltage in volt\n", "Iadj=100*10**-6 #Adjustment pin current in ampere\n", "R1=240 #Assumption\n", "C2=1*10**-6 #Added to the circuit to improve transient response\n", "C3=1*10**-6 #Added to the circuit to obtain high ripple rejection ratios\n", "\n", "#calculation\n", "R2_min=R1*(Vo_min-Vref)/(Vref+Iadj*R1) #Using Vo_min=Vref*(1+R2/R1)+Iadj*R2\n", "R2_max=R1*(Vo_max-Vref)/(Vref+Iadj*R1) #Using Vo_max=Vref*(1+R2/R1)+Iadj*R2\n", "\n", "#result\n", "print \"Resistance R2_min is\",round(R2_min/10**3,2),\"kilo ohm\"\n", "print \"Resistance R2_max is\",round(R2_max/10**3,2),\"kilo ohm\"\n", "print \"Therefore resistance should be varied from R2_min to R2_max values\"\n", "print \"To do this we take R2 as 3kohm potentiometer\"\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.12" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Sense current,Ipk is 1.0 A\n", "Sense resistance,Rsc is 0.33 ohm\n", "Constant K is 1.06\n", "i.e, ton is K times of toff\n", "OFF time period,toff is 24.27 us\n", "ON time period,ton is 25.73 us\n", "Inductance,L is 151.7 uH\n", "Output capacitance,Co is 125.0 uF\n", "Resistance R2 is 12.0 kilo ohm\n", "Resistance R1 is 38.0 kilo ohm\n", "efficiency is 81.0\n" ] } ], "source": [ "\n", "#Example 9.12\n", "#Design a step down switching regulator according to the following\n", "#specifications.\n", "#Input voltage Vin= 12 V dc.\n", "#Output voltage Vo= 5V at 500 m A maximum.\n", "#Output ripple voltage Vripple= 50 mV or 1% of Vo\n", "#Switching regulator :uA78S40.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Iomax=500*10**-3 # Max output current in ampere\n", "Vo=5 # Output voltage in volt\n", "Vd=1.25 # Voltage drop across the power diode in volt\n", "Vin=12 # Input voltage in volt\n", "Vs=1.1 # Output saturation voltage in volt\n", "Vripple=50*10**-3 # Output ripple voltage in volt\n", "Vref=1.245 # Reference voltage in volt\n", "Vr2=1.2 # Voltage across resistance R2 in volt\n", "\n", "#calculation\n", "Ipk=2*Iomax # Sense current in ampere\n", "Rsc=0.33/Ipk # Sense resistance in ohm\n", "K=(Vo+Vd)/(Vin-Vs-Vo) # K= ton/toff\n", "f=20*10**3 # Assuming operating freq in Hz\n", "T=1/f\n", "toff=T/2.06 # Using ton+toff=T and substituting for ton\n", "ton=1.06*toff\n", "Ct=45*10**-5*toff # Oscillator timing capacitance in farad\n", "L=((Vo+Vd)/Ipk)*toff # Inductance in henry\n", "Co=Ipk*((ton+toff)/(8*Vripple)) # Output capacitance in farad\n", "I2=0.1*10**-3 # Assuming the current through R2\n", "R2=Vref/I2 # Resistance R2 in ohm\n", "R2=12*10**3 # Taking approximate value\n", "R1=(R2*(Vo-Vr2))/Vr2 # Using Vr2=(R1*Vo)/R1+R2, voltage divider rule\n", "efficiency=((Vin-Vs+Vd)/Vin)*(Vo/(Vo+Vd))*100\n", "\n", "#result\n", "print \"Sense current,Ipk is\",Ipk,\"A\"\n", "print \"Sense resistance,Rsc is\",Rsc,\"ohm\"\n", "print \"Constant K is\",round(K,2)\n", "print \"i.e, ton is K times of toff\"\n", "print \"OFF time period,toff is\",round(toff*10**6,2),\"us\"\n", "print \"ON time period,ton is\",round(ton*10**6,2),\"us\"\n", "print \"Inductance,L is\",round(L*10**6,2),\"uH\"\n", "print \"Output capacitance,Co is\",round(Co*10**6,3),\"uF\"\n", "print \"Resistance R2 is\",R2/10**3,\"kilo ohm\"\n", "print \"Resistance R1 is\",R1/10**3,\"kilo ohm\"\n", "print \"efficiency is\",efficiency\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 9.13" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Sense current,Ipk is 6 A\n", "Sense resistance,Rsc is 0.055 ohm\n", "Constant K 1.06\n", "i.e, ton is K times of toff\n", "OFF time period,toff is 24.27 us\n", "ON time period,ton is 25.73 us\n", "Oscillator timing capacitance,Ct is 10.9 nF\n", "Inductance,L is = %.8f H 25.28 uH\n", "Output capacitance,Co is = %.7f F 0.75 milli Farad\n" ] } ], "source": [ "#Example 9.13\n", "#Upgrade the switching regulator in Example 9-12 to provide +5V at 3A.\n", "#Use the same specifications given in example 9-12,except the output ratings.\n", "\n", "from __future__ import division #to perform decimal division\n", "import math\n", "\n", "\n", "#Variable declaration\n", "Iomax=3 #Max output current in ampere\n", "Vo=5 #Output voltage in volt\n", "Vd=1.25 #Voltage drop across the power diode in volt\n", "Vin=12 #Input voltage in volt\n", "Vs=1.1 #Output saturation voltage in volt\n", "Vripple=50*10**-3 #Output ripple voltage in volt\n", "Vref=1.245 #Reference voltage in volt\n", "Vr2=1.2 #Voltage across resistance R2 in volt\n", "\n", "#calculation\n", "Ipk=2*Iomax #Sense current in ampere\n", "Rsc=0.33/Ipk #Sense resistance in ohm\n", "K=(Vo+Vd)/(Vin-Vs-Vo) #K= ton/toff\n", "f=20*10**3 #Assuming operating freq in Hz\n", "T=1/f\n", "toff=T/2.06 #Using ton+toff=T and substituting for ton\n", "ton=1.06*toff\n", "Ct=45*10**-5*toff #Oscillator timing capacitance in farad\n", "L=((Vo+Vd)/Ipk)*toff #Inductance in henry\n", "Co=Ipk*((ton+toff)/(8*Vripple)) #Output capacitance in farad\n", "\n", "#result\n", "print \"Sense current,Ipk is\",Ipk,\"A\"\n", "print \"Sense resistance,Rsc is\",Rsc,\"ohm\"\n", "print \"Constant K\",round(K,2)\n", "print \"i.e, ton is K times of toff\"\n", "print \"OFF time period,toff is\",round(toff*10**6,2),\"us\"\n", "print \"ON time period,ton is\",round(ton*10**6,2),\"us\"\n", "print \"Oscillator timing capacitance,Ct is\",round(Ct*10**9,1),\"nF\"\n", "print \"Inductance,L is = %.8f H\",round(L*10**6,2),\"uH\"\n", "print \"Output capacitance,Co is = %.7f F\",round(Co*10**3,5),\"milli Farad\"\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }