A Portable Mid-Infrared Chemical Detection Sensor Submitted To Dr. Ray T. Chen, UT-Austin Gary Hallock, EE 464H Professor Heng-Lu Chang, Technical TA Prepared By Travis Brannen John Elson Steven Prickett Kaarthik Rajendran Aaron Treptow Parker Wray EE 464H Honors Senior Design Electrical and Computer Engineering Department University of Texas at Austin Spring 2015 CONTENTS TABLES ............................................................................................................................... iv FIGURES ...............................................................................................................................v EXECUTIVE SUMMARY ................................................................................................ vi 1.0 INTRODUCTION........................................................................................................1 2.0 DESIGN PROBLEM STATEMENT .........................................................................1 3.0 DESIGN PROBLEM SOLUTION .............................................................................2 3.1 Principles of Detection ........................................................................................3 3.2 Operating the Laser ............................................................................................4 3.3 Operating the Detector .......................................................................................5 3.4 On-Board User Interface and Wireless Tablet Platform ................................6 4.0 DESIGN IMPLEMENTATION .................................................................................8 5.0 TEST AND EVALUATION......................................................................................10 5.1 Subsystem Testing .............................................................................................10 5.1.1 Laser Controller to Lab-On-Chip Testing................................................11 5.1.2 Detection Testing.......................................................................................12 5.1.3 User Interface Testing ..............................................................................13 5.1.4 Power Testing ............................................................................................14 5.2 System Testing ...................................................................................................15 6.0 TIME AND COST CONSIDERATIONS ................................................................17 6.1 Time Considerations .........................................................................................18 6.2 Cost Considerations ..........................................................................................19 7.0 SAFETY AND ETHICAL ASPECTS OF DESIGN ...............................................20 8.0 RECOMMENDATIONS...........................................................................................21 9.0 CONCLUSIONS ........................................................................................................23 REFERENCES ....................................................................................................................25 APPENDIX A – LAB ON CHIP SENSOR ................................................................... A-1 APPENDIX B – ABSORPTION SPECTROSCOPY ....................................................B-1 APPENDIX C – LASER DRIVERS EXPLAINED ...................................................... C-1 ii CONTENTS CONT’D APPENDIX D – ANALOG FRONT END EXPLAINED ............................................ D-1 APPENDIX E – DIGITAL LOCK-IN EXPLAINED ....................................................E-1 APPENDIX F – OVERALL I/O SYSTEM SPECIFICATIONS ................................. F-1 APPENDIX G – BILL OF MATERIALS ..................................................................... G-1 APPENDIX H – APPLICABLE STANDARDS ........................................................... H-1 iii TABLES 1 ChemSense Cost Benefit Analysis .....................................................................................9 2 ChemSense’s Prototype Power Results ..........................................................................17 2 Cumulative ChemSense Project Costs ............................................................................19 iv FIGURES 1 Block Diagram of ChemSense ..........................................................................................3 2 Schematic of ChemSense’s Detection Process .................................................................5 3 User Defined Set Points (Android App). ...........................................................................7 4 Android App Data Export Function ..................................................................................7 5 Final Prototype Dimensions and Layout ........................................................................10 6 QCL Output with ChemSense Negative Pulsed Laser Driver ........................................11 7 Lock-In Detection Test ....................................................................................................12 8 ChemSense Laser Driver Powered by Power Subsystem ...............................................15 9 Integration Test of Laser Driver, DSP MCU, and Detection Circuitry..........................16 10 Android App Real-Time System Test...............................................................................16 11 Android App Real-Time System Test with Threshold Alert ............................................17 v EXECUTIVE SUMMARY Our team’s senior design project, ChemSense, is a portable, mid-infrared chemical sensor system that has applications in national security and industrial safety. Current infrared chemical detection technologies are bulky and costly. Utilizing Dr. Ray Chen’s lab-on-chip QCL/QCD, our challenge was to design, build, and test a portable, affordable mid-infrared chemical detection sensor. Our design solution takes traditional, benchtop spectroscopy components (pulse generator, laser driver, and lock-in detector) and shrinks them to fit on a custom-designed printed circuit board (PCB). Thanks to our unique PCB design and use of digital signal processing (DSP) detection, our solution addresses key design requirements in portability (<2 lbs), real-time detection (within 100 ms), and power consumption (2 W). ChemSense’s design evolved over the course of our project. With every roadblock we faced, our team seized the opportunity to make a smarter design and stronger product. These modifications include: the addition of negative voltage laser driver, increased end user digital filter flexibility, and a second user interface in a dedicated Android application using Bluetooth low-energy (BLE) wireless connectivity. Ultimately, these additions make ChemSense more adaptable to a wide range of sensors and end users while still keeping product costs under $200. Testing and evaluating ChemSense first required that critical subsystem metrics be met before system integration and final prototype build. Our laser driver was designed to meet the voltage (15 V) and current demands (2.5 A) of the lab-on-chip sensor. The analog and digital detection circuits were evaluated to define their sensitivity (100 ns pulses), and our user interface components were tested to ensure error-free end user interaction. During system testing our device with the lab-on-chip, our laser driver was able to run the laser in a manner comparable to a benchtop laser driver, but we are still working on successfully processing the output of the laser sensor. Design hurdles in the digital lock-in (DLA) development and PCB test circuitry affected our design timeline. The DLA was delayed three weeks due to difficulties in writing the Assembly biquad filters code. The sensitivity and precision of the laser driver and detection circuitry made it impossible to use mock circuits on breadboards. We were forced to rely on multiple PCB test designs that were time intensive to design, order, and build. Still, our costs for the project stayed under budget ($810) thanks to creative use of circuit component samples from multiple vendors and affordable PCB board house providers. In the future, we could improve ChemSense in ways that enhance component safety and portability. To reduce the lab-on-chip’s exposure to transient voltages, the design could include a configurable sensor pad. To make ChemSense even more portable, we could integrate our DC/DC power convertors onto the main PCB, switch to smaller components, eliminate redundancies in the laser driver subsystem, and employ a flexible PCB. Given the complexity and challenges we faced, we are proud of the work we accomplished to help Dr. Chen realize his goal for a portable, affordable mid-infrared chemical detection device. vi 1.0 INTRODUCTION This document is describes our final design for ChemSense, a portable laser spectroscopy system that detects hazardous airborne chemicals. By utilizing Dr. Ray Chen’s lab-on-chip laser sensor, ChemSense offers chemical concentration detection on a mobile platform. We designed ChemSense to save lives by alerting users of harmful airborne chemicals that cannot be detected by human senses. Our design integrates tunable, mid-infrared laser spectroscopy in a portable, low-power package. Previously this semester, we presented our initial design for ChemSense and described our testing plan. This document presents the results of using those documents to build and test a physical device. First, we describe how our design addresses the specific need for portability and accurate detection required by our project sponsor, and the important metrics that define success for our design. Next, we will describe the laser driver, analog filter, DLA, and UI subsystems and how each is integrated into the overall design. We then discuss how challenges such as learning that we needed to generate negative laser pulses affected our design solution. Our system and subsystem-testing summary discusses, among other topics, our success at generating laser pulses and our progress at detecting chemical concentration using the QCL/QCD. Finally, we will discuss how time constraints limited our success at laser detection, how we were able to stay under budget through multiple prototypes by using sample materials, and provide recommendations for how to make ChemSense more flexible, accurate, and portable. 2.0 DESIGN PROBLEM STATEMENT Utilizing newly developed laser spectroscopy technology, our design of ChemSense solves a need for a mobile chemical concentration measurement device. Current laser chemical sensing technologies either require off-site analysis, or bulky onsite equipment. A portable chemical identification device (PCID) could save lives by alerting the user when a dangerous airborne chemical is present. Modern advancements in QCLs, QCDs, and optical waveguides in the midinfrared region (Mid-IR) have resulted in accurate and sensitive lab-on-chip chemical sensors, approximately one centimeter in area [1, 2]. Despite these advances, an integrated mobile controller does not currently exist. Dr. Ray Chen’s company, Omega Optics, has developed a QCL/QCD lab-on-chip chemical sensor. Our device capitalizes on the small size of Dr. Chen’s chip by integrating it into a portable controller. Our design requirements come from the power needs of the lab-on-chip sensor and our design’s goal to be a portable chemical sensor. For proper operation, the QCL requires a high fidelity pulse shape at an optimized duty cycle, voltage, and current [3]. In order to lase, the QCL requires a minimum of 10-20 V and 2.5-4 A, depending on fabrication quality (See Appendix A). Above this threshold, additional power enhances the accuracy of chemical detection. On the other hand, providing too much continuous power will destroy the lab-on-chip. To provide enough power for the QCL to lase but avoid damaging the chip, we must provide short duration (<100 ns) pulses at a maximum frequency of 50 kHz. As we are providing the QCL with these short duration, high intensity pulses, we will be measuring the current output from the QCD. The QCD output will be on the order of a few μV, so our detector circuit will need to be able to convert a time dependent μV scale signal into a concentration measurement. We will evaluate the system as a whole by repeating the tests conducted to characterize the chip by Dr. Chen’s group. Since their test was conducted using a benchtop setup, if our device can obtain results that are within 1 % of the results obtained by their test, we can conclude that our device is as good as the benchtop system they are using in lab. To achieve our goal of portability, our system must be low power (<2 W continuously) so that a lightweight battery can serve as the power source. Additionally, the system needs to be lightweight enough to be easily carried (< 5 lbs). Finally, given that ChemSense’s primary application is detecting hazardous chemicals, the device must operate in real time, notifying the user within 100 ms if a dangerous substance is present. 3.0 DESIGN PROBLEM SOLUTION ChemSense provides a fully customizable, lightweight, and low power solution to the need for mobile broad spectrum chemical detection. ChemSense is composed of a dual mode laser driver, quantum cascade laser (QCL) and detector (QCD), digital lock-in amplifier, user interface (onboard touch screen and/or android app), and power electronics. These elements are integrated on a custom printed circuit board (PCB) weighing less than 2 pounds and requiring less than 2 watts of power. From the user interface, the user will input operating parameters. Using this information, ChemSense will operate the laser using the laser driver and read the output from the detector using an analog filter and a digital lock-in amplifier. Once the sensor’s output has been filtered, the data is sent to the user interface where the Beer-Lambert law is used to determine the 2 concentration of the chemical of interest. This data can either be output to ChemSense’s 7” onboard touch screen, for real time data analysis, or sent via bluetooth to an android device. ChemSense’s android application offers all the functions found on the attached touch screen as well as the ability to export data to a computer. Both the laser driver and signal processor are controlled by a microcontroller dedicated specifically for digital signal processing (DSP MCU). Concentration calculations, the user interface, and bluetooth communications are handled by the user interface microprocessor (UI MCU). A high-level block diagram for ChemSense is shown in Figure 1, below. Figure 1. Block Diagram of ChemSense. ChemSense is a highly customizable chemical sensor. Because it can source and interpret variable frequency, duty cycle, amplitude, and signed pulses, ChemSense could be used to run nearly all solid-state lasers and detectors on the market. This means ChemSense has the potential to sense nearly any chemical using the same control system by changing the sensor used. 3.1 Principles of Detection ChemSense senses chemicals by absorption spectroscopy, a method of chemical detection where light of a particular wavelength passes through the chemical of interest and is attenuated based on the chemical’s absorption of light at that wavelength. A detector then collects the light and the attenuation is used to infer chemical concentration. This process is governed by the Beer3 Lambert law and described in detail in Appendix B. One of the most important factors of absorption spectroscopy is the choice of light wavelength. ChemSense uses QCL’s because these lasers operate in the mid-infrared, the most selective wavelength region in the electromagnetic spectrum for chemical detection. However, ChemSense was designed so that the user could insert their own laser and detector and sense chemicals by detecting their absorption of light in other wavelength regions, if desired. For custom lasers and detectors, the user will need to specify the wavelength, pulse repetition frequency and duty cycle for the laser. This defines how the laser will be modulated and how the signal-processing unit will detect the signal. For proper chemical detection the user also needs to input the molar absorption coefficient of the chemical they want to detect at the wavelength of the laser they choose to operate. With this information, ChemSense can use the Beer-Lambert law to determine concentration based on what it detects. Once this is done ChemSense will repeatedly update the Beer-Lambert equation to provide a real time concentration of the chemical of interest. 3.2 Operating the Laser ChemSense’s laser driver can provide either positive or negative voltages in either continuous or pulsed mode, depending on the application. In providing these options, we attempt to provide a laser driver that can operate most solid state lasers on the market today. When the user sets a laser modulation frequency and duty cycle, this information is sent to the DSP MCU. The DSP MCU generates a sequence of pulse triggers, which are used as the control signal for the laser driver. The laser driver then sends high voltage and current pulses to drive the laser. Providing both positive and negative pulses on the same board requires proper bootstrapping. Because of this, the negative pulse driver requires two negative power supplies, one to drive the laser and the other to create the artificial reference to drive the MOSFET gate. Currently, ChemSense’s portable power electronics do not provide negative voltages. Instead connections are available for the user to input their own battery (or power supply) to provide the required negative voltage. More information about this and how the pulse drivers operate can be found in Appendix C. 4 3.3 Operating the Detector Once the attenuated light signal is converted to a microamp scale current by the QCD (or the users photodetector of choosing), it is sent through a transimpedance amplifier, low-pass filter, gain, then into the ADC of the DSP MCU. From there a digital lock-in amplifier (DLA) extracts the signal. This process is shown in Figure 2, below. We chose to use a transimpedance amplifier because it provides the best gain interface for photodetector loads. The tunable antialias filter employs a first order RC filter that both broadens the pulse and ensures the Nyquist condition is met at the ADC. The final tunable gain allows the user to ensure the maximum dynamic range of the ADC is used, so ChemSense can recognize small changes in concentration. More information about the analog front end can be found in Appendix D. Once the signal is sent to the ADC, the DLA extracts the signal from all out of band noise and give the UI MCU a recording of the amplitude of the signal at that instant in time. The DLA works under the principle of frequency locking to isolate the signal among potentially large amounts of noise. Simulation has shown that ChemSense’s DLA is capable of finding the signal in an environment where the noise can be up to six times stronger than the signal of interest. More information about the DLA can be found in Appendix E. Figure 2. Schematic of ChemSense’s Detection Process. ChemSense’s detection process is designed to handle signal to noise ratios below .5 while still offering a fully tunable setup for the user. The DLA has support for the user to implement their 5 own band-pass filter, lock-in modulator, and low-pass filter, if desired. They need only download their filter and modulation coefficients into the system and ChemSense will do the rest. This provides a near 100% customizable DLA, up to the limit of the DSP MCU’s processor speed. Written entirely in Assembly, the DLA provides a more efficient signal translation than would be possible using higher level languages. Since both the DLA and laser driver controller are both implemented on the same DSP MCU, the DLA shares the same pulse trigger. This ensures frequency locking because the modulation frequency in the DLA is the same as the one used in the laser driver. This is important for signal recovery because if the DLA is not phase matched to the input signal it will not function properly. Due to the limit that the ADC in the DSP MCU can only collect voltages between 0 and 3.3 V, all negative pulses are rectified in the analog front end. This means when ChemSense is operating in negative pulse mode, positive pulses are detected. After the DLA generates a DC concentration measurement, it is sent to the UI MCU. 3.4 On-Board User Interface & Wireless Tablet Platform ChemSense provides the option to interface with the sensor either through an onboard 7” touch screen to interface with the user as well as a wireless Android tablet. The idea of the onboard touch screen is to provide full control and immediate data analysis directly from ChemSense, without out the need for external equipment or interfacing. The Android application provides external control and analysis. This allows the user to attach ChemSense to a robot to analyze dangerous chemicals in environments not safe for people. Additionally, if the user desired to monitor an area for a prolonged period of time, they could leave ChemSense running and check the Android application periodically. Using an external UI has the added benefit of reducing the power needs of the device itself. The user interface is run by ChemSense’s dedicated UI MCU. This processor handles all user requests, ensures the requests are sent to the proper subsystem, and manages all communications with ChemSense’s android application. The processor also performs all concentration calculations and updates a concentration versus time graph for the user every 100 ms. The user can also define a concentration set point at which an onboard alarm will sound. This feature is also mimicked on the tablet. Written in Java, the app allows the user to perform all of the same functions with a wireless tablet as with the on board user interface (Figure 3, on page 7) as well 6 as the ability to export recorded data (Figure 4, below). Utilizing the onboard memory and processing power of the tablet, ChemSense’s Android app can record up to one hour of sensing data (36,000 samples) and wirelessly email this data to an address of your choosing. This allows for additional post processing, if desired. Figure 3. User Defined Set Points (Android App). Figure 4. Android App Data Export Function. 7 4.0 DESIGN IMPLEMENTATION Throughout the process of designing, building, and testing ChemSense, unforeseen obstacles and opportunities shaped the final product. The major changes to our initial design were the addition of a negative voltage laser driver, the inclusion of an android application, and the removal of the temperature control module. We were forced to develop a negative voltage laser driver when, during testing, it became clear that the QCL required a negative voltage pulse to operate. We had completed all of our preliminary design with the belief that the laser required a positive pulse, and because of the fact that obtaining lab time with the lab-on-chip was difficult, we were already fairly far along in the design process before we tested the chip. Since we had already designed the system with a positive laser driver, we chose to leave both positive and negative laser drivers on the chip in the final product. We chose to add an android application when our project sponsor suggested it as a way to make our project more appealing at open house. Implementing an android user interface ended up having the additional benefits of allowing us to offload a significant portion of the power needs of our device (running the touch screen) to the user’s cell phone, or allowing the removal of the LCD all together for increased portability. We removed the temperature controller from the final design because we determined that it would require eight watts of power which would not work with our design constraints. As a low power alternative, we redesigned the sensor pad on the PCB to act as a heat sink. Because of what we learned and the changes we made during the execution of our project, several alternate designs for ChemSense are now possible. These designs center around positive versus negative laser pulsing, the location of the user interface, and making the design wearable. Our final prototype includes positive and negative laser driving, but the negative laser driver requires an external power source. Alternate forms of ChemSense could provide only positive or only negative laser driving or both, ideally with power supplied by the system’s batteries. The simplest version would be having only positive laser driving, since this design has been completed and tested. More design would be needed to work out how to power a negative laser driver using the system’s batteries. A version of ChemSense offering both positive and negative laser drivers would be able to operate a larger set of laser detectors, but would be slightly more costly to produce. 8 After having completed both the android and onboard UI’s, it is clear that our onboard UI was more difficult to implement than the android app and also draws power from the system’s batteries that could be used to increase our operating time. Additionally, the onboard UI adds to the size of the system. Because cell phones are so ubiquitous, we could easily offload our entire user interface onto an android app, reducing our system’s power consumption, weight, and cost. Finally, when we began implementing ChemSense we did not have a clear idea of how big the final system would be; we were able to produce a system that is small enough to be easily carried (Figure 5, on page 10), but there are a few optimizations that could make it even smaller. By removing the onboard UI, putting the power supply module on the same board as the rest of the system, reducing the battery size, and using only one microcontroller, we believe that ChemSense could be as much as 60% smaller. Additionally, by using a flexible PCB, we could make the device into an armband or a belt. Even without these improvements, ChemSense is still far superior to a benchtop system, offering the same performance at one-fiftieth the cost (See Table 1 below). A full bill of materials can be found in Appendix G. Table 1. ChemSense’s Cost Benefit Analysis. Item Lab Equipment ChemSense Computer and UI $600 $100 Dual (+/-) Supply $670 $50 Laser Driver $340 $25 Digital Lock-In $4,000 $10 Pulse Generation $4,000 $10 TOTALS: $9,610 $200 9 Figure 5. Final Prototype Dimensions and Layout. 5.0 TEST AND EVALUATION To determine how well we achieved our project goals we tested each subsystem and system as a whole. We ensured our subsystems were ready for integration after we characterized each one’s I/O and then combined all our hardware on our PCB to verify the software modules connected with the hardware elements. Finally, we constructed our final ChemSense prototype and evaluated whether it met our overall system specifications. (see Appendix F) In the following section we will describe the testing process and results for each subsystem, including our evaluation of integrating our laser driver with the QCL and tuning our analog front-end and DLA detection circuitry. The following sections describe ChemSense’s system test process and results: the conditions for collecting data, our testing results, and an evaluation on whether the test outcomes were successful. In general our tests were successful, but we have not yet demonstrated our detection circuit with a QCD input. 5.1 Subsystem Testing Since our project contained different, interdependent systems, our design success depended on being able to test each subsystem accurately in isolation. There were four major modules that had to be independently tested: the laser controller, the detector, the user interface, and power. The analog part of the system is comprised of the laser driver, the lab-on-chip sensor, and the detector’s analog front end. The analog system feeds into the detector’s DLA (DSP MCU) that produces a DC signal sent to the UI MCU. The UI MCU sends BLE data to the android app. The 10 following sections describe our critical subsystem tests. First, we discuss our success in interfacing the QCL to our laser driver. Then, we describe what our detector circuit is capable of detecting. Finally, we describe how we evaluated our user interface and power systems. 5.1.1 Laser Controller to Lab-On-Chip Testing We tested the customized laser driver using different loads to simulate the QCL before interfacing with the QCL. Because QCL's are expensive to fabricate, we used an 8 ohm resistive load to confirm that both our positive and negative voltage laser drivers achieved voltages greater than |15| and average currents equivalent to 10 mA. After verifying with an oscilloscope that the high-voltage high-current output pulse was an approximately rectangular waveform with a pulse width and a pulse repetition frequency matching the input pulse, we then used the QCL as the load. Testing our laser driver with the QCL, we were able to induce the QCL to lase using negative voltage pulses (See Figure 6 on the following page). During our test procedure, we increased the amplitude of our voltage pulses while monitoring QCL temperature to ensure that it was not in danger of overheating. Once we observed measured power generated by the QCL greater than 200 mW, we concluded that our laser driver had successfully powered the QCL. Figure 6. QCL Output with ChemSense Negative Pulsed Laser Driver. 11 5.1.2 Detection Testing In order to certify the correctness of the results from our lab-on-chip, we had to prove that its energy loss was detectable by the lock-in. We needed to spread the pulse out in time so that the ADC of our microcontroller could detect it. In order to quantify the temporal spreading, we built an analog filtering circuit on a breadboard with tunable resistors. We fed a square wave from the lock-in microcontroller through the front end and through the digital filter. We then gradually decreased the duty cycle in an attempt to test the minimum pulse width we were capable of detecting. Figure 7 below shows the contrast between the lock-in detecting a signal and failing to detect one. The lock-in can convert a square wave into a DC signal if the square wave has a large enough duty cycle. These graphs show that, with the help of the analog filtering circuit, the lockin is capable of detecting pulses with 100 ns width but not 75 ns width. Figure 7. Lock-In Detection Test 12 Because we implemented the digital lock-in amplifier in a microcontroller, we had to debug for both code correctness and performance. Debugging for code correctness means ensuring the program works as intended. This was done comparing the response to a given input of our DLA with that of an identically designed set of filters in MatLab. Our filters produced values within 0.01 % of the MatLab simulated values, indicating that the only difference between our filter and MatLab’s was in rounding. Once we were sure our filter was correct, we had to make sure we could meet our performance requirements. Specifically, the ADC samples at 100 kHz, so we had to be able to run the filter 100,000 times a second. Through empirical testing, we concluded that the bandpass and lowpass filters could require a combined number of coefficients of at most 66, below the theoretical limit of 100 coefficients that we had designed around. Empirical testing also revealed that each sample took at most 8.2 microseconds to process, less than the 10 microseconds allocated to each sample by the ACD’s sample rate. After proving that our filter algorithm worked as expected within the required timeframe, we chose filter coefficients and performed functional testing of our filter by trial and error. For further details on what software tools were used to accelerate this process, please see Appendix E. 5.1.3 User Interface Testing We tested the Touchscreen UI in two ways: unit tests and functionality testing. Our unit tests were implemented using software modules that passed values into individual functions within our code and tested whether the output of each function matched our hand-calculated expected values. This was done until each function worked for a specific range of input values and produced predictable outputs. Functionality testing was conducted by navigating the display modes of UI touchscreen to ensure the interface responded as intended. Our functionality testing did not ensure that the UI is bug-free, however, after we completed unit testing of all UI software elements and functionality testing of all UI features we are confident that our UI is error free. To interface with the signal processing subsystem (DLA), we wrote a program in Java to collect serial data from the output of the lock-in. We used this both to test data to design our system and to simulate the interface between the user interface microcontroller and the lock-in microcontroller. Because the Java application used the same communication format as the two 13 microcontrollers, when we had to hook the lock-in microcontroller into the user interface microcontroller, we were able to get the two communicating with minimal effort. Testing the Android application required creating both a BLE client and server. Utilizing an open source app (nRF UART 2.0 app from Nordic Semiconductors) that can send and receive BLE data we were able to determine whether our UI MCU could send and receive bluetooth transmissions. Once we verified that the UI MCU was handling data appropriately, we used our UI MCU to troubleshoot the BLE functionality in our android app. After connecting the android app to bluetooth, we were able to test the plotting and data handling abilities of the app. The BLE connection allowed us to stream in data at 10 Hz. Testing 1000 packets, we determined that the android app is successfully receiving >99.9% of packets transmitted by the MCU. We also performed functional testing to determine that the android app is also able to send control signals to the UI MCU. 5.1.4 Power Testing Our power system testing’s primary goal was to ensure the laser driver, MCUs, and LCD touchscreen could receive consistent power from the DC/DC power convertors, via the battery, and not fail during operation. It was critical that our power system be able to provide the pulsed current demanded by our laser driver in order for ChemSense to be portable. Figure 8 on page 15 shows the laser driver output as driven by our battery. The battery is able to provide the 15-25V, >2A pulse required by the laser driver. To test the power system’s endurance, we interfaced the power subsystem to directly power the laser driver, MCUs, and touchscreen to monitor battery performance. During five, independent 8-hour tests we noted that the battery voltage deviated, on average, by 0.4 V after the sixth hour. Our final system power performance evaluation can be found in the next section. 14 Figure 8. ChemSense Laser Driver Powered by Power Subsystem. (Yellow line is the pulse generation output, Blue line is the voltage across our laser diode terminals with a resistive load.) 5.2 System Testing After our subsystem tests and evaluations were complete we were ready to integrate the entire system. At the time our design reached system testing the lab-on-chip sensor was not available for testing, nor would it be available to showcase at open house due to the chip’s vunrability at its current state. In addition, the exposed QCL mid-IR lasers posed a safety threat. In order to progress in our testing, and have a fully realized prototype for open house, we chose to configure a near-IR sensor on ChemSense. While our team has not yet been able to complete the lab-onchip mid-IR detection tests, we were successful with the positive pulsed system integration and provide the results in the section below. Before full system integration we tested the critical connection between our near-IR laser driver and detection subsystems. We tested absorption detection by using three translucent films of differing index and observed the results. Figure 9 on page 16 confirms that we were able to prove our DLA, DSP MCU, and laser driver integration was a success. 15 Figure 9. Integration Test of Laser Driver, DSP MCU, and Detection Circuitry. We were then ready to fully integrate the system, including our UI and power, and again use the same test to confirm detection results. We had already used simulated data to display a real time graph on both the onboard and android UI’s, and we had sent bluetooth data between the UI MCU and the android app. So, after we interfaced the laser driver to the photodiode to the detector subsystem, completing full system integration was straightforward. Figures 10 below and 11 on page 17 are conclusive results of the full system performing chemical absorption analysis. Figure 10 shows real-time (10Hz) data plotted in blue and the average for each minute in green. Figure 11 shows the user-defined threshold being met by ChemSense and triggering the alarm warning. Figure 10. Android App Real-Time System Test. 16 Figure 11. Android App Real-Time System Test with Threshold Alert. Once our final full system tests were proven we then used the benchtop power supply to feed our DC/DC convertors to observe the power consumption of our prototype. Table 2 below shows the results. When our full 7” LCD display is plugged in ChemSense draws slightly less than 2 W (while the LCD screen is lit). We then disconnected the on-board LCD and then confirmed that our power consumption was significantly less at 0.72 W while just utilizing the BlueTooth LE UI functionality. Table 2. ChemSense’s Prototype Power Results. Prototype Setup Power Consumption Full 7” Prototype 2 Watts Prototype (without LCD) 0.72 Watts 6.0 TIME AND COST CONSIDERATIONS While our team was able to meet our project timeline and goals, it was not without challenges that altered or delayed our design schedule. The following section details our specific time management concerns related to designing our custom PCB and troubleshooting our DLA algorithm. We then highlight the choices our team made that allowed us to complete our project in time and under budget. 17 6.1 Time Considerations Time constraints were a significant issue for our project, largely due to the scope of our design. Turn around times on circuit board manufacturing, DSP algorithm development, and sensor operation issues caused some unexpected delays. The low-noise requirements of our project made it necessary for us to have several circuit boards manufactured to get a realistic idea of how our circuits would function in practice. The DLA we chose to implement had it’s own challenges, and took much longer than expected to design and test. Finally, the main sensor in our project was still in an experimental state for the majority of our timeline, making it hard to nail down the exact operational characteristics we needed to meet. The main time challenge we faced was in the creation of the custom circuit boards needed to maintain the precision necessary for QCD signal retrieval. We had difficulty using breadboards to test circuits because they introduce a significant amount of parasitic capacitance. These parasitics, along with unreliable breadboard contacts, affected the operation of the sensitive analog components our project required. Designing a custom circuit board was the only solution. Unfortunately, unpredictable manufacturing and shipping times resulted in delays, during which we had to go about testing our proposed circuitry by other means. Typical turnaround time for a single PCB was about ten to fourteen days, and we ultimately ordered several sets of PCBs. We chose to use a digital lock-in-amplifier algorithm largely because of the flexibility it allows, but the implementation presented more issues than we initially expected. Precision and speed requirements and constraints in the compiler we were using necessitated that the DLA be written entirely in assembly language. Assembly language is much harder to debug than code written in higher level languages such as C, and can end up requiring ten to one hundred times the number of lines of code to accomplish the same goal. However, assembly offers an increase in execution speed and, in this particular case, precision, that we could not achieve with higher-level languages. We initially estimated that our DLA would only take a couple weeks to develop, but in practice, it took nearly two months. An upside to the development time invested in the DLA is that a significant amount of 18 modularity was built into it in order to help us test the design along the way, which allows the end-user flexibility in customizing the DLA to their needs. 6.2 Cost Considerations Our team was able to complete the project under the $1,000 limit (See Table 3, below) by taking advantage of sample materials, modern low-cost PCB manufacturing services, and use of existing equipment provided by Dr. Chen. As we were not provided with any specific technology requirements beyond the use of the lab-on-chip sensor, our design was completely custom, and required careful evaluation of many different parts. Throughout the design process we evaluated over twenty different chips for our analog circuitry and designed, built, and tested three different major revisions of our circuit board, along with several revisions of smaller subsystem test boards. Table 3. Cumulative ChemSense Project Costs. Item Cost PCB Orders $285 Near-IR Lasers and Detectors $150 All IC’s and Components $110 MCU Development Boards $100 7” LCD Screen and Driver $80 Li-ion Battery & Charger $75 BlueTooth LE Module $20 TOTAL: $810 Another cost factor we took advantage of was the use of new, affordable budget PCB board houses for our design. In the past few years, many new-generation PCB manufacturing services have sprung up which enable both professional and hobbyist access to high quality printed circuit boards. Only a few years ago, one could easily spend over a hundred dollars to have a single PCB made. These days, services such as OSH Park, Cheap Dirty PCBs, and SeeedStudio offer extremely affordable PCB manufacturing services, with tolerances 19 and quality that rival and even exceed many larger, more established board houses. By utilizing Cheap Dirty PCBs, our team was able to order three different revisions of our board, receiving ten copies of each, all for under $300. The quantity of boards received allowed us to create several copies of each version for testing. Furthermore, since our design required that we take existing bulky, expensive equipment, and distill the necessary functionality into our design, we had a significant amount of proven (and unproven) hardware available to us. Some of the laser drivers we were provided proved to be unusable for the lab-on-chip, which necessitated the creation of our own design - a challenge we did not initially expect. Yet another unexpected challenge was presented in the polarity requirements of the lab-on-chip itself. Our solution to these problems resulted in tunable laser pulse drivers for both positive and negative polarities both costing significantly less than any commercial solution available to us. 7.0 SAFETY AND ETHICAL ASPECTS OF DESIGN We designed our project to be safe to operate, reliable in detecting hazardous chemicals, and proactive in alerting users to danger. Designing with safety in mind was important because ChemSense’s operation is not inherently safe.The lasers required for mid-infrared spectrometry can damage eyes. In addition, users will be trusting ChemSense to detect hazardous chemicals so ChemSense must not fail to alert users to the presence of these chemicals. ChemSense avoids failing to alert the user by testing the audible alarm on startup and failing safe if the laser fails. The first and most serious safety issue the team faced in building and testing ChemSense was dealing with the risks posed by infrared lasers. Because infrared lasers lase outside of the visible wavelength the power of the laser isn’t obvious. If we had been dealing with similarly powerful light sources in the visible spectrum (burning magnesium, for example) their brightness and the resulting visual distortions would have kept us vigilant to the danger. Being unable to see the laser in no way makes it less dangerous: infrared lasers can cause corneal burns and cataracts [5]. (See Appendix H, Applicable Standards) Early on in the lab, we protected ourselves by wearing safety glasses. Once we moved to the prototyping stage, we built a large foil covered box and performed tests inside it. In the final product, we 3D printed a small cover to fit over the 20 laser / detector pair. We know that the material we used is effective because passed a small sliver of it between the laser and detector and verified that it blocked 100% of the passed energy. So long as this cover remains in place, user exposure to dangerous lasing will be minimal. If this cover were to become dislodged, any operator would risk optical damage. Therefore, we recommend a warning label advising against using ChemSense if the cover is displaced. The second issue is avoiding false readings, either positive or negative. A false negative is when our project is being used correctly but fails to alert the user to the presence of the chemical that they’re attempting to detect. One way the system could create a false negative result is if the alarm fails to function. It is not reasonable to expect the user to be constantly monitoring ChemSense’s screen for hours at a time. The alarm is programmed to sound at startup as a diagnostic to prevent this type of failure. At the same time, a notification informs the user that the alarm should be sounding. If the user sees this notification but not the alarm, they will know that their unit is malfunctioning. Thankfully, a malfunction of the laser / detector pair is unlikely to cause a false negative. ChemSense fails safe because if the laser stops lasing or the detector doesn’t detect anything, this is electrically equivalent to extremely high concentrations of a chemical blocking out 100% of the laser’s power. Thus, in the most common failure case, the system will alarm constantly rather than not at all. 8.0 RECOMMENDATIONS While we have succeeded in constructing modules for the laser driver, pulse detection front-end, digital lock-in amplifier, and a user interface, we have several recommendations for optimizing the system design. Some important changes include replacing the QCL/QCD packaging from pads to through-holes, placing the power electronics directly on the printed-circuit-board, and using an alternative circuit design for detecting short duty cycle pulses. In this section, we will identify alternatives for modules at the board level. Optimizing the QCL/QCD packaging and PCB routing will significantly decrease overshoot and ringing during high-to-low and low-to-high transitions (See Figure 9 on page 16 for an example of ringing). Smoother rise and fall transitions on the input pulse prevents damage to the laser and other electrical components. The lab-on-chip device currently sits on large area pads, which 21 effectively behave like capacitors because a dielectric insulator separates the gold contact from the copper ground plate. Additionally, we recommend packaging the laser in a metal can TO-56 or TO-9 package with short leads. Because our system delivers low duty-cycle pulses to the laser, and likewise, receives low duty-cycle pulses from the detector, it is critical to keep the wiring between modules as short as possible. During our system testing, we recognized that longer connections between modules significantly degraded the signal-to-noise ratio and introduced distortions. While we succeeded in maintaining short trace lengths on the PCB we submitted, the next revision would ideally incorporate the QCL/QCD with short leads directly soldered to the PCB. To make ChemSense more portable, it needs a negative voltage source and for the power electronics subsystem to be incorporated onto the same PCB as the rest of the system. ChemSense's negative voltage driver requires two dc negative voltage supplies. We currently use DC power supplies to provide those voltages, which is sufficient for testing in the lab. A future revision needs a positive-to-negative voltage generator with dc-dc converters compatible with negative voltages. Additionally, our power subsystem could be put on the same PCB as the rest of the system. Currently, our system uses a single lithium-ion 7.4 V battery to power the electronics. As part of the positive laser driver, a buck converter steps down the battery voltage to the required voltage needed for the laser. Because we were concerned about noise introduction, the buck converter is currently a separate module on its own PCB. The next revision of the PCB should incorporate a buck converter. The laser driver modules can be upgraded to save space on the PCB and produce pulses with minimal noise. First, the isolated gate driver on the negative voltage pulse generator can be replaced with a comparable surface mount component. A surface mount component saves space and reduces parasitics because the leads are shorter. Currently, our negative pulse generator uses two dc power supplies with a common ground. If we replace one of the dc power supplies with an isolated power supply, the laser circuit and the digital circuits do not share a current path, decoupling noisy circuits. After performing the recommended heat dissipation study mentioned previously, the power MOSFET can be replaced with a compatible surface mount component 22 such as a small outline package to save space and reduce trace length. Additionally, the NMOS transistor can be replaced with a different MOSFET family with improved switching characteristics including faster rise and fall times and reduced parasitic capacitances. Because a laser's operating point can change with temperature variations, we recommend adding a circuit with feedback control. A current sense monitor together with a thermoelectric (TEC) module will ensure constant current and voltage are delivered to the load despite external changes. On the detection side, revising the analog front-end with a sample-and-hold (SH) circuit is critical for detecting low-duty cycle pulses. Our current solution is inherently inaccurate because it manipulates the pulse amplitude and the ADC sample rate is inadequate. We recommend replacing the low-pass filter and gain stage with a sample-and-hold circuit. The sample-and-hold circuit charges a low-leakage capacitor to the maximum pulse level for a time period comparable to a 50% duty cycle. This eases the ADC requirement, and because the fundamental has more energy at a 50% duty cycle, the lock-in will more accurately reflect the actual pulse amplitude from the detector. The SH requires a low-leakage capacitor and several vendors provide integrated circuit components. 9.0 CONCLUSION At the culmination of this project our team is proud of our design, ChemSense. After careful thought and planning in the Fall 2014, we spent approximately 2,000 man-hours designing, building, and testing our modules in Spring 2015. We laid out three printed circuit boards, each with new analog circuits to adapt to our project's challenges, and wrote over 5,000 lines of Assembly, C, and Java code. We are proud that our final design solution exceeds several of our benchmarks including portability (< 2 lbs.), power (2 W), real-time detection (100 ms), and cost ($200). In our testing phases, we successfully proved that our negative pulse driver provides sufficient voltage and current for the QCL to emit light and that our user interface relays data to the user via a screen in real-time. We successfully showed that our system is capable of driving commercial infrared lasers and detecting short duty cycle pulses with our custom lock-inamplifier. While we did not succeed to demonstrating pulse detection with the QCD, we believe we have laid the groundwork for making this possible in a future revision. Team ChemSense was 23 honored to contribute to a project with important applications in national security and environmental protection. 24 REFERENCES [1] B. Mizaikoff. “Waveguide-enhanced mid-infrared chem/bio sensors”. Chem Soc Rev, pp. 8683-8699, RSC Publishing. May, 2013. [2] R. Soref. (2010, May 1). Mid-infrared photonics in silicon and germanium. [online]. Available: http://www.nature.com.ezproxy.lib.utexas.edu/nphoton/journal/ v4/n8/full/nphoton.2010.171.html [3] S. Chakravarty, “Proposal 7-4721”, unpublished. [4] Occupational Safety & Health Administration, OSHA Technical Manual (OTM) Section III: Chapter 6 (1999) [Online]. Available: https://www.osha.gov/dts/osta/otm/otm_iii/otm_iii_6.html [5] Department Of Defense Test Method Standard Environmental Engineering Considerations And Laboratory Tests, MIL-STD-810G (2008) [Online]. Available: http://www.atec.army.mil/publications/Mil-Std-810G/Mil-Std-810G.pdf [6] Department Of Defense Test Method Standard Electronic And Electrical Component Parts, MIL-STD-202G (2002) [Online]. Available: http://snebulos.mit.edu/projects/reference/MIL-STD/MIL-STD-202G.pdf [7] T. Koch, “Infrared Spectroscopy: Theory”. University of Colorado, Boulder, Chemistry and Biochemistry Department, 2003. [8] Y. Zou, H. Subbaraman, S. Chakravarty, X. Xu, A. Hosseini, W. Lai, R. Chen, "Integrated strip and slot waveguides in silicon-on-sapphire for Mid-Infrared VOC detection in Water" Proc. SPIE 8990, Silicon Photonics IX, 89900X (March 8, 2014). 25 APPENDIX A – LAB ON CHIP SENSOR A-1 APPENDIX A – LAB ON CHIP SENSOR ChemSense is designed around the operational characteristics of Dr. Chen’s lab-on-chip sensor. This means the initial framework for a successful design lies in understanding how the sensor emits light using its QCL, how it recollects the light using its QCD, and how changes in the channel in between correlate to a sensed chemical. For us, this translates to finding the correct models for the QCL’s drive characteristics, the QCD’s output characteristics, and for the channel in between. We find that the electrical properties of the sensor can be modeled as a resistive network due to reciprocity from the QCL and QCD. The channel can be modeled as an attenuator, based on the Beer-Lambert law. Finally, the operational characteristics of both the QCL and QCD can be found experimentally through benchmarking. The lab-on-chip sensor is composed of a QCL, germanium waveguide, and QCD monolithically integrated onto one chip. The sensor works by generating a potential across the QCL. This potential causes the QCL to emit light. The generated light then travels to the waveguide, which confines the light and forces it to travel in a localized region. When the light reaches the other side of the waveguide it is collected by the QCD, which generates a voltage based on the light it Figure A-1. Lab-on-chip sensor without waveguide Figure A-2. Graph of light confinement in slot waveguide collected. For visibility, this process is shown without the waveguide in Figure A-1. The light confinement characteristics of the waveguide are shown in Figure A-2. A-2 When thinking about how to operate the lab-on-chip sensor we need to model it electrically. One of the most important facts about this sensor is that the QCL and QCD are both made from the same bi-functional quantum cascade active region. Meaning when the region is given an external potential, it acts as a laser. When the region is zero biased, it acts as a detector. This bifunctionality means there is reciprocity between electron generating light and light generating electrons. Therefore, the QCL and QCD have no frequency component in their impedance characteristics. Given this knowledge we are able to model the QCL and QCD as a network of resistances, based on the model shown in Figure A-3, where both the QCL and QCD share a ground at the bottom of the substrate. The second model we need to make is the channel model, for the area between the QCL and QCD. Since the chip is designed to perform absorption spectroscopy, we create our channel model based on the Beer-Lambert law for absorption spectroscopy. In optics, the Beer-Lambert law relates light absorption to the chemicals in the lights path. This relationship is shown in the equation below, 𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 = 𝐼 1 = 10−𝛼𝛾ℓ → 𝐴𝑏𝑠𝑜𝑟𝑏𝑎𝑛𝑐𝑒 = 𝑙𝑜𝑔10 ( ) = −𝑎𝛾ℓ 𝐼𝑜 𝑇 Where 𝑇 is the transmission percentage, 𝑎 is the absorption coefficients of chemicals in the lights path, ℓ is the length of their interaction, and 𝛾 is the medium-specific absorption factor. This tells us how the light will be attenuated as it travels from the QCL to the QCD. Given this knowledge we model the channel as a variable attenuator where 𝑎 is the variable based on the chemical present between the QCL and QCD. This model is shown in Figure A-4 below. Figure A-3. Electrical model for lab-on-chip sensor Figure A-4. Channel model for lab-on-chip sensor A-3 Given these two models, we can look at the benchmark characteristics of the lab-on-chip sensor to determine our full operating range. The benchmark characteristics are shown in Figure A-5 below and were provided to us by Dr. Chen’s silicon photonics graduate group. The peak operating performance of the laser occurs at a frequency of 50 kilohertz, pulse width of 50 nanoseconds, with 15 volts and 3.7 amps across the laser. Given these conditions, the peak output power is approximately 150 milliwatts. The electrical and channel model for the chip, in conjunction with the chips benchmarks, provides the starting point for the laser controller and signal processor modules of ChemSense. The channel model sets the fundamental range for concentrations we are able to detect, for a given intensity from the QCL. The chips benchmarks tells us the maximum intensity that can be produced from the QCL as well as the maximum QCD output value. The electrical model shows us how to interface with the chip to produce light from the QCL and gather data from the QCD. It also tells us that the chip has no reactive component so maximum power transfer to the QCL can be achieved by resistance matching. Figure A-5. Benchmark characteristics of the lab-on-chip sensor A-4 APPENDIX B – ABSORPTION SPECTROSCOPY B-1 APPENDIX B – ABSORPTION SPECTROSCOPY Absorption spectroscopy measures the amount of radiation absorbed by a chemical as a function of radiation wavelength. When an electromagnetic wave impinges on a sample, the sample will absorb energy according to the following formula: 𝐸 = ℎ𝑣 = ℎ𝑐 𝜆 ℎ = 6.6𝑥10−34 𝑗𝑜𝑢𝑙𝑒𝑠 − 𝑠𝑒𝑐 (1) , A material's absorption spectrum is defined as the fraction of radiation absorbed by a material, normalized by the incident radiation, over a range of frequencies. Energy will be absorbed at a particular wavelength if the energy difference (from equation 1) matches the energy difference of the chemical’s two quantum mechanical states [7]. In optics, the Beer-Lambert law relates light absorption to the properties of the material the light is traveling through. The law states there is a logarithmic dependence between the transmission, T, of light through a substance and the product of the absorption coefficient of the substance, α, and the distance the light travels through the material, ℓ [8]. The absorption coefficient can be rewritten as a product of the species’ molar absorptivity ε and molar concentration c [8]. The Beer-Lambert law is summarized as follows: 𝐼 𝑇 = 𝐼 = 10−𝛼ℓ = 10−ℇℓ𝑐 (2) 𝑜 𝐼0 and 𝐼 are the intensity (power per unit area) of the incident light and transmitted light, respectively. Absorbance is measured from tranmittance using the following formula: 1 𝐴 = log10 (𝑇) , 𝑇 = % 𝑡𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 (3) Absorbance can be plotted as a function of frequency, wavelength, or wavenumber. B-2 APPENDIX C – LASER DRIVERS EXPLAINED C-1 B-3 APPENDIX C – LASER DRIVERS EXPLAINED The laser driver's components include a microcontroller (TM4C123) to provide a trigger pulse, a gate driver to provide the voltage and current to turn on the MOSFET, a MOSFET with fast switching capabilities, and dc power supplies to power the circuit. ChemSense's two laser drivers use a microcontroller to generate a pulse using timer functions. The pulse is digital logic (0 to 3.3 V) and can be configured for pulse widths as short as 20 ns. The pulse is fed to the input of a gate driver integrated circuit (IC). A gate driver is necessary to drive a capacitive load such as a MOSFET with enough current to quickly turn it on and off. The MOSFET is operated as a switch and if the gate-to- source VGS voltage is greater than the threshold voltage (typically 2 to 4 V), the MOSFET is no longer in cut-off region. Once the drain-to-source voltage VDS is greater than or equal to the saturation voltage VSAT = VGS-VTH, the MOSFET is in saturation. Both pulse generators are configured as a high-side circuit in which the MOSFET is closer to the power supply compared to the load (i.e. laser). The positive pulse generator uses a LTC4440-5 gate driver and an IRF510 MOSFET while the negative pulse generator uses the FOD3182 and an IRF510 MOSFET. Diagrams of both the positive and negative pulse laser driver can be seen in Figures C-1 and C-2. Figure C-1. Positive pulse driver. B-4 C-2 Figure C-2. Negative pulse driver. B-5 C-3 APPENDIX D – ANALOG FRONT END EXPLAINED B-6 D-1 APPENDIX D – ANALOG FRONT END EXPLAINED The analog-front end consists of a transimpedance amplifier (TIA) to convert the generated photocurrent to a voltage, a first-order low-pass filter, and a gain stage. All stages are single supply (3.3 V). Along with a feedback resistor, the TIA stage is calibrated to produce a maximum voltage at the supply rail corresponding to the peak current. A pad for capacitors is included to provide some stability. The TIA is followed by a RC filter with tunable with a potentiometer. The cutoff frequency is variable and can be adjusted according to the required pulse repetition frequency. After the pulse is broadened by the RC filter and gained by the amplifier, the signal is sent to the ADC to be digitized. A circuit diagram can bee seen in Figure D-1, below. Figure D-1. Analog front-end circuit. B-7 D-2 APPENDIX E – DIGITAL LOCK-IN AMPLIFIER EXPLAINED B-8 E-1 APPENDIX E – DIGITAL LOCK-IN AMPLIFIER EXPLAINED In order to accelerate the filter design and testing process, we added a number of debugging switches. Figure E-1 below are our filter debugging switches. These define statements can be changed from a 0 to a 1 to enable or disable parts of the system. Because this is embedded code, it was important to maintain consistent timing characteristics across different versions. Instead of removing the bandpass filter when BP_FILTER is set to 0, we instead made the bandpass filter transparent. This means that it takes the same amount of time, but produces no change in the data. Figure E-1. Filter Debugging Switches. Figure E-2 are our debugging switches. These define statements let us test different parts of the system independently. For example, if we wanted to test the system on simulated data instead of real data from the ADC, all we had to do was set REAL_SAMPLES to 0, then supply a test pattern. When testing the connections between the lock-in and the rest of the system, we often set REAL_TXMT to 0, so that we could send a test pattern instead of real output. Figure E-2. Debugging Switches. B-9 E-2 Figure E-3 below are our Load Statements. These statements initialize the registers for the Filter subroutine. Figure E-3. Load Statements. B-10 E-3 APPENDIX F – OVERALL SYSTEM I/O SPECIFICATIONS B-11 F-1 APPENDIX F – OVERALL SYSTEM I/O SPECIFICATIONS ChemSense will require three types of inputs (sensor, user, and power) and two types of outputs (sensor and data). Sensor inputs come from the local environment, user inputs are variables/settings that define how the user wants to operate ChemSense, and the power input will energize the device. Sensor outputs are used to operate the lab-on-chip sensor based on user specified inputs and data outputs inform the user about collected data on a detected chemical. Tables F1 and F2, below, detail the I/O operational and precision ranges for our design. Table F1. System Input Specifications. Input Description Input Type Operational Range Precision Lab-on-Chip Temperature Temperature of the labon-chip chemical sensor Sensor 20° to 150° C +/- 0.1° C QCD Frequency Pulse frequency the QCD is detecting in the lab-on-chip chemical sensor Sensor 5 kHz to 100 kHz +/- 1 Hz QCD Voltage Emission wavelength of the QCL in the lab-onchip chemical sensor Sensor 0 uV to 10 uV +/- .1 uV Set QCL Frequency User desired pulse frequency for the QCL in the lab-on-chip chemical sensor User λ: 9.5 um f: 5 kHz to 100 kHz λ: +/- 1 um f: +/- 1 kHz Set QCL Duty Width User desired duty width for the QCL in the labon-chip chemical sensor User 12.5 ns – 200 ns 12.5 ns Power Electrical power to run the system. Power -10 V to + 10V 10 mV B-12 F-2 Table F2. System Output Specifications. Name Description Type Range Precision QCL Voltage Output voltage from ChemSense used to drive the QCL Sensor 0 to 10 V +/- 0.1 V QCL Current Output current from ChemSense used to drive the QCL Sensor 0 A to 4 A +/- 0.1 A Pulse Generator Frequency Output pulse rate used to drive the QCL at the user set frequency. Sensor 5 kHz to 100 kHz +/- 1 Hz Screen Visual interface for the user. Data N/A N/A Graph Plots QCD Power / QCL Power versus time Data N/A N/A Concentration Quantifies concentration of a chemical based on user specified “set chemical” and sensor data Data 0% to 100% concentration 5% Threshold Alarm Signal unsafe conditions. (Only for pre-defined chemicals.) Data Yes / No N/A B-13 F-3 APPENDIX G – BILL OF MATERIALS G-1 B-14 APPENDIX G – BILL OF MATERIALS Qty 3 10 11 9 4 3 2 3 1 2 2 3 5 6 1 1 3 1 2 1 1 1 2 1 1 1 3 6 1 1 7 1 1 1 1 Value Parts Description 1X2-3.5MM J1, J2, J3 3.5mm Terminal block 0.01uF C3, C5, C8, C9, C18, C20, C26, C27, C34, C37 Capacitor, SMD 0603 0.1uF C4, C6, C10, C11, C14, C19, C24, C25, C36, C41, C42 Capacitor, SMD 0603 1.0uF C12, C13, C15, C28, C44, C45, C48, C49, C51 Capacitor, SMD 0603 10pF C1, C2, C16, C17 Capacitor, SMD 0603 1uF C7, C21, C50 Capacitor, SMD 0603 2.2uF C22, C23 Capacitor, SMD 0603 0.1uF C29, C30, C38 Capacitor, SMD 0805 1uF C31 Capacitor, SMD 0805 2.2uF C32, C40 Capacitor, SMD 0805 220uF 50V C33, C39 Electrolytic Capacitor 6.8uF C46, C47, C52 Tantalum Capacitor GREEN LED BLE_PWR, DSP_PWR, LCD_PWR, OPA_PWR, UI_PWR LED, SMD 0603 GREEN LED PF0, PF1, PF2, PF3, PF5, PF6 LED, SMD 0603 RED ALARM ALARM LED, SMD 0603 FOD3182 FOD1 Optocoupler 1N5819-B D1, D2, D4 Shottky Diode EVQ-11A04M RESET Momentary Push Button TM4C123GH6PMI U1, U3 Microcontroller LTC4440-5 U$1 Gate Driver NRF8001 Y3 BTLE Module SPEAKER/PS12 SP1 Piezo Speaker 100 R15, R20 Resistor, SMD 0603 1000 R25 Resistor, SMD 0603 10K R7 Resistor, SMD 0603 10k R12 Resistor, SMD 0603 1M R1, R3, R21 Resistor, SMD 0603 220 R2, R8, R17, R18, R19, R22 Resistor, SMD 0603 2K R14 Resistor, SMD 0603 470 R13 Resistor, SMD 0603 560 R4, R5, R6, R9, R10, R11, R27 Resistor, SMD 0603 RA8875 RA8875 LCD Controller 10k R26 Trimm resistor 1K R23 Trimm resistor 500 R24 Trimm resistor Price $0.30 $0.03 $0.03 $0.03 $0.03 $0.03 $0.15 $0.03 $0.07 $0.17 $0.25 $0.67 $0.13 $0.13 $0.13 $2.25 $0.18 $0.17 $8.35 $2.12 $19.95 $1.50 $0.03 $0.03 $0.03 $0.03 $0.03 $0.03 $0.03 $0.03 $0.03 $34.95 $0.33 $0.33 $0.33 Ext Price $0.90 $0.30 $0.33 $0.27 $0.12 $0.09 $0.30 $0.09 $0.07 $0.34 $0.50 $2.01 $0.65 $0.78 $0.13 $2.25 $0.54 $0.17 $16.70 $2.12 $19.95 $1.50 $0.06 $0.03 $0.03 $0.03 $0.09 $0.18 $0.03 $0.03 $0.21 $34.95 $0.33 $0.33 $0.33 G-2 B-15 8 1 1 3 2 2 1 1 1 MUN5211T1G LTC6828 OPA320 TPS73633MDBVREP IRF510 NX5032GA LCD BUCK BATTERY U$5, U$6, U5, U6, U7, U8, U9, U10 LTC6268 OPA U2, U4, U11 Q2, Q3 Y1, Y2 LCD BUCK BATTERY Logic Level Transistor Op-Amp Op-Amp 3.3V LDO N-Channel Mosfet 16MHz Crystal 5.0" TFT Touchscreen Buck Converter 6600mAh 8.4V Li-Ion Total $0.11 $6.21 $2.30 $2.15 $0.96 $0.63 $39.95 $1.85 $35.00 $185.26 $0.88 $6.21 $2.30 $6.45 $1.92 $1.26 $39.95 $1.85 $35.00 B-16 G-3 APPENDIX H – APPLICABLE STANDARDS B-17 H-1 APPENDIX H – APPLICABLE STANDARDS Because ChemSense’s purpose is to detect hazardous chemicals using lasers, potentially in military applications, we believe several standards will affect our project’s specifications. The Occupational Safety and Health Administration (OSHA) and the American National Standards Institute (ANSI) provide detailed standards for operation, classification, and labeling of laser devices, as well as the handling of hazardous chemicals, while the Department of Defense (DOD) provides MIL-SPEC, MIL-PRF, and MIL-STD equipment design standards. It should be noted that, “An American National [ANSI] Standard implies a consensus of those substantially concerned with its scope and provisions. These standards are intended as a guide to aid the manufacturer, the consumer and the general public. There is, however, no inherent requirement for anyone or any company to adhere to an ANSI standard. Compliance is voluntary unless specifically required by some alliance” [6, Appendix III: 6-3]. Although ANSI standards may not be compulsory, DOD (MIL-SPEC, MIL-PRF, and MIL-STD) standards will apply to our device if our end user is a military entity. The ANSI Z 136 Laser Safety Standards series is a DOD accepted standard, which covers the safe use of lasers in a variety of settings, as well as the testing and labeling of laser devices. As the ANSI standards are not freely available, we referred to the OSHA standards covering categories relevant to ChemSense. Regarding classification of laser devices, Section IV.B.1 of the OSHA Online Technical Manual (OTM) states “Virtually all of the U.S. domestic as well as all international standards divide lasers into four major hazard categories called the laser hazard classifications. The classes are based upon a scheme of graded risk. They are based upon the ability of a beam to cause biological damage to the eye or skin” [4]. Even though the laser we will use in our project will not be powerful enough to pose any serious risk to users, appropriately classifying and labeling that risk will be part of our responsibility. From a design standpoint, OSHA OTM Section VI.J.1 specifies: “A laser shall have an enclosure around it that limits access to the laser beam or radiation at or below the applicable MPE level. A protective housing is required for all classes of lasers except, of course, at the beam aperture” [4]. As such, a protective enclosure should be a requirement for our device. Lastly, OSHA provides guidelines on protective eyewear and clothing we will wear while operating lasers. B-18 H-2 DOD standards that may apply to our project cover the testing and operational durability of our device. One DOD standard will need to consider is MIL-STD-810 [5], which specifies how to design and test equipment for the conditions it may experience during use. Such considerations include exposure to extreme temperatures, shock, vibration, sand and dust, rain, and a variety of other environmental concerns. Another DOD standard we may need to consider is MIL-STD202, which “establishes uniform methods for testing electronic and electrical component parts, including basic environmental tests to determine resistance to deleterious effects of natural elements and conditions surrounding military operations, and physical and electrical tests” [6]. Our project will need to evaluate the applicability of the requirements in these standards. B-19 H-3
© Copyright 2026 Paperzz