Measurments and instrumentation Project reportFaculty of Engineering and Technology The University of Jordan, Amman-Jordan Light meter design project Done by : Safaa Nayef Alwreadat (0046401) Nadeen Mother Habash(0046431) Alaa hesham al-shubbak(0048030) Baraah Mohammed alhesa(0046386) Manal al-khtib ( 0025493) 30 DECEMBER 2007 Procedure……………………………………………….. Source of errors ……………………………………….. Theory……………………………………………. Application………………………………………... System description………………………………………….TABLE OF CONTENTS Abstract……………………………………………”1” Introduction………………………………………. Data collection………………………………………… Discussion………………………………………………… Conclusion………………………………………. References ………………………………………………… Code ……………………………………………………… . ABSTRACT This project use a light dependent resistor (LDR) as a sensor of the light .to build a lightdensity meter and calibrate it against the lux meter By using the Lux and multimeter the relationship between the light and the resistance is found also the maximum and the minimum values of resistance are taken then the DC bridge circuit is built which used to found the relationship between the resistance(or the light) and the output voltage . Anumber of reading for the output voltage is taken with the corresponding lux values and a relation ship with the least resolution between them was found using excel program A 16f876 pic microcontroller is used and the code was written using c program to take two analogue inputs relates to the output voltage and convert it to digital then substitute it in the relation ship and display the value of the lux on the LCD Finally the simple circuit which contain the LDR and other resistors can give the value of LUX at any light density . An LDR will have a resistance that varies according to the amount of visible light that falls on it. A close up of an LDR is shown below: Figure1 : a light dependent resistance The light falling on the brown zigzag lines on the sensor. There are some LDRs that work in the opposite way i.INTRODUCTION: LDRs or light dipendant resistors are very very useful sensor especially on light/ dark sensor . but they are illuminated with light resistance drop dramatically . . their resistance increases with light (called positive co-efficient). This is known as a negative co-efficient. some more than others.e. Everything has an electrical resistance. normally the resistance of an LDR is very high . causes the resistance of the device to fall. A photoresistor or LDR is an electronic component whose resistance decreases with increasing incident light intensity. and hence the photon must have enough energy to excite the electron across the entire bandgap. the heater cools. or photocell. In intrinsic devices. and controls whether current flows through the heater which opens the main power contacts. photoconductor. The resulting free electron (and its hole partner) conduct electricity. At night. closing the power contacts. silicon. which have a ground state energy closer to the conduction band — since the electrons don't have as far to jump.e. The photoresistor is facing rightwards. eg. An intrinsic semiconductor has its own charge carriers and is not an efficient semiconductor. there will be extra electrons available for conduction. A photoelectric device can be either intrinsic or extrinsic. . Extrinsic devices have impurities added. longer wavelengths and lower frequencies) are sufficient to trigger the device. If light falling on the device is of high enough frequency. A photoresistor is made of a high-resistance semiconductor. the only available electrons are in the valence band. The heater/bimetal mechanism provides a built-in time-delay. photons absorbed by the semiconductor give bound electrons enough energy to jump into the conduction band. lower energy photons (i. It can also be referred to as a light-dependent resistor (LDR). thereby lowering resistance. This is an example of an extrinsic semiconductor.THEORY: The internal components of a photoelectric control for a typical American streetlight. If a sample of silicon has some of its atoms replaced by phosphorus atoms(impurities). energizing the street light. Wheatstone Bridge The Wheatstone bridge is a type of d. When used in the deflection type mode.. force. A galvanometer is used to connect the mid-points of the right hand side voltage divider (made up of R2 and R4) and the left hand side voltage divider (made up of R1 and R3). it can produce an accurate measurement of resistance. The null type mode is more accurate than the deflection type mode. The galvanometer connection between the two mid-points form a bridge between the two sides. as the error in the former case will be in the mV or μV compared to fraction of a volt in the latter case A wheatston bridge is used to find the output voltage that corresponds to the values of the (LDR) that changes according to the light density(LUX) Figure 4: a dc null type bridge (wheatstone bridge) ⎛ LDR R2 ⎞ − Vo = Vi⎜ ⎜ LDR − R R + R ⎟ ⎟ 3 2 4 ⎠ ⎝ . An excitation voltage source is used to operate the bridge (Vi). it can produce a change in an output voltage that is proportional to a change in the sensor under question (a resistor).c. bridge that is used for precision measurement of resistance from approximately 1 ohm to the low mega-ohm rangerange. hence the name of the device. A typical Wheatstone null type bridge is shown in Figure 1 below.g. The change in the resistance of the sensor is representative of a change in the value of an external variable (e. temperature). stress. When used as a null type device. clock radios.and indium antimonide-LDR are used for the mid infrared spectral region.select the values of the Wheatstone bridge resistances by solved the equation which gives the relation between the resistors of the DC Wheatstone bridge and takes the input voltage equal to 4V . street lights and outdoor clocks. .Then ldr R2 = ldr + R R 2 + R4 APPLICATION: Photoresistors come in many different types. security alarms. 5. Ge:Cu photoconductors are among the best far-infrared detectors available.at many different value of light intensity concentrated on the LDR measure the corresponding change in voltage across the out put terminal of the bridge which represent the change on resistance of LDR .connect the whetstone bridge on bred board including LDR which is the variable resistance . They are also used in some dynamic compressors together with a small incandescent lamp or light emitting diode to control gain reduction. and are used for infrared astronomy and infrared spectroscopy PROCEDURE : 1. 2.apply 4V DC on the input terminal of the bridge . Lead sulphide. At the other end of the scale.at the first the sensitivity of the light dependant resistors (LDR) was measured by imposed it under maximum and minimum light intensity using the lux meter then take the corresponding resistance using amultimeter . 3. 4. Inexpensive cadmium sulphide cells can be found in many consumer items such as camera light meters. Capacitors Voltage regulater Multi-meter . then this value enter to the previous relation shop to get the corresponding light intensity .before triyng the program on hadware it is tested by software using pic simulater programe analogue values were input to the pic and the corresponding lux value were diplayed on the LCD module in the pic simulater program 9. 8. SYSTEM DESCRIPTION: Figure: light meter circuit The component of the circuit: DC Power supply Pic16f876 Resistors .after that we write an a c code which take an analogue value (voltage) and convert it to digital .After testing the program on software the program was applied to the hardware circuit 10.finally . the value of the light intensity in (lux) displayed on an LCD module. 7.6.then find the relation ship between the light intensity and and change in voltage using excel software . 5 0.26 0.11 0.5 3.3 4.93 1.4 3.277 0.5 7.2 10.7 1.5 14.6 6.193 0.36 1.03 2.1 2.1 .5 13 14.3 1.8 10 9.8 0.2 11.8 5.166 0.78 0.4 12 15 19 17 37 32 42 50 57 62 65 73 78 89 92 96 100 111 120 130 150 180 190 220 210 250 230 voltage reading(V) 2.2 10 10 50 70 11 160 30 140 40 0.1 3.2 5 4.3 2.3 3.94 2.56 0.1 3 1.275 0.36 0.7 0.44 4 3.7 1.5 1.45 1.6 2.28 1.71 0.93 0.01 0.5 2.096 0.97 1.35 1.9 7.206 0.2 4.9 1.3 0.8 11.95 1.5 0.2 9.224 0.5 3.35 1.3 voltage reading(V) 3.41 0.2 2.111 0.92 1.5 1.08 2.1 0.1 6.5 0.8 6.4 1.25 1 0.3 12.95 2.16 1.8 2.101 0.347 0.7 1.292 0.9 0.75 0.7 5.5 8.6 1.305 0.121 0.2 0.46 0.06 0.27 0.38 0.116 0.253 0.7 light intensity(lux) 7. LCD DATA COLLECTED Table(1) light intensity(lux) 0.5 20 3.5 2. DISCUSSION The maximum value of LDR at the minimum lux =560 kΩ The minimum value of LDR at the maximum lux =120Ω To find the value of the resistors of the DC bridge we use the equation Figure 5: a deflection type dc bridge ⎛ LDR R2 ⎞ − Vo = Vi⎜ ⎜ LDR − R R + R ⎟ ⎟ 3 2 4 ⎠ ⎝ @ LDR=120Ω assume Vo=0 ldr R2 = Then ldr + R R 2 + R4 120 R2 = 120 + R3 R 2 + R4 Let R3=R4 then R2=120 Ω @ LDR=560kΩ assume Vo=5 . 8 −(560 R4 = 2 2 By trying we found that the best value for Vi is equal to 4Volt and R3=R4=500KΩ In this project two resistors of 1mega ohm were used in parallel to obtain one resistance of 500 kilo ohm And three resistor of 100.308x 250 light intensity (lux) -2.976 Vi)R4 +67.976 *Vi) + 268 .2=0 .⎛ 560 .12−111 .12−111 .585 The error is : R^2= 0.12 ⎞ 5 = Vi⎜ ⎜ 560 + R − .10 were used in series to obtain 120ohm By using the lux meter we see that the relationship between the resistance and the light is inverse when the light increases the value of the LDR decreases and vise versa From the data collected the best relation between the light intensity with the voltage readings is Y= 20.5185 R = 0.308*x -2.12 + R ⎟ ⎟ in kΩ 3 4 ⎠ ⎝ Assume R3=R4 R42+(560.976 *Vi) ± (560 .6707 200 150 100 50 0 voltage(V) Series1 1 .10.12-111.6707 This equation used in the code 350 300 2 y = 20. h> #include <math. int16 value1.h> main() { float resulto. delay_ms(50). voltage= (value1-value2). value1 = Read_ADC().c> #include<LCDFunction.Figure3:the relationship between light intensity versus voltage CODE //included file needed in our code #include<16f876. value2 = Read_ADC().h> #include<16F876reg. //initialize clock @which the Adc will convert //switching between 2 channels to find the output voltage //delay must be used to correct changing between the two channels set_adc_channel( 0 ). //reading the analoge value1 //reading the analoge value2 //out voltage from H bridge .value2. //to convert the value of voltage to digital voltage = (5*voltage). set_adc_channel( 1 ).h> #use delay(clock=4000000) #include<lab4. //intialize analoge to digital ports setup_adc( ADC_CLOCK_INTERNAL ).voltage.temp. lcd_init(). //define the variable used //value1 &value2 //intialize for the LCD while(true) { setup_adc_ports( All_Analog ). delay_ms(50).h> #include <stdlib. 308*voltage -2. but when applying the program to the hardware circuits the results were not accurate theire were sources of errors some of them are known some are not.multimeter) Random error • Unknown noise .//-2. //delay needed to allow user to see the Lux value on LCD } } CONCLUSION The program written was succeed when tested using software and the results were identical to the expected ones.585 resulto=(float)(20. SOURCE OF ERRORS Systematic error • Inaccuracy in resistors . DisplayResult(resulto).in power supply .-2. • Environmental error like temperature • Personal error • Error in the instrument used ( lux meter .voltage /= (1023 ).308* temp). //lux value will display on LCD as float number delay_ms(500). //subtitute the voltage value in the equation //the equation is "Lux= 20.585 ).585 " temp = (float)pow (voltage. uk/technical/Theory/theorysensors.co.REFERENCE http://www.htm .mstracey.btinternet.