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 had been processed, they were categorised into 1 of 1024 boxes.
A potential divider is used 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). The voltage across the resistor is then read 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 the 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, the number of wires required decreases dramatically by soldering them together into a grid. The data is then read 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, the application of a mathematical filter was considered 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. However, major spikes in the data 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 the 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, producing data points every 15 seconds. This allows less loss in 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 (figure 3) 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.
Figure 3: The above picture is the ThingSpeak homepage. This server can be found at: www.thingspeak.com
Privacy
Patient Confidentiality:
After speaking to hospital labs about the application of the device to rapid detection of AMR, the issue of patient confidentiality was raised, when sending critical patient data to the cloud. Various members of research ethics staff at the university aided in the decision 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.