{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 13: Integrated Circuit Timer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.10: Resistor_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.10\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 10;// in µF\n", "C = C*10^-6;// in F\n", "T_ON = 5;// in sec\n", "R = T_ON/(1.1*C);// in ohm\n", "disp(R,'The resistor value in ohm is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.11: Resistor_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// EXa 13.11\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 10;// in µF\n", "C = C * 10^-6;// in F\n", "T_off = 1;// in sec\n", "//Formula T_off= 0.693*R2*C\n", "R2 = T_off/(0.693*C);// in ohm\n", "disp(R2,'The value of R2 in Ω is');\n", "T_on = 3;// in sec\n", "// Formula T_on= 0.693*(R1+R2)*C\n", "R1 =T_on/(C*0.693)-R2;// in ohm\n", "disp(R1,'The value of R1 in Ω is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.12: Value_of_RLED.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.12\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.22;// in µF\n", "C=C*10^-6;// in F\n", "T_on = 10;// in ms\n", "T_on = T_on * 10^-3;// in s\n", "V_CC = 15;// in V\n", "V_BE = 0.7;// in V\n", "V_EC = 0.2;// in V\n", "V_LED= 1.4;// in V\n", "I_LED= 20*10^-3;// in A\n", "R = T_on/(C*1.1);// in ohm\n", "R = R *10^-3;// in k ohm\n", "disp('Values for first circuit : ')\n", "disp(R,'The value of R in kΩ is');\n", "V_o = V_CC-(2*V_BE) - V_EC;// in V\n", "disp(V_o,'The output voltage in V is');\n", "R_LED = (V_o - V_LED)/(I_LED);// in ohm \n", "disp(R_LED,'The value of R_LED in Ω is : ')\n", "// Part (ii)\n", "f= 1*10^3;// in Hz\n", "C=0.01*10^-6;// in F\n", "D= 95/100;// duty cycle\n", "// Formula f= 1.44/((R1+2*R2)*C)\n", "// R1+2*R2= 1.44/(f*C) (i)\n", "// D= (R1+R2)/(R1+2*R2) or\n", "// R2= (1-D)/(2*D-1)*R1 (ii)\n", "// From eq (i) and (ii)\n", "R1= 1.44/(f*C*(1+2*((1-D)/(2*D-1))));// in ohm\n", "R2= (1-D)/(2*D-1)*R1;// in ohm\n", "disp('Values for second circuit : ')\n", "disp(R1*10^-3,'The value of R1 in kΩ is : ');\n", "disp(R2*10^-3,'The value of R2 in kΩ is : ');\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.13: Resistor_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.13\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "T = 5;// in msec\n", "T = T * 10^-3;// in sec\n", "C = 0.1;// in µF\n", "C = C * 10^-6;// in F\n", "R = T/(C*1.1);// in ohm\n", "R = R * 10^-3;// in k ohm\n", "disp(R,'The resistor in kΩ is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.14: A_555_based_square_wave_generator.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.14\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 1;// in kHz\n", "f = f * 10^3;// in Hz\n", "T = 1/f;// in s\n", "T = T * 10^3;// in msec\n", "T_d = T/2;// in msec\n", "T_d = T_d * 10^-3;// in sec\n", "C = 0.1;// in µF\n", "C = C * 10^-6;// in F\n", "R2 = T_d/(0.69*C);// in ohm\n", "R2 = R2 * 10^-3;// in k ohm\n", "disp(C*10^6,'The value of C in µF is : ')\n", "disp(R2,'The value of R2 in kΩ is');\n", "disp('The value of R1 will be 100 Ω +10 kΩ pot');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.15: A_555_timer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.15\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 800;// in Hz\n", "D = 0.6;\n", "C = 0.1;// in µF\n", "C = C * 10^-6;// in F\n", "// Formula f= 1.44/((R_A+2*R_B)*C)\n", "// R_A+2*R_B= 1.44/(f*C) (i)\n", "// D= (R_A+R_B)/(R_A+2*R_B) or\n", "// R_B= (1-D)/(2*D-1)*R_A (ii)\n", "// From eq (i) and (ii)\n", "R_A= 1.44/(f*C*(1+2*((1-D)/(2*D-1))));// in ohm\n", "R_B= (1-D)/(2*D-1)*R_A;// in ohm\n", "disp(R_A*10^-3,'The value of R_A in kΩ is : ');\n", "disp(R_B*10^-3,'The value of R_B in kΩ is : ');\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.16: A_555_timer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.16\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 700;// in Hz\n", "D = 0.5;\n", "C = 0.1;// in µF\n", "C = C * 10^-6;// in F\n", "// Formula f= 1.44/((R_A+2*R_B)*C)\n", "// R_A+2*R_B= 1.44/(f*C) (i)\n", "// D= (R_A+R_B)/(R_A+2*R_B) or\n", "// R_A+R_B=D*1.44/(f*C)\n", "// From eq (i) and (ii)\n", "R_B=round(1.44/(f*C))*(1-D);\n", "R_A= round(D*1.44/(f*C))-R_B;\n", "//R_A= 1.44/(f*C*(1+2*((1-D)/(2*D-1))));// in ohm\n", "//R_B= (1-D)/(2*D-1)*R_A;// in ohm\n", "disp(round(R_A),'The value of R_A in Ω is : ');\n", "disp((R_B*10^-3),'The value of R_B in kΩ is : ');\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.17: Output_pulse_width.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.17\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "R_A = 20;// in k ohm\n", "R_A = R_A * 10^3;// in ohm\n", "C = 0.1;// in µF\n", "C = C*10^-6;// in F\n", "pulse_width = 1.1*R_A*C;// in s\n", "disp(pulse_width*10^3,'The output pulse width in ms is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.18: Relationship_between_tp_and_T.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.18\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "n=4;\n", "// t_p= X*T, where\n", "X= [0.2+(n-1)];// (assumed)\n", "disp('The relation between t_p and T is :')\n", "disp('t_p = '+string(X)+'*T');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.19: Value_of_RA.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.19\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.02;// in µF\n", "C = C * 10^-6;// in F\n", "f=2*10^3;//frequency in Hz\n", "T = 1/f;// in sec\n", "n = 5;\n", "t_p = (0.2+(n-1))*T;// in sec\n", "R_A = t_p/(1.1*C);// in ohm\n", "disp(R_A*10^-3,'The value of R_A in kΩ is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.1: Frequency_and_duty_cycle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.1\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.01;// in µF\n", "C = C *10^-6;// in F\n", "R_A = 2;// in k ohm\n", "R_A = R_A * 10^3;// in ohm\n", "R_B = 100;// in k ohm\n", "R_B = R_B * 10^3;// in ohm\n", "T_HIGH = 0.693*(R_A+R_B)*C;// in s\n", "T_HIGH = T_HIGH;// in sec\n", "T_LOW = 0.693*R_B*C;// in s\n", "T_LOW = T_LOW ;// in sec\n", "T = T_HIGH + T_LOW;// in sec\n", "f = 1/T;// in Hz\n", "disp(f,'Frequency in Hz is');\n", "D = (T_HIGH/T)*100;// in %\n", "disp(D,'Duty cycle in % is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.2: Positive_and_negative_pulse_width.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.2\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 1;// in µF\n", "C = C * 10^-6;// in F\n", "R_A = 4.7;// in k ohm\n", "R_A = R_A * 10^3;// in ohm\n", "R_B = 1;// in k ohm\n", "R_B = R_B * 10^3;// in ohm\n", "T_on = 0.693*(R_A+R_B)*C;// in s\n", "T_on = T_on;// in sec\n", "disp(T_on * 10^3,'Positive pulse width in ms is');\n", "T_off = 0.693*R_B*C;// in s\n", "T_off = T_off;// in ms\n", "disp(T_off * 10^3,'Negative pulse width in ms is');\n", "f = 1.4/((R_A+2*R_B)*C);// in Hz\n", "disp(f,'Free running frequency in Hz is');\n", "D = ((R_A+R_B)/(R_A+(2*R_B)))*100;// in %\n", "disp(D,'The duty cycle in % is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.3: Resistor_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.3\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.01;// in µF\n", "C = C * 10^-6;// in F\n", "f = 1;// in kHz\n", "f = f * 10^3;// in Hz\n", "R_A = 1.44/(2*f*C);// in ohm\n", "R_A = R_A * 10^-3;// in k ohm\n", "R_B= R_A;// in kohm\n", "disp(R_A,'The value of both the resistors required in kΩ is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.4: A_555_timer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.4\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 700;// in Hz\n", "C = 0.01;// in µF\n", "C = C * 10^-6;// in F\n", "a = 1.44;\n", "R_A = a/(2*f*C);// in ohm\n", "R_A = R_A * 10^-3;// in k ohm\n", "R_B =R_A;// in k ohm\n", "disp(C*10^6,'The the value of C in µF is : ')\n", "disp(R_A,'The value of both the resistors in kΩ is');\n", "disp('(Standard value of resistor is 100 kΩ)')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.5: Frequency_and_duty_cycle.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.5\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.01;// in µF\n", "C = C *10^-6;// in F\n", "R_A = 2;// in k ohm\n", "R_A = R_A * 10^3;// in ohm\n", "R_B = 100;// in k ohm\n", "R_B = R_B * 10^3;// in ohm\n", "T_HIGH = 0.693*(R_A+R_B)*C;// in s\n", "T_HIGH = T_HIGH;// in sec\n", "T_LOW = 0.693*R_B*C;// in s\n", "T_LOW = T_LOW ;// in sec\n", "T = T_HIGH + T_LOW;// in sec\n", "f = 1/T;// in Hz\n", "disp(f,'Frequency in Hz is');\n", "D = (T_HIGH/T)*100;// in %\n", "disp(D,'Duty cycle in % is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.6: Positive_and_negative_pulse_width.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.6\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 1;// in µF\n", "C = C * 10^-6;// in F\n", "R_A = 4.7;// in k ohm\n", "R_A = R_A * 10^3;// in ohm\n", "R_B = 1;// in k ohm\n", "R_B = R_B * 10^3;// in ohm\n", "T_on = 0.693*(R_A+R_B)*C;// in s\n", "T_on = T_on;// in sec\n", "disp(T_on * 10^3,'Positive pulse width in ms is');\n", "T_off = 0.693*R_B*C;// in s\n", "T_off = T_off;// in ms\n", "disp(T_off * 10^3,'Negative pulse width in ms is');\n", "f = 1.4/((R_A+2*R_B)*C);// in Hz\n", "disp(f,'Free running frequency in Hz is');\n", "D = ((R_A+R_B)/(R_A+(2*R_B)))*100;// in %\n", "disp(D,'The duty cycle in % is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.7: Value_of_resistor_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.7\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "C = 0.01;// in µF\n", "C = C * 10^-6;// in F\n", "f = 1;// in kHz\n", "f = f* 10^3;// in Hz\n", "a = 1.44;\n", "R_A = a/(2*f*C);// in ohm\n", "R_A = R_A * 10^-3;// in k ohm\n", "R_B = R_A;// in k ohm\n", "disp(R_A,'The value of both the resistors required in kΩ is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.8: A_555_timer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.8\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 700;// in Hz\n", "C = 0.01;// in µF\n", "C = C * 10^-6;// in F\n", "a = 1.44;\n", "R_A = a/(2*f*C);// in ohm\n", "R_A = R_A * 10^-3;// in k ohm\n", "R_B =R_A;// in k ohm\n", "disp(C*10^6,'The the value of C in µF is : ')\n", "disp(R_A,'The value of both the resistors in kΩ is');\n", "disp('(Standard value of resistor is 100 kΩ)')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 13.9: A_555_timer.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 13.9\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "f = 800;// in Hz\n", "C = 0.01;// in µF\n", "C =C * 10^-6;// in F\n", "R_A = 1.44/(5*f*C);// in ohm\n", "R_A = R_A * 10^-3;// in k ohm\n", "disp(R_A,'The value of R_A in kΩ is');\n", "R_B = 2*R_A;// in k ohm\n", "disp(R_B,'The value of R_B in kΩ is ');" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }