Difference between revisions of "Team:Queens Canada/Luminometer Software"

 
(14 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
body {
 
body {
 
     background-color: white;
 
     background-color: white;
    max-width: 1200px;
 
 
     position: relative;
 
     position: relative;
 
     margin-left: auto;
 
     margin-left: auto;
Line 15: Line 14:
 
<body>
 
<body>
  
<h2>Luminometer Software</h2>
+
<h2 style="width:1200px;margin-left:12%">Luminometer Software</h2>
<h3>Electrical Design</h3>
+
<h3 style="width:1200px;margin-left:12%">Electrical Design</h3>
<p>The light to frequency sensor used as a luminometer was attached to a digital input on the microcontroller. When  
+
<p style="width:1200px;margin-left:12%;font-size:18pt">The light to frequency sensor used as a luminometer was attached to a digital input on the microcontroller. When  
 
the sensor detects a photon, it sends a pulse of high voltage to the digital input which is then detected by the  
 
the sensor detects a photon, it sends a pulse of high voltage to the digital input which is then detected by the  
 
controller. To properly count each photon, an interrupt was attached to this digital input in the software, such that  
 
controller. To properly count each photon, an interrupt was attached to this digital input in the software, such that  
Line 23: Line 22:
 
count was increased. By allowing the program to run for a set amount of time, a rate can be calculated for the number  
 
count was increased. By allowing the program to run for a set amount of time, a rate can be calculated for the number  
 
of photons per second. By increasing the length of this sampling period, lower levels of light can be more accurately  
 
of photons per second. By increasing the length of this sampling period, lower levels of light can be more accurately  
measured and compared.</p>
+
measured and compared.  
  
<h3>Breathing Rate</h3>
+
To transmit the data wirelessly, we have begun to develop an application for BLE transmission of luminometer data from within the pacifier to a smart phone device. Our code for BLE transmission can be found below. Additionally, apps avialable on the itunes appstore already exist and were used for wireless transmission of data. See the screenshot of wireless Luminometer data transmission below:</p>
<p>To measure breathing rate, multiple readings are taken of the NTC thermistor’s resistivity over a set period of
+
time. As the child breathes out, warmer air comes in contact with the thermistor, which is then followed by colder
+
air as the child breathes in. These changes in temperature are reflected in the changes in resistivity of the  
+
thermistor, the maximums and minimums of these changes over time can be counted to calculate a rate.</p>
+
<p>The code written to calculate this rate first takes a reading of the thermistor’s resistivity once every second
+
for 100 seconds and stores the values in an array. This data can be plotted against time to create a sinusoidal wave
+
as shown below. However, to count the peaks corresponding to each individual breath, the data must be preprocessed to
+
remove outlying maximums and minimums.</p>
+
<img src="https://static.igem.org/mediawiki/2018/f/f5/T--Queens_Canada--RawThermistorData.png" alt='Raw Thermistor Data'/>
+
<p>This is done using an exponential filter, which is a type of low pass filter used to remove high frequency noise.
+
It is also an autoregression filter, which means that it relies on past output and input, so that over time it relies
+
more heavily on past values and is able to detect patterns such as a steady breathing rate. The filtered data can be
+
plotted to produce the sinusoidal wave shown below.</p>
+
<img src="https://static.igem.org/mediawiki/2018/7/7f/T--Queens_Canada--FilteredThermistorData.png" alt='Filtered Thermistor Data'/>
+
<p>The cleaned data can then be analyzed to detect peaks. This is done by comparing each value to the previous value
+
and the value following it. If the current value is larger than both, it must be a maximum and the number of peaks is
+
increased. The total number of peaks, corresponding to the total number of breathes, is then divided by 100 seconds
+
to determine a rate of breathes per second.</p>
+
  
 +
<div style="margin-left:12%">
 +
<img style="max-height:600px" src="https://static.igem.org/mediawiki/2018/7/75/T--Queens_Canada--Wirless_Transmission.jpeg" alt='wirelessLum'/>
 +
</div><br>
 +
 +
 +
 +
<p style="width:1200px;margin-left:12%;font-size:18pt">Check out our arduino file that outputs the portable luminometer's readings <a href="https://static.igem.org/mediawiki/2018/7/77/T--Queens_Canada--PhotonCounter_RFduino.txt">here.</a>
 +
<br>
 +
Check out our app for transmitting luminometer data wirelessly <a href="https://static.igem.org/mediawiki/2018/b/b3/T--Queens_Canada--BLEService.txt">here.</a></p><br>
 +
 +
 +
 +
<footer style="background-color: #212121;height:90px ">
 +
            <div class="container">
 +
                <div class="row">
 +
                    <div class="col-md-4">
 +
                        <ul class="list-inline quicklinks">
 +
                            <li><a href="https://igem.org/Main_Page" style="color:white; font-size:16pt">iGEM Headquarters</a>
 +
                            </li>
 +
                        </ul>
 +
                    </div>
 +
                    <div class="col-md-4">
 +
                        <ul class="list-inline social-buttons" style="margin-left:20%">
 +
                            <li><a href="https://twitter.com/iGEMQueens"style="    display: block;
 +
    background-color: #fff;
 +
    height: 40px;
 +
    width: 40px;
 +
    border-radius: 100%;
 +
    font-size: 20px;
 +
    line-height: 40px;
 +
    color: #000;
 +
    outline: 0;
 +
    -webkit-transition: all .3s;
 +
    -moz-transition: all .3s;
 +
    transition: all .3;"><i class="fa fa-twitter"style="color:black; font-family:FontAwesome;margin-left:10.75px;"></i></a>
 +
                            </li>
 +
                            <li><a href="https://www.facebook.com/iGEMQueens/?fref=ts"style="    display: block;
 +
    background-color: #fff;
 +
    height: 40px;
 +
    width: 40px;
 +
    border-radius: 100%;
 +
    font-size: 20px;
 +
    line-height: 40px;
 +
    color: #000;
 +
    outline: 0;
 +
    -webkit-transition: all .3s;
 +
    -moz-transition: all .3s;
 +
    transition: all .3;"><i class="fa fa-facebook"style="color:black;font-family:FontAwesome;margin-left:10.75px;"></i></a>
 +
                            </li>
 +
                            <li><a href="mailto:director@qgemteam.com" style="    display: block;
 +
    background-color: #fff;
 +
    height: 40px;
 +
    width: 40px;
 +
    border-radius: 100%;
 +
    font-size: 20px;
 +
    line-height: 40px;
 +
    color: #000;
 +
    outline: 0;
 +
    -webkit-transition: all .3s;
 +
    -moz-transition: all .3s;
 +
    transition: all .3;"><i class="fa fa-envelope"style="color:black;font-family:FontAwesome;margin-left:10.75px;"></i></a>
 +
                            </li>
 +
                            <li><a href="https://www.linkedin.com/company/1633448?trk=tyah&amp;trkInfo=clickedVertical%3Acompany%2CclickedEntityId%3A1633448%2Cidx%3A1-1-1%2CtarId%3A1464110668532%2Ctas%3Aqgem" style="    display: block;
 +
    background-color: #fff;
 +
    height: 40px;
 +
    width: 40px;
 +
    border-radius: 100%;
 +
    font-size: 20px;
 +
    line-height: 40px;
 +
    color: #000;
 +
    outline: 0;
 +
    -webkit-transition: all .3s;
 +
    -moz-transition: all .3s;
 +
    transition: all .3;"><i class="fa fa-linkedin"style="color:black; font-family:FontAwesome;margin-left:10.75px;"></i></a>
 +
                            </li>
 +
                        </ul>
 +
                    </div>
 +
                    <div class="col-md-4">
 +
                        <ul class="list-inline quicklinks" style="color: white;font-size:16pt;">
 +
                            <li><a href="http://www.queensu.ca/" style="color:white;margin-left:100px;">Queen's University</a>
 +
                            </li>
 +
                        </ul>
 +
                    </div>
 +
                </div>
 +
            </div>
 +
        </footer>
 
</body>
 
</body>
 
</html>
 
</html>

Latest revision as of 00:23, 16 October 2018

Luminometer Software

Electrical Design

The light to frequency sensor used as a luminometer was attached to a digital input on the microcontroller. When the sensor detects a photon, it sends a pulse of high voltage to the digital input which is then detected by the controller. To properly count each photon, an interrupt was attached to this digital input in the software, such that any time the controller received a pulse of high voltage, the rest of the program was interrupted, and the photon count was increased. By allowing the program to run for a set amount of time, a rate can be calculated for the number of photons per second. By increasing the length of this sampling period, lower levels of light can be more accurately measured and compared. To transmit the data wirelessly, we have begun to develop an application for BLE transmission of luminometer data from within the pacifier to a smart phone device. Our code for BLE transmission can be found below. Additionally, apps avialable on the itunes appstore already exist and were used for wireless transmission of data. See the screenshot of wireless Luminometer data transmission below:

wirelessLum

Check out our arduino file that outputs the portable luminometer's readings here.
Check out our app for transmitting luminometer data wirelessly here.