system design report

17
System design report Nikolay Momchev s1447117, Electrical Engineering 1 April 23, 2015 1 Summary A circuit for remote measurement of temperature and current is designed. The function of inner elements is explained and the design choices are jus- tified. Differences in theoretical and performance values are measured and possible explanations are considered. Conclusions are made toward the suitability of the circuit to meet the design requirements. 1

Upload: nikolay-momchev

Post on 14-Apr-2017

124 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: System design report

System design report

Nikolay Momchev s1447117, Electrical Engineering 1

April 23, 2015

1 Summary

A circuit for remote measurement of temperature and current is designed.The function of inner elements is explained and the design choices are jus-tified. Differences in theoretical and performance values are measured andpossible explanations are considered. Conclusions are made toward thesuitability of the circuit to meet the design requirements.

1

Page 2: System design report

Contents

1 Summary 1

2 Introduction 32.1 Rationale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Aims and Objectives . . . . . . . . . . . . . . . . . . . . . . . 3

3 Theory 33.1 Frequency modulator and IR system . . . . . . . . . . . . . . 53.2 Current monitor . . . . . . . . . . . . . . . . . . . . . . . . . . 63.3 Calibration and temperature sensor circuit . . . . . . . . . . . 8

4 Experiments and Results 94.1 Frequency modulator . . . . . . . . . . . . . . . . . . . . . . . 94.2 Current monitor . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Discussion 10

6 Conclusion 10

7 References 11

8 Bill of materials 13

9 Appendices 14

2

Page 3: System design report

2 Introduction

2.1 Rationale

This report explains the workings of a circuit which transmits informa-tion about temperature or current through infrared light. It is a continu-ation of the Interim Design Report which covered the voltage to frequencyconverter used in this design. A 555 Timer[4] is used to modulate the fre-quency into bursts of signal at a frequency which can be transmitted throughinfrared light. It acts as a flip flop. Connected to the voltage to frequencyconverter is a switch[2] which chooses between a temperature sensor[7] anda current monitor circuit. The current monitor comprises of a current sen-sor - transformer, an amplifier, a peak detector and a level shifter. The sig-nal from the transformer is amplified and the output of the circuit is itsamplitude. Finally the signal is shifted so it is compatible with the rest ofthe circuit.

2.2 Aims and Objectives

• Increase understanding of individual circuit elements

• Explain how the circuit functions

• Justify the design choices

• Compare the theoretical and actual performance values of the circuit

• Assess and discuss possible reasons for any differences

• Discuss the ability of the circuit to meet design criteria.

3 Theory

This section explains how the circuit functions and justifies the designchoices. Figure 1 shows the complete circuit with component values. Inorder to avoid damage to the components in case of a surge or if the sup-ply is connected the wrong way a voltage regulator[3] - IC6 is added to thecircuit so that the output of IC6 acts as the 5V power supply of the rest ofthe circuit. In order to reduce noise in the circuit decoupling capacitors C1,C7, C8, C9, C10, C11, C12 are installed throughout the circuit.

3

Page 4: System design report

Figure 1: Diagram of complete circuit with component values

4

Page 5: System design report

The operation of the circuit is controlled by a switch. The output of theswitch is connected to port 7 of the LM331 in the Voltage to frequencyconverter circuit. The design choices and the performance of the voltage tofrequency converter are covered in detail in sections 2.1 and 2.2 of the In-terim Design Report. It converts the voltage from port 7 into a frequencyfor the next part of the circuit[1].

3.1 Frequency modulator and IR system

The modulator circuit is needed because the infrared receiver - TSOP4838uses a carrier frequency of 38kHz[6]. A 555 timer is used for this purpose.It acts as a flip flop. When the Reset voltage is low the output is low. Ifthe Reset is high then Trigger and threshold Voltages fluctuate in a way,controlled by the RC circuit. When Vtrig < 1.67V the output is high andthe RC circuit is connected to ground through the DISCH port and dis-charges. When Vtresh > 3, .33V the output is low and the RC circuit charges.If it is between those values the output remains as it was previously. Asthere is some component tolerance a variable resistor R19 is included tocontrol the frequency. The frequency itself is given by equation 1 and canbe more easily visualized figure 2 where RA = R18 and RB = R18 +R19 [4].

f ≈ 1.44

(R18 + 2(R19 +R20))C6

(1)

Figure 2: Free running frequency of 555 [4]

When choosing the components a set of initial values were calculated andthen an excel spreadsheet was used for final adjustments until the followingrestrictions were met:

5

Page 6: System design report

• Frequency passes through 38kHz for some value of the variable resis-tor R19 at both highest and lowest component tolerance values.

• DISCH does not sink more than 20mA of current as dictated by the555 datasheet[4]

• On and off times for the circuit are substantially longer than 800ns asrequired by the IR receiver[6].

• On and off times are of a similar duration.

Table 1 shows the theoretical values of the range of frequencies, the on andoff times at possible component tolerances and estimated values of R19

Variables Design Lower tolerance values Higher tolerance valuesMaximum Idisch 8.85mA 9.17mA 8.53mA

fmin 20.86kHz 13.27kHz 7.9kHzfmax 61.94kHz 38.07kHz 82.80kHzR19 1.6kΩ 4.9Ω 2.84kΩton 14.15µs 18.87µs 9.76µstoff 12.16µs 7.44µs 16.56µs

Table 1: Theoretical performance of the Frequency modulator

The output is an open collector and R21 is used as a pull up resistor todrive the voltage. The IR transmitter[5] is connected with R21 in series.This limits the current through the transmitter and therefore the range ofthe device. The value of R21 = 1kΩ was selected to give a reasonably largerange. The IR receiver - TSOP4138 is connected to a PIC microprocessorboard using an IDC header. The board is then used to read the frequencywhich depending on the switch position corresponds to the current ot tem-perature measurements.

3.2 Current monitor

When the switch is in position 1 the circuit measures the current goingthrough a load resistor R22 = 47Ω. The source of the signal is the 50Ω portof a signal generator set at f=50Hz with a maximum amplitude of A=5V.In order to stay within the working limits of the op-amps used in this partof the circuit the signal has a DC offset of 2.5V[9]. A 1000-turn trans-former CST1020[8] is used to determine the current. As current passesthrough the primary circuit of the transformer, a current is generated in

6

Page 7: System design report

the secondary circuit. R3 is used as a burden resistor. Higher values in-crease the voltage produced on it, but if too high it may also filter out theoriginal signal. R3 = 100Ω is taken a compromise between these effects.

Amplification. At its maximum, the signal going through the primarycurrent has an amplitude of 5V and the current becomes Iprimary = 5V

47Ω≈

0.1A. As the transformer has a gain of 10−3 the current in the secondarycircuit becomes Isecondary = 0.1∗10−3 = 10−4 and Vsecondary = Isecondary.R3 =0.01V This is a low powered signal while the voltage to frequency converterrequires an input of between 0.5V and 1.6V - a range of 1.1V. Amplifiercircuits are used to correct this. A total gain of about G=110 is needed.For this part of the circuit a MC33174 quad op-amp is used - designatedas U1, U2 and U3 in the circuit schematic. It requires an input of between0V and 5V so the signal is first shifted to 2.5V[9]. A voltage divider circuitwith resistors R1 and R2 of equal value is used for the purpose. The firststage of the amplification uses op-amp U1 and components of the circuitwere selected for a gain of close to G=10. The simplified output can befound through equation 2:

y(t) = 2.5 − R4 +R5

R4

Asin(2πft) (2)

This simplification works within 5% for frequencies at least 3 times largerthan the cut off frequency found using equation 3[12].

fco =1

2πR4C2

(3)

Using these restrictions the values for R4, R5, C2 were chosen with a theo-retical G=11 and fco = 16.67Hz. After testing the actual gain was discov-ered to be G=9.5 and that was used in the remaining gain calculations.

Peak detector. At the second stage a peak detector circuit is used tofind the amplitude of the signal. As there is still a need for further amplifi-cation its components are selected for a gain close to 11.6. The gain is theratio G = R7

R6. The peak detector works by using different time constants

for RC charging and discharging. The change is achieved with diodes[10].The peak detector itself has a small charging time constant τch and a sig-nificantly larger discharging one τdisch.

τch = R8C3 τdisch = (R7 +R8)C3

7

Page 8: System design report

In order to have a small ripple without making it difficult to track signalvariation, τdisch is selected using equation 4, so that within 20ms the rippleis less than 5% the starting value of 3.6V. Vfin = 2.5V

V (t) = Vfin − (Vfin − Vstart)exp(−t

τ) (4)

Using these restrictions, as well as the assumption that R8 is small relativeto R7 the values for the peak detector circuit were chosen with G=12 and amaximum theoretical ripple of 5% of the starting value or Aripple = 0.18V .

τch = 1.2ms and τdisch = 0.1212.

Level shifter. After the amplification, the signal has values between2.5V and 3.6V. The voltage to frequency converter is adjusted to values be-tween 0.5V and 1.6V therefore the signal will need to be shifted by 2V. Toachieve this a buffer circuit is modified with a current source IC4. It gen-erates current through resistors sitting between the inverting and outputports of an op-amp. The voltage on the inverting and non-inverting portsis the same therefore the voltage difference on R11 and R12 driven by thecurrent source represents the shift needed of 2V. In order to avoid clamp-ing the output voltage of the LM334Z op-amp, the value for the currentfrom IC4 is selected at 10µA. R9 is suitably chosen for this current usingthe current source datasheet[11]. Resistors R11 and R12 are then selected toproduce a voltage difference of 2V at I = 10µA.

3.3 Calibration and temperature sensor circuit

When the switch is in position 2 it is connected to thermistor R12 and re-sistor R13. This part of the circuit is only used for calibration of the volt-age to frequency converter circuit.

When the switch is in position 3 the circuit transmits the measurementsfrom temperature sensor IC5. The sensor has an output voltage between0.5V and 1.6V so it is directly connected to the voltage to frequency con-verter. It can measure temperatures between 0 and 60[7]. The data isthen transmitted to the receiver and microprocessor board. C11 is used toreduce noise in the temperature measurements.

8

Page 9: System design report

4 Experiments and Results

In this section the performance values will be given when each part of thecircuit is tested by itself and in the complete circuit. The resistors usedhave a tolerance of 1% and the capacitors a tolerance of 10%

4.1 Frequency modulator

The frequency modulator and transmitting system were tested using theTTL output of the signal generator at frequencies between 500 and 1500Hz.The range of the transmission was measured to be approximately 1m. How-ever that range is only achieved when the Emitter diode points directlyat the receiver. Thresholds for ports 2 and 6 are approximately 1,7V and3,3V. The charging times are ton = 14µs and toff = 12µs. These valuesare almost the same as the theoretical values. The value of the trimmerwas found to be R19 = 1, 6kΩ as predicted. The frequency of the signalgenerator was transmitted without error and with minimum disruption oftransmission within the 1m range. When the temperature sensor and volt-age to frequency converter were connected to the frequency modulator thecircuit measured a frequency of 850Hz at a room temperature of about 26.As the temperature measurements were changed through finger contact tothe sensor the frequency varied within a range of 40Hz.

4.2 Current monitor

Using the 50Ω output of the signal generator, the Current monitor circuitwas tested. DC offset was set to 2.5V. The performance of the currentmonitor circuit can be seen in Table 2. V1 is the amplitude of the signalfrom the transformer before any amplification. V2 is the amplitude of theAC signal after the first amplification and V3 is the final DC voltage fed tothe voltage to frequency converter.

Theoretical ExperimentalAmplitude(V) V1 (mV) V2 (V) V3(V) V1 (mV) V2 (V) V3(V)

0 0 0 0.5 0 0 0.52,5 5 0.055 0.66 5 0.0475 1.075 10 0.11 1.32 10 0.095 1.64

Table 2: Performance of current monitor circuit

The amplitude of the ripple after going through the peak detector is 0.1V.The charging and discharging times of the peak detector were measured to

9

Page 10: System design report

be tch = 3ms and tdisch = 17msThe frequencies obtained when the current monitor is connected to the restof the circuit are found it table 3. The amplitude is from the signal genera-tor and the frequency is read from the microprocessor board. Switch is setto position 1.

Amplitude(V) f (Hz)0 590

2,5 9335 1042

Table 3: Performance of current monitor circuit

5 Discussion

For the Frequency modulator the difference between theoretical and ex-perimental values is of the order of 0.2µs. This is negligible and can beexplained by imperfect components and measurement error.

The current monitor circuit has larger differences. Discrepancies of 0.2V atthe final circuit show significantly different measured currents. This is toa large extent due to the expected gain of 11 and actual gain of 9,5 at thefirst amplification stage. Imperfect components are most likely the cause ofthis. A point for concern would be when the amplitude of the signal is veryclose to 5V. At such values the input to the voltage to frequency convertergoes over 1.6V. This should still work but has not been tested. The rangeof 1m is obtained only when directly pointing the emitter at the receiver.A misalignment could cause the circuit to stop functioning.

6 Conclusion

There has been no calibration of the system and is currently an incompleteproduct. However the design transmits the data and can be used to sense achange in current or temperature. With calibration it can give the currentor temperature data. The system transmits data reliably over a distance of1m as long as the transmitter and receiver are aligned. The current moni-tor can only measure AC signals with amplitudes between 0V and 5V witha DC offset of 2.5V. Temperature readings can be taken at temperaturesbetween 0 and 60 All of this meets the design criteria.

10

Page 11: System design report

7 References

[1] “LM231A/LM231/LM331A/LM331 Precision Voltage-to-FrequencyConverters”, TI datasheet, March 2013, SNOSBI2B.[online] http://www.ti.com/lit/gpn/lm331[Accessed:23.04.2015.][2] “SSSS91980”, ALPS Electric Company Ltd. Specification. [online ]http://www.alps.com/products/WebObjects/catalog.woa/E/HTML/Switch/Slide/SSSS9/SSSS919800.html [Accessed:23.04.2015.][3] “LM2931, NCV2931 Series – 100 mA, Adjustable Output, LDO Volt-age Regulator with 60 V Load Dump Protection”, ON Semiconductorsdatasheet, March, 2007 – Rev. 20, Publication Order Number LM2931/D.[online] http://www.onsemi.com/pub/Collateral/LM2931-D.PDF [Ac-cessed:23.04.2015.][4] “NA555, NE555, SA555, SE555 Precision Timers”, Texas InstrumentsDatasheet, SLFS022G–September 1973–Revised March 2008.[online] http://www.ti.com/lit/gpn/na555[Accessed:23.04.2015.][5] “TSAL7400 High Power Infrared Emitting Diode, 940 nm, GaAlAs/GaAs”,Vishay semiconductors datasheet, Document Number: 81014, Rev. 1.8, 29-Jun-09.[online] http://www.mouser.com/catalog/specsheets/tsal7400.pdf[Accessed:23.04.2015.][6] “TSOP41.., TSOP43.. IR Receiver Modules for Remote Control Sys-tems”, Vishay semiconductors datasheet, Document Number: 82135 Rev.2.6, 20-Aug-10. [online] http://www.farnell.com/datasheets/30498.pdf [Ac-cessed:23.04.2015.][7] “MCP9700/9700A, MCP9701/9701A Low-Power Linear Active ThermistorTM

ICs”, Microchip Technology Inc. Datasheet, 2009, DS211942E. [online]http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf [Ac-cessed:23.04.2015.][8] “Current Sense Xfmr - PCB Type: 50 - 400Hz”, Triad magnetics datasheet,2006. [online] https://system.netsuite.com/core/media/media.nl?id=1641&c=ACCT126831&h=e276843e333b60862f5b& xt=.pdf[Accessed:23.04.2015.][9] ”MC33171, MC33172, MC33174, NCV33172 Single Supply 3.0 V to 44V, Low Power Operational Amplifiers”, ON Semiconductors datasheet,October, 2006 - Rev. 9 Publication Order Number: MC33171/D.[online]http://www.onsemi.com/pub/Collateral/MC33171-D.PDF [Accessed:23.04.2015.][10] “1N4148; 1N4448 High-speed diodes”, NXP semiconductors datasheet,10 August 2004. [online] http://www.nxp.com/documents/data sheet/1N4148 1N4448.pdf[Accessed:23.04.2015.][11] “LM134/LM234/LM334 3-Terminal Adjustable Current Sources”, Na-tional Semiconductors datasheet, March 2005, DS005697. [online] http://www.national.com/ds/LM/LM134.pdf[Accessed:23.04.2015.]

11

Page 12: System design report

[12] Electrical Engineering 1 Laboratory Guide, D.I.Laurenson, 2010, Edin-burgh: The University of Edinburgh.

12

Page 13: System design report

8 Bill of materials

Figure 3: Bill of materials

13

Page 14: System design report

9 Appendices

Figure 4: Performance of Voltage to Frequency converter

Figure 5: Calculations for initial components of Frequency modulator cir-cuit. Final component choices were done by adjustments on excel tablestarting from these

14

Page 15: System design report

Figure 6: Calculations for first amplification stage components of the cur-rent monitor circuit

15

Page 16: System design report

Figure 7: Calculations for second amplification stage components of thecurrent monitor circuit

Figure 8: Calculations for the peak detector circuit components.

16

Page 17: System design report

Figure 9: Current values dependent on R9[11]

17