Natalie C. Landon-Brace edited PIC.tex  about 10 years ago

Commit id: e48916cb5db5f472d6439cfad2f706a2cf8d50db

deletions | additions      

       

It was found that the yellow sensors were the most reliable and as such they were also used for presence detection. This was done by sending a 4-bit select signal to an analog mux, and converting the incoming voltage read to a 10-bit binary number using ADC before the candlelights were turned on. The number was then compared to the threshold voltage rating of 0.8 V. If the voltage from the sensor was greater than 0.8, the light was considered not present as it meant the LEDs under the tray were shining through the holes. Conversely, if the voltage rating was less than 0.8 V it meant the light was present, so a temporary "pass" value was recorded. The code for this subroutine is shown in Figure \ref{fig:PRESENCE} and was repeated for each well on the tray.  \subsubsection{Determining if the LED is On}  Determining if the light is on required effectively the same method as determining whether is was present, with a few exceptions. Firstly, all variables involved in light testing were initialized to 0 at the beginning of the LED testing sequence. Secondly, a light was not checked if it had been previously determined to be missing. Finally, 254 data points were taken for the voltage of the light once the switches had been activated to see how many times the voltage measured over the threshold. If the threshold was exceeded at least 10 times, the light was determined to be on and was tested for flikcering. If not, the light was recorded as an LED fail, and the next light was selected. Code for the LED\_TEST subroutine is shown in Figure \ref{fig:LED_TEST1} and Figure \ref{fig:LED_TEST2}.  \subsection{Program Details}  \subsection{Suggestions for Improvement}