Building a Spectrometer Robyn Badon Michael Barnes Terrell Black Ryan Bloodworth Robyn Mackey Lecture Outline Introduction › What is a Spectrometer? › How it works/ Project relevance Spectrometer Design Overview LED Geometry Hardware Software Summary Introduction What is a spectrometer? › Optical instrument to automatically measure light intensity/ detect color changes What are we using it for? › Urinalysis › More accurate than human eye alone The urinalysis test strip is compared to predefined samples by color Computer can eliminate human error Overview of Project Relevance Medical screening device with 5 modules › Thermometer › Blood Oxygen Saturation › Blood Pressure › ECG › Urine Glucose SPECTROMETER For safety urine is sampled › Reduce risk of disease transmission › Much more sanitary How it works… Collect sample using test strip Light reflects off the colored strip Light intensity is picked up by the photoresistor Different reading for each LED › Based on concentration of glucose in urine sample Light… back to Physics... Human perception of color › Composition of light an object reflects A quick example: › If an object appears red, the red light is reflected while all other colors are absorbed Trivia If an object appears to be white, what is happening? Light Figure 3. Electromagnetic radiation. The visible wavelength range extends from approximately 350-700nm. Image source: http://www.andor.com/library/light/ Our Spectrometer Reflectance spectrometer Intensity measured by photoresistor Interpret results Photoresistor A photoresistor or LDR is an electronic component whose resistance decreases with increasing incident light › made of a high-resistance semiconductor intensity. › If light falling on the object is high enough, electrons get energy to jump into the conduction band › The resulting free electron and its’ hole conduct electricity, therefore lowering resistance Application Glucose concentration Human analysis by color matching Basic Reflection Spectrometer Design Three LEDS; blue, green and red. LEDs are controlled by the PIC Each LED is turned on one at a time LED is reflected down on the photoresistor causing the resistance value to change The voltage value is read in by PIC Data sent back to PC and compared Basic Reflection Spectrometer Design Figure 4. Block diagram of mini reflectance spectrometer LED geometry LEDs are arranged at a 30° angle The light is directed in a narrow beam towards the sample Prevents light from entering photoresistor directly, which would obscure the true signal The entire circuit is put in an opaque box to preventing interfering light from entering Spectrometer geometry Variety of LEDs Boxed in green is most typically used, estimated at 80% of world production Boxed in red is the LED used for our spectrometer Powering the LEDs Red and Green powered by PIC Resistors used as voltage dividers Blue LED needs more power Blue LED Transistor used as switch to power blue LED Spice Analysis of Transistor and Diode Voltage The detector NSL-6110 photoresistor Change is voltage is very small Must be amplified Run through 2 stages Voltage divider Non-inverting Amplifier The detector Controlling Software PIC code for reading reflectance GUI KNN Algorithms Central Unit: the 18F4520 Input/Output port A/D conversion Adaptation for RS232 communication PIC Code PIC must activate LEDs and read in Voltage from the photoresistor Set port D, pins 0-2 to output Loop program until RX interrupt Run functions based on char received MeasureR() Turn on red LED, turn off green and blue Wait short time Read in voltage Convert analog to digital Divide by 256, multiply by 5 Save value Turn off red LED GUI Software Using Visual Basic Button and text box for each LED Button sends char to PIC PIC returns data which gets displayed in text box Controlling Software Figure 8. Example Visual Basic GUI Color Matching Software Training phase Classification phase Training Phase Create sample data by scanning known colors Urinalysis Strips with known concentrations Classification Phase Compare current sample to test data by computing distance Create a list of K closest training values Take the average to find concentration Summary Our spectrometer has been designed to read urine glucose strips However, it is versatile enough to be used in any application where color detection is needed It can be adapted to be used for anything from protein concentration to pregnancy tests Questions?