summaryrefslogtreecommitdiff
path: root/sample_notebooks/YogeshPatil/YogeshPatil_version_backup/Chapter_11.ipynb
blob: f749209fe77d3bdf18d32f70ba5dde3cd3fc2d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11: Voltage Regulators"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.1, Page No. 414"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# op-amp series voltage regulator design\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vin_min = 18-3             # min input voltage specification\n",
      "Vin_max = 18+3             # max input voltage specification\n",
      "Vout = 9                   # output voltage specification\n",
      "Iout_min = 10*10**-3       # min output current specification\n",
      "Iout_max = 50*10**-3       # max output current specification\n",
      "Vz = 5.6                   # zener breakdown voltage\n",
      "Pzmax = 0.5                # Maximum power dissipation in zener\n",
      "\n",
      "#Calculations\n",
      "R1 = 10*10**3              # assumed\n",
      "R2 = R1/((Vout/Vz)-1)\n",
      "R3 = (Vin_min-Vz)/Iout_max\n",
      "Iz = (Vin_max-Vz)/R3\n",
      "Pd = Iz*Vz\n",
      "beta = 30                  # assumed\n",
      "Ib = Iout_max/(beta+1)\n",
      "\n",
      "#Result\n",
      "print(\"Element values for designed circuit are as follows:\\nR1 = %d k-ohm\\nR2 = %.2f k-ohm\"%(R1/1000,R2/1000))\n",
      "print(\"R3 = %.3f k-ohm\\nIB = %.2f mA\"%(R3/1000,Ib*1000))\n",
      "#Answer for R3 is wrong in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Element values for designed circuit are as follows:\n",
        "R1 = 10 k-ohm\n",
        "R2 = 16.47 k-ohm\n",
        "R3 = 0.188 k-ohm\n",
        "IB = 1.61 mA\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.2, Page No. 420"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Regulator using IC 723\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vout = 5                     # Required output voltage\n",
      "Iout = 100*10**-3            # Required output current\n",
      "Vin_min = 15-(0.2*15)        # Min input voltage\n",
      "Vin_max = 15+(0.2*15)        # Max input voltage\n",
      "Isc = 150*10**-3             # Short circuit current requirement\n",
      "Vsense = 0.7                 # short circuit voltage\n",
      "Vref = 7.15                  # reference votage for IC 723\n",
      "Id = 1*10**-3                # potential divider current\n",
      "\n",
      "\n",
      "#Calculation\n",
      "Rsc = Vsense/Isc\n",
      "R1 = (Vref-Vout)/Id\n",
      "R1std = 2.2*10**3 \n",
      "R2 = R1std/((Vref/Vout)-1)\n",
      "R2std = 5.1*10**3 \n",
      "R3 = R1std*R2std/(R1std+R2std)\n",
      "R3std = 1.5*10**3 \n",
      "\n",
      "#Result\n",
      "print(\"R1 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(R1/1000,R1std/1000))\n",
      "print(\"R2 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(R2/1000,R2std/1000))\n",
      "print(\"R3 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(math.floor((R3/1000)*1000)/1000,R3std/1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R1 = 2.150 k-ohm\t We use 2.2 k-ohm as standard resistor.\n",
        "R2 = 5.116 k-ohm\t We use 5.1 k-ohm as standard resistor.\n",
        "R3 = 1.536 k-ohm\t We use 1.5 k-ohm as standard resistor.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.3, Page No. 421"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Ic 723 based positive voltage regulator\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vout = 12.0               # output voltage\n",
      "Il = 500*10**-3           # load current\n",
      "Isc = 600*10**-3          # short circuit current\n",
      "Vref = 7.0                # IC 723 reference voltage \n",
      "Vsense = 0.6              # voltage at short circuit\n",
      "\n",
      "#Calculation\n",
      "R1 = 4.7*10**3            # assumed\n",
      "R2 = Vref*R1/(Vout-Vref)\n",
      "R2std = 6.8*10**3 \n",
      "Rsc = Vsense/Isc\n",
      "R3 = R2std*R1/(R2std+R1)\n",
      "Psc = Isc**2*Rsc*1000\n",
      "I = Vout/(R1+R2std)\n",
      "I= math.floor(I*10**6)/10**6\n",
      "P1 = I**2*R1*1000\n",
      "P2 = I**2*R2std*1000\n",
      "\n",
      "#Result\n",
      "print(\"R1 = %.1f k-ohm\\nR2 = %.2f k-ohm = %.1f k-ohm(standard value)\\nRsc = %.1f ohm\"%(R1/1000,R2/1000,R2std/1000,Rsc))\n",
      "print(\"\\nPower wattage:\\nPsc = %.0f mW\\nP1 = %.3f mW\\nP2 = %.3f mW\"%(Psc,math.floor(P1*1000)/1000,P2))\n",
      "print(\"Hence, both R1 and R2 may be selected safely of 1/16th watt power rating.\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R1 = 4.7 k-ohm\n",
        "R2 = 6.58 k-ohm = 6.8 k-ohm(standard value)\n",
        "Rsc = 1.0 ohm\n",
        "\n",
        "Power wattage:\n",
        "Psc = 360 mW\n",
        "P1 = 5.112 mW\n",
        "P2 = 7.397 mW\n",
        "Hence, both R1 and R2 may be selected safely of 1/16th watt power rating.\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.4, Page No. 426"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Regulator design using IC 723(refer to fig. 11.26)\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vout = 6                    # output voltage\n",
      "Il = 1                      # load current\n",
      "Isc = 0.250                 # short circuit \n",
      "Vref = 7                    # reference voltage\n",
      "Vbe = 0.7                   # base-emitter junction voltage\n",
      "\n",
      "#Calculations\n",
      "R1 = 2.7*10**3              # assumed\n",
      "R2 = Vout*R1/(Vref-Vout)\n",
      "kRsc = Vbe/Isc\n",
      "k =1-(((Il-Isc)*kRsc)/Vout)\n",
      "R4 = 10*10**3                # assumed         \n",
      "R3 = (1-k)*R4\n",
      "Rsc = kRsc/k\n",
      "R = (R1*R2)/(R1+R2)\n",
      "\n",
      "#Result\n",
      "print(\"R1 = %.1f k-ohm\\nR2 = %.1f k-ohm\\nR3 = %.1f k-ohm\\nR4 = %.1f k-ohm\\nR  = %.2f k-ohm\"%(R1/1000,R2/1000,R3/1000,R4/1000,R/1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R1 = 2.7 k-ohm\n",
        "R2 = 16.2 k-ohm\n",
        "R3 = 3.5 k-ohm\n",
        "R4 = 10.0 k-ohm\n",
        "R  = 2.31 k-ohm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.5, Page No.432"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Current source design using IC7812\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "RL = 25.0           # load resistance\n",
      "P = 10.0            # power \n",
      "I = 0.5             # current required\n",
      "V = 12.0            # rated voltage\n",
      "\n",
      "#Calculations\n",
      "R = V/I\n",
      "Vout = V+(I*RL)\n",
      "Vin = Vout+2\n",
      "\n",
      "#Result\n",
      "print(\"R    = %d ohm\\nVout = %.1f V\\nVin  = %.1f V\"%(R,Vout,Vin))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R    = 24 ohm\n",
        "Vout = 24.5 V\n",
        "Vin  = 26.5 V\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.6, Page NO. 432"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# min and max voltage of regulator(refer fig.11.34)\n",
      "\n",
      "import math\n",
      "#variable declaration\n",
      "Iq = 10*10**-3             # quiescent current\n",
      "Vreg = 15.0                # regulated output voltage\n",
      "R2 = 0                     # min value of potentiometer\n",
      "R1 = 40.0                  # R1 resistor\n",
      "\n",
      "#Calculations\n",
      "Vout = (1+(R2/R1))*Vreg+(Iq*R2)\n",
      "\n",
      "#Result\n",
      "print(\"Vout = %d V\"%Vout)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Vout = 15 V\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.7, Page No. 432"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# current source using 7805\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Il = 0.2              # required load current\n",
      "RL = 22.0             # load resistance\n",
      "P = 10.0              # required power\n",
      "Iq = 4.2*10**-3       # quiescent current\n",
      "Vr = 5                # regulated output voltage\n",
      "\n",
      "#Calculation\n",
      "R = Vr/(Il-Iq)\n",
      "Vout = Vr+Il*RL\n",
      "Vin = Vout+2\n",
      "\n",
      "#Result\n",
      "print(\"R = %f ohm\\nVout = %.1f V\\nVin = %.1f V\"%(R,Vout,Vin))\n",
      "# Answer for R is wrong in the book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R = 25.536261 ohm\n",
        "Vout = 9.4 V\n",
        "Vin = 11.4 V\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.8, Page No.435"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Regulated outpuut voltage(refer fig. 11.38)\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "R1 = 220.0                 # resistance R1\n",
      "R2 = 1500.0                # Resistance R2\n",
      "Iadj = 100*10**-6          # adj. current\n",
      "\n",
      "\n",
      "#Calculartions\n",
      "Vout = (1.25*(1+(R2/R1)))+(Iadj*R2)\n",
      "\n",
      "#Result\n",
      "print(\"Vout = %.2f V\"%Vout)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Vout = 9.92 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.9, Page No. 435"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Output voltage range\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "R1 = 820.0              # resistance R1\n",
      "R2min = 0               # min potentiometer resistance\n",
      "R2max = 10*10**3        # max potentiometer resistance\n",
      "Iadj = 100*10**-6       # adj. current\n",
      "\n",
      "#calculations\n",
      "Vmin = 1.25*(1+(R2min/R1))+(Iadj*R2min)\n",
      "Vmax = 1.25*(1+(R2max/R1))+(Iadj*R2max)\n",
      "\n",
      "#Result\n",
      "print(\"The output can be varied in the range %.2f V to %.2f V\"%(Vmin,Vmax))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output can be varied in the range 1.25 V to 17.49 V\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.10, Page No. 436"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Maximum load current\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vbe = 1.0                # base emitter junction voltage\n",
      "beta = 15.0              # current gain\n",
      "R1 = 7.0                 # resistance R1\n",
      "Iout = 1.0               # max output current from IC  \n",
      "#Calculations\n",
      "Il = ((1+beta)*Iout) - beta*(Vbe/R1)\n",
      "Il = math.floor(Il*100)/100\n",
      "#Result\n",
      "print(\"IC which can supply maximum 1A can supply maximum load of %.2f A, with the help of the current boosting arrangements\"%Il)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "IC which can supply maximum 1A can supply maximum load of 13.85 A, with the help of the current boosting arrangements\n"
       ]
      }
     ],
     "prompt_number": 12
    }
   ],
   "metadata": {}
  }
 ]
}