GOAL Lab2 Digital Weighing Scale (Sep 18) The gal f Lab 2 is t demnstrate a digital weighing scale. INTRODUCTION The electrnic measurement f mass has many applicatins. A digital weighing scale typically wrks like this: (1) The measured mass exerts a frce n a lad cell, which prduces a tiny differential vltage utput V S. (2) The tiny V is amplified by a high-gain differential amplifier. (3) The amplified vltage is measured with a micrcntrller and cnverted int mass (e.g. grams). (4) The mass is displayed n the cmputer. Fig. 1: Blck diagram f lad cell measurement system. Mre details regarding the lad cell will be discussed during the Lab2 tutrial. OBJECTIVES 1) Build and test a BJT differential amplifier biased with a current surce. 2) Build and test a pnp Darlingtn-based cmmn emitter amplifier. 3) Use a lad cell, yur AWESOME circuit, and an Arduin Un t demnstrate a digital weighing scale. The design requirements fr each stage are shwn belw: STAGE 1: Differential amplifier with current surce biasing A d 30 Input impedance Z IN 20 khm. Quiescent utput V CQ between 3 and 3.5V. STAGE 2: Cmmn emitter amplifier using tw pnp transistrs in a Darlingtn cnfiguratin A 12 and quiescent current I EQ 1 ma. Z IN2 100R C Quiescent utput between 2 t 3V. 1
PART 1: DIFFERENTIAL AMPLIFIER CONSTRUCTION Lab kit Benchtp pwer supply, multimeter, functin generatr, scpe, and prbe bx (cntains banana cables, multimeter prbes, etc.) LM3046 transistr array IC (ne) 2N3904 transistr (ne) dides (tw) Resistrs (R1, R2, and Rc) Fig. 0: The LM3046 transistr array is a chip that cntains a BJT matched pair and three ther npn transistrs. Task 1a: Build the differential amplifier. Yu must use NEAT and COLOR-CODED wiring n yur breadbard: RED = +Vcc BLACK = GND BLUE = -Vee YELLOW = everything else Cmpnent pin diagrams are in the data sheets n the curse website. D NOT cram yur circuit int a tiny space n the breadbard. It is difficult t measure current in a crwded circuit. Yu can cnsult Buma s breadbard fr an example. Place the LM3046 chip acrss a gap in the breadbard (e.g. like an p amp). The pin diagram fr the LM3046 is n the curse website. CONNECT PIN 13 OF THE CHIP TO 5V! Use the matched pair Q 1 and Q 2 fr the differential amplifier. Remember that the emitters f Q1 and Q2 are already internally cnnected t each ther (Pin 3) Fr nw, grund the bases f bth Q1 and Q2. Remember the cathde is the black stripe! Fig. 1: Differential amplifier using the LM3046 chip. Remember t cnnect Pin 13 f the chip t 5V! Use neat and clr-cded wiring n yur breadbard! A messy circuit will cst yu 10 pts frm yur lab grade! Yes, Buma is mean 2
PART 2: DIFFERENTIAL AMPLIFIER TESTING Task 2a: Measure quiescent prperties. Use the multimeter t measure V CQ and I TAIL. Yu shuld get rughly 3.3V and n mre than 0.2 ma. Measure the vltage acrss bth dides d yu get smewhere near 1.3V? Measure the V BE f Q3 is it clse t 0.65V (typical value in data sheet)? Task 2b: Measure differential gain A d. The Vin1 cnnectin needs t be changed (see Fig. 2). Discnnect the Q1 base frm grund. Cnnect the Q1 base t the functin generatr. Set the functin generatr t the fllwing: HighZ utput Sine wave, Freq = 1 khz, Amplitude = 50 mv PP Fig. 2: Set up t measure Ad. Cnnect a scpe prbe t Vut1 and anther t Vin1. Use the functin generatr t trigger the scpe. Use a caxial cable t cnnect the functin generatr s SYNC utput t the scpe s EXT input. Chse TRIG MENU >> SOURCE >> EXT Adjust the TRIG LEVEL knb t abut 1V Adjust the scpe t see a few cycles f Vut1 and Vsig. Measure the peak-t-peak amplitudes f bth. Cmpute A d. It shuld be ver 30. Task 2c: Measure cmmn-mde gain A CM. The Vin2 cnnectin needs t be changed (see Fig. 3). Discnnect the Q2 base frm grund. Cnnect the Q2 base t the Q1 base. Set the sine wave amplitude t be 5V PP. Cnnect a scpe prbe t Vut1 and anther t V CM. Fig. 3: Set up t measure A CM. 3
Adjust the scpe t display a few cycles f Vut1 and V CM at the same time. Measure the peak-t-peak amplitudes f bth. Cmpute A CM.and CMRR hpefully A CM < 0.001 and CMRR > 80 db! PART 3: DIFFERENTIAL AMPLIFIER ZIN An amplifier s Z IN cannt be directly measured (e.g. with a multimeter). Frtunately, it s nt that difficult if yu understand hw vltage dividers wrk! The basic idea is that yu knw the value f ne resistr but nt the ther ne. By measuring tw vltages, yu can use sme algebra t figure ut the mystery resistr! Task 3a: Think abut a methd t determine input impedance Z IN. Keep in mind the fllwing: V S = functin generatr vltage R S = resistr added t circuit (e.g. 20 khm) Vin = amplifier input vltage Z IN = amplifier input impedance Yu knw the value f R S and yu can measure V S and Vin. Cme up with an equatin fr Z IN based n these three quantities! Fig. 4: Zin is the mystery quantity! Think abut hw t calculate Zin based n what quantities yu knw and what yu can measure! +5V Task 3b: Measure the input impedance Zin. Discnnect the Q2 base frm the Q1 base. Cnnect the Q2 base t grund (just like in Fig. 2). Set the sine wave amplitude t be 50 mv PP. Insert a 20 khm test resistr between the functin generatr and Q1 base. Use the scpe t measure V S and Vin1. Yu are interested in the peak-t-peak value f the sine waves! NOTE: The scpe wavefrm fr Vin1 shuld have a slightly negative DC ffset (rughly -15 mv). This vltage drp is due t the Q1 base current flwing thrugh R S! Cmpute Z IN based n yur measurements Des yur cmputed Z IN satisfy the design requirement? Vsig 20kΩ Rs Vin1 R1 D1 D2 Q1 Q2 2N3904 Q3 R2-5V Rc Vut1 Vin2 Fig. 5: Insert the 20 khm test resistr between the functin generatr and Q1 base. 4
PART 4: COMMON EMITTER AMPLIFIER OK, ur circuit is almst dne! Nw yu need t build and test the secnd amplifier stage (cmmn emitter)! +5V +5V 2N3906 transistrs (tw) R3 Resistrs (R3 and R4) 100 hm and 1 khm resistr Task 4a: Build the cmmn emitter amplifier. Remember that the cmmn emitter input cmes frm the differential amplifier utput (see Fig. 6) As always, use neat and clr-cded wiring n yur breadbard! 22 mvpp Vsig 11:1 vltage divider 1kΩ Vin1 100Ω R1 D1 D2 Q1 Q2 2N3904 Q3 R2 Rc Vin2 Vut1 Q5 2N3906 Q4 2N3906 R4-5V Cmmn emitter using pnp Darlingtn Vut Task 4b: Reduce the input sine wave t 2mVpp. -5V Ideally, ur functin generatr wuld prduce a 2mV PP sine wave, just like in the Multisim simulatin. Unfrtunately, ur functin generatr cannt prduce such a small signal. Instead, we ll d the fllwing: Set the functin generatr t 22 mvpp sine wave. Fig. 6: In rder t get an input signal f abut 2 mv PP, we set the functin generatr t utput a 22 mv PP sine wave and use an 11:1 vltage divider. Insert an 11:1 vltage divider right befre the Q1 base (see Fig. 6)! This shuld reduce the 22 mvpp sine wave t a 2 mvpp sine wave! Task 4c: Measure the cmmn emitter gain. Measure the quiescent Vut. If it is t high r lw, then change R4 accrdingly. Measure Vut1 and Vut and cmpute the cmmn emitter gain. Measure Vin1 and cmpute the ttal amplifier gain. Hpefully the ttal gain is greater than 360! It shuld be clser t 400 (perhaps higher!). When yu are dne, remve the vltage divider, functin generatr cnnectin, and ungrund the Q2 base. 5
PART 5: LOAD CELL TESTING Lad cell 200g weight The lad cell is basically a metal beam with fur strain gauges. These gauges are arranged in a Wheatstne bridge that must be pwered by +5V. This +5V is als called the excitatin vltage. Task 5a: Hk up the lad cell Make sure the Q1 and Q2 bases are nt cnnected t anything at the mment! The lad cell has fur wires that shuld be cnnected in the fllwing way: RED = +5V BLACK = GND YELLOW= VIN1 GREEN = VIN2 Task 5b: Test the lad cell Use the scpe t mnitr Vut. Withut any lad, Vut shuld be between 2 and 3 V. Pressing lightly n the black knb f the lad cell shuld cause the scpe vltage t change. Place a 200g weight n the lad cell. Write dwn the CHANGE in Vut (e.g. with vs withut 200g weight). It shuld be rughly 0.5V (+/- 0.1V is fine). PART 6: DIGITAL WEIGHING SCALE We want the Arduin t acquire data frm the lad cell amplifier, cmpute weight, and display the result n the cmputer. 100g and 50g weights Arduin Un and USB cable Task 6a: Dwnlad and unzip the Arduin template. G t the curse website and dwnlad sketch_lab2_template.zip t yur desktp. Duble-click n the zipped flder. Select Extract all files t unzip the cntents f the flder. Duble-click the sketch_lab2_template sketch. Task 6b: Cnnect the Arduin t yur circuit. Use tw wires t cnnect the Arduin t yur breadbard. 6
YELLOW wire: cnnects the amplifier s Vut t the A0 pin f the Arduin. BLACK wire: cnnects breadbard grund t the Arduin GND. Task 6c: Zer the digital weighing scale by determining the prper value f Vref. Open the Serial Mnitr (tp right buttn in Arduin IDE). Yu shuld see the weight values n the mnitr. Make sure n weight is n the lad cell. The displayed values are likely wrng (e.g. 76 g instead f 0 g). Yu will need t mdify the Arduin cde t btain reasnably crrect values. Change the value f Vref (e.g. increment r decrement by 0.1 r s). Re-cmpile yur cde, uplad t the bard, and re-start the serial mnitr. Repeat as many times as necessary until yu cnsistently get 0 g. Yu may need t use a cuple f decimal places (e.g. 2.39) t get the crrect value f Vref. Task 6d: Calibrate the system by determining the prper value fr K. Keep the prgram running and place the 200g weight n the lad cell. The value is prbably wrng (e.g. 220 g instead f 200 g). Change the value f K (e.g. increment r decrement by 0.05 r s) in the cde. Re-cmpile yur cde, uplad t the bard, and re-start the serial mnitr. Repeat as many times as necessary until yu cnsistently get 200 g (+/- 1 g is fine). Task 6e: Test yur digital weighing scale! OK, nw fr the REAL test f hw well yur digital weighing scale wrks. Replace the 200g weight with a 100g weight. What is yur measured result? Hpefully it is between 98 and 102 grams. Replace the 100g weight with a 50g weight. What is yur measured result? Hpefully it is between 48 and 52 grams. If pssible, save a snapsht f the serial mnitr windw shwing yur system measuring 50g, 100g, and 200g weights. One snapsht can shw all three (e.g. change weights every 5 secnds). Hpefully, ALT + PrtSc and pasting int Wrd will wrk. Task 6f: Dem yur system t Buma. (End f Lab 2) Shw that yur system gives reasnable values fr all three weights. Shw Buma the fllwing data: Differential amplifier I TAIL, V CQ, Ad, A CM, CMRR, and Z IN Cmmn emitter: quiescent Vut, gain Yur final values fr Vref and K. 7