forked from ADITYA-RAY/WheatStoneBridgeSimulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
625 lines (594 loc) · 26.7 KB
/
index.html
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="./images/favicon.ico" />
<link rel="stylesheet" href="style.css" />
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous"
/>
<title>Wheat Stone Bridge Simulator</title>
<script src="main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"
/>
</head>
<body>
<div class="tabs">
<div class="tabs--nav">
<span> <i class="bi bi-book"></i> Theory </span>
<span> <i class="bi bi-gear"></i> Procedure </span>
<span> <i class="bi bi-eye"></i> Simulator</span>
<span><i class="bi bi-check2-square"></i> Quiz</span>
<span><i class="bi bi-person"></i> About</span>
</div>
<div class="tabs--content">
<div>
<div class="container">
<h2>Theory</h2>
<br />
<p>
The Wheatstone Bridge is an instrument designed for measuring an
unknown resistance by comparing it with a known, or standard
resistor.
</p>
<p>
R<sub>1</sub>, R<sub>2</sub>, and R<sub>3</sub> are resistors of
known resistance and the resistance of R<sub>2</sub> is
adjustable. The resistance R<sub>2</sub> is adjusted until the
bridge is "balanced" and no current flows through the galvanometer
V<sub>G</sub>. At this point, the potential difference between the
two midpoints (B and D) will be zero. Therefore the ratio of the
two resistances in the known leg (R<sub>2</sub>/R<sub>1</sub>) is
equal to the ratio of the two resistances in the unknown leg
(R<sub>x</sub>/R<sub>3</sub>). If the bridge is unbalanced, the
direction of the current indicates whether R<sub>2</sub> is too
high or too low.
</p>
<p>
At the point of balance,
<br />
<img
src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1d10637c0ae2c1ef7ee40aa0d5f8cce2108367b7"
alt="wheatstone equation"
style="padding-left: 150px"
/>
</p>
<p>
Detecting zero current with a galvanometer can be done to
extremely high precision. Therefore, if R<sub>1</sub>,
R<sub>2</sub>, and R<sub>3</sub> are known to high precision, then
R<sub>x</sub> can be measured to high precision. Very small
changes in R<sub>x</sub> disrupt the balance and are readily
detected.
</p>
<p>
Alternatively, if R<sub>1</sub>, R<sub>2</sub>, and R<sub>3</sub>
are known, but R<sub>2</sub>
is not adjustable, the voltage difference across or current flow
through the meter can be used to calculate the value of
R<sub>x</sub>, using Kirchhoff's circuit laws. This setup is
frequently used in strain gauge and resistance thermometer
measurements, as it is usually faster to read a voltage level off
a meter than to adjust a resistance to zero the voltage.
</p>
<p>
It may be shown by experiment that the electrical resistance of a
wire is directly proportional to its length and inversely
proportional to its cross-sectional area. The resistivity ρ is
then defined by the equation
</p>
<p style="text-align: center">R = ρL/A</p>
</div>
</div>
<div>
<div class="container">
<h2>Laboratary Procedure</h2>
<br />
<ol>
<li>
Use the Resistor Color Code in the introduction of this manual
to determine the nominal resistances and tolerances of all
resistors on the resistor board. If the bands are too worn to be
seen clearly, obtain a magnifying lens from the instructor.
</li>
<br />
<li>
Refer to the semi-pictorial diagram in section IV. The letters
A-D refer to the same points as in the schematic diagram.
Connect resistor A on the board of resistors, the first
"unknown" resistor, between bars A and B. Connect the plug
resistance box, the standard resistor, between bars B and C.
Connect the left end of the one-meter wire to bar A and the
right end to bar C.
</li>
<br />
<li>
Clean the contacts of the switch with a piece of emery cloth.
Connect one terminal of the switch to bar C; connect the other
terminal to either terminal of the cell. Connect the other
terminal of the cell to bar A. Leave the switch open.
</li>
<br />
<li>
See if any of the buttons of the galvanometer is stuck in the
depressed position; if so, rotate it to release it. Connect one
terminal of the galvanometer to bar B; connect the other
terminal to the long bar D.
</li>
<br />
<li>
Set the plug resistance box to a resistance of the same order of
magnitude as the unknown resistor, by removing enough plugs to
total the desired resistance; then twist and push in all of the
remaining plugs.
</li>
<br />
<li>
Close the switch S1. Place the sliding contact near the left end
of the wire, and hold one end of it down. Depress the left
button of the galvanometer and observe which way the needle
deflects. In the rest of this experiment, whenever the needle
deflects in this direction, you will know that the slider is too
far to the left for balance.
</li>
<br />
<li>
Move the slider to a point near the middle of the wire. Hold one
end of the slider down, and momentarily depress the left button
of the galvanometer. Observing the direction of the deflection,
and remembering the results of step 6, move the slider to a new
position and repeat the test. (Do not move the slider while
holding it down, as that would scrape bits of metal off of the
wire and result in a non-uniform cross-section. This will lead
to the failure of the ratio of R<sub>3</sub> to R<sub>4</sub> to
equal the ratio of L3 to L4.) When the galvanometer deflection
has been reduced to zero for the left button of the
galvanometer, use the middle button and, finally, to the right
button. When there is no deflection, using the right button of
the galvanometer, the bridge has been balanced. Record the
nominal value of the resistance, the slide wire position (L3),
and the standard resistance (R<sub>2</sub>).
</li>
<br />
</ol>
</div>
</div>
<div>
<div class="container">
<div class="row">
<div class="col-12 col-md-4">
<div class="our_card blink">
<div class="purple">Procedure</div>
<br />
<ol style="font-size: 13px">
<li>
Set the value of unknown resistor (default will be set as
20 ohm) and click set button.
</li>
<br />
<li>Turn on the circuit.</li>
<br />
<li>
Now set the values of R<sub>1</sub> and R<sub>2</sub>
using slider.
</li>
<br />
<li>
Now change the value of R<sub>3</sub> until the
galvanometer deflection tends to zero.
</li>
<br />
<li>Click the simulate button.</li>
<br />
<li>
(Optional) Click on Add Observation to add current
readings in table.
</li>
<br />
</ol>
</div>
<br />
<div class="AlimContainer">
<div class="our_card">
<div class="box">
<div id="f1" onclick="fun1()">Set Unknown Resistance</div>
<div id="f2" onclick="fun2()">Simulate</div>
</div>
<div id="AlimCard1">
<div class="purple">
<h6>Set Unknown Resistance</h6>
(0 to 1000 Ω)
</div>
<form name="myForm">
<label for="rsx">R<sub>x</sub> (in Ω) </label>
<input
type="range"
id="rsx"
max="1000"
min="0"
step="1"
value="20"
style="display: block; width: 100%"
oninput="swap('rsx','rsxt')"
/>
<input
type="number"
id="rsxt"
max="1000"
min="0"
step="1"
value="20"
oninput="swap('rsxt','rsx')"
style="height: 30px; margin: 10px 10px"
/>
</form>
<button
type="button"
class="set"
onclick="setResistance()"
style="margin: 3px 10px"
>
Set
</button>
<br />
<br />
</div>
<div id="AlimCard2">
<div class="sContainer">
<div class="one">
<label
for="rs3"
style="width: fit-content; margin-right: 20px"
>R<sub>x</sub> (in Ω)
</label>
<input
type="number"
id="sim"
max="1000"
min="0"
step="1"
value="0"
disabled
/>
</div>
<button
type="button"
class="set"
id="simButton"
style="
width: fit-content;
margin-left: 20px;
height: 52px;
margin-top: 20px;
"
onclick="simulate()"
>
Simulate
</button>
</div>
</div>
</div>
</div>
<br />
</div>
<div class="col-12 col-md-8">
<div class="our_card blink">
<div class="bridge_wrap">
<div class="wrap_in">
<img
src="./images/bridge.png"
alt="bridge"
class="bridge"
draggable="false"
/>
<canvas
width="180"
height="87"
class="jqplot-event-canvas"
style="position: absolute; left: 10px; top: 10px"
></canvas>
<input
type="number"
class="vin r1"
id="rt1"
value="0"
oninput="matchValues('rt1','rs1')"
/>
<input
type="number"
class="vin r2"
id="rt2"
value="0"
oninput="matchValues('rt2','rs2')"
/>
<input
type="number"
class="vin r3"
id="rt3"
value="0"
oninput="matchValues('rt3','rs3')"
/>
<input
type="number"
class="vg"
id="vg"
value="0"
disabled
/>
<input type="number" class="vin vs" id="vs" value="20" />
<div class="switch">
<img
src="./images/switchoff.png"
alt=""
class="switchonn"
onclick="switchCircuit()"
/>
</div>
</div>
</div>
</div>
<br />
<div class="our_card">
<div class="purple">
<h3>Controls</h3>
(0 to 1000 Ω)
</div>
<div>
<div class="formContainer">
<label for="rs1">R<sub>1</sub> (in Ω) </label>
<input
type="range"
id="rs1"
max="1000"
min="0"
step="1"
value="0"
style="display: block; width: 100%"
oninput="matchValues('rs1','rt1')"
/>
</div>
<div class="formContainer">
<label for="rs2">R<sub>2</sub> (in Ω) </label>
<input
type="range"
id="rs2"
max="1000"
min="0"
step="1"
value="0"
style="display: block; width: 100%"
oninput="matchValues('rs2','rt2')"
/>
</div>
<div class="formContainer">
<label for="rs3">R<sub>3</sub> (in Ω) </label>
<input
type="range"
id="rs3"
max="1000"
min="0"
step="1"
value="0"
style="display: block; width: 100%"
oninput="matchValues('rs3','rt3')"
/>
</div>
<div class="addcontainer">
<button
type="button"
class="Add blink"
onclick="addObs()"
style="margin: 3px 10px"
>
Add Observation
</button>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-12 col-md-4"></div>
<div class="col-12 col-md-8">
<div class="our_card">
<table id="observation">
<tr class="round">
<th>Sr No.</th>
<th>V (in volts)</th>
<th>R<sub>1</sub> (in Ω)</th>
<th>R<sub>2</sub> (in Ω)</th>
<th>R<sub>3</sub> (in Ω)</th>
<th>R<sub>x</sub> (in Ω)</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div>
<h2>Take a small quiz</h2>
<form action="" name="quiz" id="quiz">
<div class="quizcontain">
<div class="qbox">
<p>1. Wheatstone bridge is a __________</p>
<p id="a1"><input type="radio" name="question1" value="AC bridge" id="11"><label for="11"> AC bridge</label></p>
<p id="a2"><input type="radio" name="question1" value="DC bridge" id="12"><label for="12"> DC bridge</label></p>
<p id="a3"><input type="radio" name="question1" value="high voltage bridge" id="13"><label for="13"> high voltage bridge</label></p>
<p id="a4"><input type="radio" name="question1" value=" power dissipation bridge" id="14"> <label for="14"> power dissipation bridge</label></p>
<span id="msg1" class="res"></span>
<p><input type="button" name="" value="check answer" onclick="check('a2','12','msg1')" class="Add blink"></p>
</div>
<div class="qbox">
<p>2. How many resistors are used in wheatstone bridge?</p>
<p id="b1"><input type="radio" name="question3" value="1" id="21"><label for="21"> 1</label></p>
<p id="b2"><input type="radio" name="question3" value="2" id="22"><label for="22"> 2</label></p>
<p id="b3"><input type="radio" name="question3" value="3" id="23"><label for="23"> 3</label></p>
<p id="b4"><input type="radio" name="question3" value="4" id="24"><label for="24"> 4</label></p>
<span id="msg2" class="res"></span>
<p><input type="button" name="" value="check answer" onclick="check('b4','24','msg2')" class="Add blink"></p>
</div>
<div class="qbox">
<p>3. Telephone companies make use of the Wheatstone bridge for _________</p>
<p id="c1"><input type="radio" name="question3" value="measuring the telephone resistance" id="31"><label for="31"> measuring the telephone resistance</label></p>
<p id="c2"><input type="radio" name="question3" value="computing the line strength" id="32"><label for="32"> computing the line strength</label></p>
<p id="c3"><input type="radio" name="question3" value="maintaining dialtone" id="33"><label for="33"> maintaining dialtone</label></p>
<p id="c4"><input type="radio" name="question3" value="locating the cable faults" id="34"><label for="34"> locating the cable faults</label></p>
<span id="msg3" class="res"></span>
<p><input type="button" name="" value="check answer" onclick="check('c4','34','msg3')" class="Add blink"></p>
</div>
<div class="qbox">
<p>4. How can a Wheatstone bridge be used for the measurement of physical parameters?</p>
<p id="d1"><input type="radio" name="question3" value="in conjunction with a rectifier" id="41"><label for="41"> in conjunction with a rectifier</label></p>
<p id="d2"><input type="radio" name="question3" value="along with an op amp" id="42"><label for="42"> along with an op amp</label></p>
<p id="d3"><input type="radio" name="question3" value=" by connecting it to a thermistor" id="43"><label for="43"> by connecting it to a thermistor</label></p>
<p id="d4"><input type="radio" name="question3" value="by making use of a transducer" id="44"><label for="44"> by making use of a transducer</label></p>
<span id="msg4" class="res"></span>
<p><input type="button" name="" value="check answer" onclick="check('d2','42','msg4')" class="Add blink"></p>
</div>
<div class="qbox">
<p>5. By using the variations on a Wheatstone bridge we can _________</p>
<p id="e1"><input type="radio" name="question3" value="measure quantities such as voltage, current and power" id="51"><label for="51"> measure quantities such as voltage, current and power</label></p>
<p id="e2"><input type="radio" name="question3" value="measure high resistance values" id="52"><label for="52"> measure high resistance values</label></p>
<p id="e3"><input type="radio" name="question3" value="measure quantities such as complex power" id="53"><label for="53"> measure quantities such as complex power</label></p>
<p id="e4"><input type="radio" name="question3" value="measure quantities such as capacitance, inductance and impedance" id="54"><label for="54"> measure quantities such as capacitance, inductance and impedance</label></p>
<span id="msg5" class="res"></span>
<p><input type="button" name="" value="check answer" onclick="check('e4','54','msg5')" class="Add blink"></p>
</div>
</div>
</form>
</div>
<div>
<h2>About Us</h2>
<div class="box">
<div class="contain blink">
<h5>Created by:</h5>
<table>
<tr>
<td>Aditya Ray</td>
<td>20117006</td>
</tr>
<tr>
<td>Lakshman Mulchandani</td>
<td>20117048</td>
</tr>
<tr>
<td>Piyush Thakare</td>
<td>20117104</td>
</tr>
<tr>
<td>Alim Khan</td>
<td>20117013</td>
</tr>
<tr>
<td>Aditya Ghidora</td>
<td>20117005</td>
</tr>
<tr>
<td>Premchand Maddikuntla</td>
<td>20117051</td>
</tr>
</table>
</div>
<div class="contain blink">
<h5>Under supervision of:</h5>
<p>
Dr. Dhanavath Suresh sir <br />
Department of Electrical Engineering <br />
National Institute of Technology, Raipur
</p>
</div>
</div>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"
></script>
<script>
(function ($) {
$.fn.neumorphicTabs = function () {
$(this).each(function () {
let tabsNav = $(this).find(".tabs--nav");
let tabsContent = $(this).find(".tabs--content");
tabsNav.append("<div class='tabs--fx'/>");
let activeNavItem = tabsNav.find(".active").length
? tabsNav.find(".active")
: tabsNav.children().first();
tabsNav.attr(
"style",
`--tab-width: ${activeNavItem.outerWidth()}px; --tab-position: `
);
let tabsFx = tabsNav.find(".tabs--fx");
function translateTabsFx(activeEl) {
tabsFx.height(activeEl.outerHeight()).animate({
opacity: 1,
left:
activeEl.position().left +
parseInt(activeEl.css("marginLeft")),
width: activeEl.outerWidth(),
});
}
translateTabsFx(activeNavItem);
tabsNav
.children()
.not("div")
.each(function (i) {
if (i == 0 && !tabsNav.find(".active").length)
$(this).addClass("active");
$(this).attr("data-tab", i);
});
tabsContent.children().each(function (i) {
if (tabsNav.find(".active").attr("data-tab") == i) {
$(this).addClass("active");
} else {
$(this).hide();
}
$(this).attr("data-tab", i);
});
tabsNav.children().on("click", function () {
let currentTab = $(this);
if (
currentTab.hasClass("active") ||
currentTab.hasClass("tabs--fx")
)
return false;
tabsNav.children().each(function () {
$(this).addClass("wait-animation");
});
translateTabsFx(currentTab);
tabsNav.find(".active").removeClass("active");
currentTab.addClass("active");
tabsContent
.find(".active")
.fadeOut()
.promise()
.done(function () {
tabsContent
.find(`[data-tab='${currentTab.attr("data-tab")}']`)
.addClass("active")
.fadeIn();
tabsNav.children().each(function () {
$(this).removeClass("wait-animation");
});
});
});
});
return this;
};
})(jQuery);
$(".tabs").neumorphicTabs();
</script>
</body>
</html>