Difference between revisions of "Team:Sheffield/Software"

Line 198: Line 198:
 
               <p align="center">ThingSpeak is a mathworks product, allowing ease of transfer of the data to Matlab. After completing this stage, the results can be smoothed to remove noise and then used to identify growth within the wells. Below is a screenshot of the thingspeak homepage.</p>  
 
               <p align="center">ThingSpeak is a mathworks product, allowing ease of transfer of the data to Matlab. After completing this stage, the results can be smoothed to remove noise and then used to identify growth within the wells. Below is a screenshot of the thingspeak homepage.</p>  
  
               <img style="width:750px;" src="https://static.igem.org/mediawiki/2017/4/4c/T--Sheffield--thingspeakScreenshot.png" class="img-responsive center" style="display:inline"></p>     
+
               <img style="width:750px;" src="https://static.igem.org/mediawiki/2017/b/b2/T--sheffield--Figure3Software.png" class="img-responsive center" style="display:inline"></p>     
  
 
               <h4 align="center">Figure 3: The above picture is a screenshot of the thingspeak homepage. This server can be found at: www.thingspeak.com</h4>  
 
               <h4 align="center">Figure 3: The above picture is a screenshot of the thingspeak homepage. This server can be found at: www.thingspeak.com</h4>  

Revision as of 00:33, 2 November 2017





Software



Data Collection

Signal types:

Electronic sensing circuits typically contain two types of signals, analogue and digital. Digital signals are discrete signals that can be in one of two states, high or low, 1 or 0, on or off. If the signal is 'high' it will have a set voltage greater than the off state, for our purposes the high voltage is 3.3v and the low voltage is 0v or ground. When we process this signal we just need to be able to categorise the signal into these two approximate categories. The actual voltage is not particularly important.

Analogue signals are continuous signals that are able to take on any value with a range (for our purposes that range is between 0 and 3.3v). When these signals are processed we categorise them into 1 of 1024 boxes.

We use a potential divider in order to assess the amount of light hitting the diode. This is done by connecting a digital 3.3v signal to one side of a photodiode in reverse bias with a 10K ohm resistor in series and then grounding the other side (digital low state). We then read the voltage across the resistor as the diode will take a proportion of the voltage dependent on the light hitting it and then the rest is put across the resistor. This analogue signal can then be processed by our microcontroller and give us data on how much light has been scattered by the sample.

Multiplexing:

Multiplexing is a networking technique that allows a single communication channel to be used instead of multiple communication channels. This means instead of wiring every individual diode to microcontroller we can reduce the number of wires required dramatically by soldering them together into a grid. We then read data from each diode (much in the same way as the LED array below) column by column and then row by row.

Figure 1: A diagram showing how multiplexing works across the array


Below is a full circuit diagram of the sensor and multiplexing set-up:

Figure 2: A circuit diagram showing how the photodiode array are connected in circuit with the multiplexers.


This is done using a separate analog and digital circuit. The digital circuit flicks through

Smoothing:

Once the data had been retrieved from ThingSpeak and the results produced using Matlab (fig.1 - noisy data), we considered the application of a mathematical filter to remove the noise. This resulted in the use of a sliding average filter to act as a basic low pass filter. It used 10 data points in each set to remove the smaller fluctuations (fig.2 - smoother, calibrated data). However, major bursts are not counteracted by this effect due to having a large influence on the data set.

ThingSpeak - Cloud Integration

Using a nodeMCU board further developed our device to send data in real time to the ThingSpeak server by WiFi. This is a community database that allows anyone with a login to see public data but will allow only the user to edit their personal data. As the photodiodes produced the data from the growth in the wells, the board sent the data to the server (fig.1 - data being uploaded to thingspeak), producing data points every 15 seconds. This loses less information between readings. However, the frequency of data readings can be adjusted to the requirements of the users.

Producing data and storing it in this manner enables the user to leave an experiment to run overnight, and be able to check the results in the morning with no data points missing. Typically when using a plate reader, the person conducting the experiment has to manually remove the well plate after each reading and place it back in the incubator. However, with the integration of the node board, our plate reader can sit in the incubator and deliver readings automatically. An alternative, when the incubator has no access to WiFi, is to use an Arduino for data storage and retrieve it the following morning. Both methods introduce the capability to allow measurements to be taken without anyone required in the lab out of hours.

ThingSpeak is a mathworks product, allowing ease of transfer of the data to Matlab. After completing this stage, the results can be smoothed to remove noise and then used to identify growth within the wells. Below is a screenshot of the thingspeak homepage.

Figure 3: The above picture is a screenshot of the thingspeak homepage. This server can be found at: www.thingspeak.com


Privacy

Patient Confidentiality:

After speaking to hospital labs about the application of our device to rapid detection of AMR, they raised the issue of patient confidentiality when sending critical patient data to the cloud. We then spoke to various members of research ethics staff at the university and decided that the best course of action was to design our own encryption software based on discrete mathematical models to ensure all data sent to the cloud did not compromise patient care. They also advised on best practices such as assigning patients anonymous identifier and then not sending information linking identifiers to their actual name through the same medium.

Cellular Automata:

The software uses a discrete mathematical model (based on cellular automata) similar to conway's game of life to generate a string of pseudo random numbers. It uses a JPEG image as an input, then performs image processing to convert it to a binary array and then performs the encryption algorithms on this data.This is then applied to data like a shift cypher and sent to the server. To decrypt the data the shift cypher is removed and the original data is obtained.

Figure 4: The above screenshot shows the encoding software that can be used to encode confidential paitent information.