Who Are We
My name is Orlando Hoilett and I am a PhD student in Biomedical Engineering at Purdue University. This team is composed of myself and my friend Raj Patel, a senior Biomedical Engineering student at Purdue University. We are interested in this problem because it provides us an opportunity to put our engineering skills to the test in solving a real-world problem. Here, we propose our idea for a multi-sensor system to analyze various parameters of Lake Erie. The sensors will consist of a water temperature, nitrogen, humidity, temperature, pH, spectrophotometer, color, conductivity, phosphorus and turbidity sensor. We will demonstrate our different sensor capabilities. We propose that these sensors can be placed on a platform such as an aerial or aquatic drone to monitor Lake Erie and other relevant bodies of water for algal growth.
IOT and GPS
IOT is changing the way information can be used. With the LinkIt One, we are able send sensor data to a server where it can be interpreted. Normal Arduino boards cannot solely do the vigorous computations and store the data. IOT would allow the tracking of trends via algorithms. The LinkIt One board module will be used to track location of each sample taken. The GPS module is critical because without it the data on the sensors would not specific to a certain region. Shown here is the output of our Adafruit GPS module when sitting outside Neil Armstrong Hall of Engineering at Purdue University. Google Maps data confirms the GPS module data. We used Adafruit's "Direct Connect" code example to collect this data. Please follow their tutorial here. As of now, we are proving the concept of our sensors in the following sections. The IOT and GPS portion will be further developed in phase 2.
Water Temperature
Water temperature is a vital parameter in enhancing algae growth. We have sourced a low cost digital water thermometer for this purpose. Toxic algae like blue-green algae grows in warmer water [1]. The warm water creates conditions which cause the algae to clump causing faster growth [1]. The algae blooms will create a positive feedback loop due to algae absorbing more sunlight causing to water to get warmer. The solution to this is measure and monitor the temperature at regions of Lake Erie with a waterproof DS18B20 digital temperature sensor. DS18B20 can detect temperatures in a range of -55 to 125°C with an accuracy of ±.5°C. This DS18B20 and a GPS module can track temperature data based on location. With that data notifications can be sent for regions at risk for algae blooms.
Circuit Hookup:
Code
Below is sample code provided by Konstantin Dimitrov. You can find links to the DallasTemperature.h and OneWire.h files on Konstantin's page.
#include <OneWire.h>
#include <DallasTemperature.h>
/********************************************************************/
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
/********************************************************************/
// Setup a oneWire instance to communicate with any OneWire devices
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
/********************************************************************/
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
/********************************************************************/
void setup(void)
{
// start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
/********************************************************************/
sensors.requestTemperatures(); // Send the command to get temperature readings
/********************************************************************/
Serial.println(sensors.getTempCByIndex(0)); // Why "byIndex"?
// You can have more than one DS18B20 on the same bus.
// 0 refers to the first IC on the wire
delay(1000);
}
Testing:
The sensor was tested by placing it from room temperature to a colder environment and then back to room temperature. The data is displayed in the graph below. The graph shows at a decrease in temperature when the DS18B20 is placed at a colder temperature and then increases back to room temperature showing the temperature works and is calibrated.
Nitrogen Sensor
Nitrogen is reported to support the production of algal blooms [2]. We found a low cost gas sensor (MQ-135) that’s able to detect nitrogen oxide. MikroElektronika sells a very convenient breakout board for the sensor which makes connecting the gas sensor to a microcontroller seamless. We were able to demonstrate gathering data from the sensor. Unfortunately, the calibration step was a bit more difficult due to the lack available standard calibrations for nitrogen gas available to us and also the lack of specificity of the sensor. Instead, we calibrated the sensor in standard air and also in air with "wafted" 30% isopropyl alcohol. Our data shows that the sensor responded to the change in air composition with the addition of the rubbing alcohol vapor. We propose that with further funding, we will be able to better calibrate the sensor and create calibration standards for use in the field for determining nitrogen gas content around Lake Erie.
The breakout board from MikroElektronika has standard connections. GND was connected to the GND of the Arduino, 5V to 5V, and OUT was connected to Analog input 0. Then we implemented a straightforward code to read the voltage output of the sensor.
void setup() {
Serial.begin(9600);
while(!Serial);
}
void loop()
{
double x = analogRead(A0);
double volts = (x/1023.0)*5.0;
Serial.println(volts);
delay(1000);
}
Air Temperature and Humidity
Temperature and humidity are important metrics for environmental health. We utilized the DHT22, a common air temperature and humidity sensor, to demonstrate our capabilities. The DHT22 was tested using code provided by Adafruit Industries. Please visit their GitHub repository for the DHT22 sensor. You will also need to download their Sensors.h file. Our data compares the results from the DHT22 sensor with a low-cost indoor air humidity monitor.
Hookup instructions for the DHT22 sensor. (From left to right) pin 1 is Vcc and should be connected to 5V. Pin is 2 is data and should be connected to 5V through a 10k pull-up resistor. Then connect Pin 2 to Digital Pin 10 on the Arduino. Pin 3 of the DHT22 sensor is unused, leave it floating. Finally, connect pin 4 to ground.
Circuit Hookup:
Testing:
We tested the output of the DHT22 sensor alongside an Acurite indoor home temperature and humidity monitor. Results indicate that we have reasonable agreement between the two sensors. Further calibration and tuning can improve the accuracy of our system.
pH Sensor
pH is a known indicator of water quality. Algal growth is optimal around pH 6-9 which makes pH sensing important for assessing algal blooms [3]. As a proof of concept, we utilized the pH sensor from DFRobot which is well-suited for prototyping purposes. The pH sensor was wired according to the schematic below.
Circuit Hookup:
We used example code provided by DFRobot. To demonstrate the activity of the pH sensor, we placed the pH sensor in vinegar which is reported to have a pH of about 2.3 [4], milk which has a pH of 6.6 [5], and baking soda which has a pH of 8.3 [5]. Our results indicate that our sensor was successful in measuring the pH of these solutions.
/*
# This sample code is used to test the pH meter V1.0.
# Editor : YouYou
# Ver : 1.0
# Product: analog pH meter
# SKU : SEN0161
*/
#define SensorPin A0 //pH meter Analog output to Arduino Analog Input 0
#define Offset 0.00 //deviation compensate
#define LED 13
#define samplingInterval 20
#define printInterval 800
#define ArrayLenth 40 //times of collection
int pHArray[ArrayLenth]; //Store the average value of the sensor feedback
int pHArrayIndex=0;
void setup(void)
{
pinMode(LED,OUTPUT);
Serial.begin(9600);
Serial.println("pH meter experiment!"); //Test the serial monitor
}
void loop(void)
{
static unsigned long samplingTime = millis();
static unsigned long printTime = millis();
static float pHValue,voltage;
if(millis()-samplingTime > samplingInterval)
{
pHArray[pHArrayIndex++]=analogRead(SensorPin);
if(pHArrayIndex==ArrayLenth)pHArrayIndex=0;
voltage = avergearray(pHArray, ArrayLenth)*5.0/1024;
pHValue = 3.5*voltage+Offset;
samplingTime=millis();
}
if(millis() - printTime > printInterval) //Every 800 milliseconds, print a numerical, convert the state of the LED indicator
{
Serial.print("Voltage:");
Serial.print(voltage,2);
Serial.print(" pH value: ");
Serial.println(pHValue,2);
digitalWrite(LED,digitalRead(LED)^1);
printTime=millis();
}
}
double avergearray(int* arr, int number){
int i;
int max,min;
double avg;
long amount=0;
if(number<=0){
Serial.println("Error number for the array to avraging!/n");
return 0;
}
if(number<5){ //less than 5, calculated directly statistics
for(i=0;i<number;i++){
amount+=arr[i];
}
avg = amount/number;
return avg;
}else{
if(arr[0]<arr[1]){
min = arr[0];max=arr[1];
}
else{
min=arr[1];max=arr[0];
}
for(i=2;i<number;i++){
if(arr[i]<min){
amount+=min; //arr<min
min=arr[i];
}else {
if(arr[i]>max){
amount+=max; //arr>max
max=arr[i];
}else{
amount+=arr[i]; //min<=arr<=max
}
}//if
}//for
avg = (double)amount/(number-2);
}//if
return avg;
}
Spectrophotometer
A spectrophotometer allows us to have more quantitative analysis of water samples [6]. A spectrophotometer is a very useful lab instrument that allows us to measure the amount of light that is absorbed by a given sample. By analyzing the sample at different wavelengths of light, we can determine the concentration of different amounts of analytes in the samples. This could be oxygen content, carbon dioxide or other nutrients. Spectrophotometers range from a few hundred dollars to a few tens of thousands. Luckily, a spectrophotometer can be easily approximated using a light source and a light sensor. We have chosen to use a simple RGB LED and a PD333-3C/H0/L2 to demonstrate how we would utilize the spectrophotometer to analyzing samples from Lake Erie.
For our concept, we used measured the amount red and green light absorbed by different concentrations of blue and red food coloring, respectively. We positioned our photodiode directly across from our light source. The sample was placed in between the photodiode and light source. The absorbance of each solution was plotted against "normalized" concentration. If we now had an "unknown" sample and measured its absorbance, we could calculate its concentration using the data we collected. Again, this could be of different analytes including gases and nutrients, etc. making spectrophotometry a really useful technique in assessing water quality.
We developed a simple Arduino code to control the output of the RGB LED to switch between red, green, and blue. We also created a simple photodiode preamplifier signal to process the signal coming from the photodiode. Our simple spectrophotometer can be scaled up to analyze samples at many different colors by using different colored LEDs, or even using a white LED and breaking up the spectra with a diffraction grating similarly as others have done.
/*
FILENAME: monochromater.ino
AUTHOR: Orlando S. Hoilett
DATE: Sunday, September 7, 2014
UPDATES:
Version 0.0.0
09/07/2014:1930>
Reads value from detector circuit using one of the
analog in pins on the Arduino.
09/08/2014:1253>
Added redON(), greenON(), and blueON() functions to
easily select the wavelength of light we want the
RGB LED to emit.
DESCRIPTION
This program reads voltages from a photodetector circuit for a
simple monochromator. This example was created as a demonstration
of pulse oximetry for first-year engineering students at
Vanderbilt University.
*/
//declare variables
const int sensorPin = A0; //Analog In Pin 0
int ADCvalue = 0;
double sensorVoltage = 0;
//define pin locations
int redPin = 3; //digitalPin 3
int greenPin = 4; //digitalPin 4
int bluePin = 5; //digitalPin 5
//initialize helper methods
double convertToVoltage(int ADCvalue);
void initializeLEDPins(int redPin, int greenPin, int bluePin);
void redON();
void greenON();
void blueON();
void setup()
{
//begin communication with Arduino and computer
Serial.begin(9600);
initializeLEDPins(redPin, greenPin, bluePin);
//you should write the function to turn on the correct color
//here please remember to type the semicolon ";" at the end of
//the function like you see with all the other commands I have
//written
redON();
//did you add the semicolon ";" at the end?
}
void loop()
{
//reads value from sensor using Arduino
ADCvalue = analogRead(sensorPin);
//convert ADC value to a voltage using the conversion
//(ADCvalue / 1023) * 5
sensorVoltage = convertToVoltage(ADCvalue);
//print the value to the "COM" port
Serial.println(sensorVoltage);
//wait for a bit to print the data
//this makes it easier to read in the "COM" port
delay(350);
}
double convertToVoltage(int ADCvalue)
{
return (ADCvalue / 1023.0) * 5.0;
}
void initializeLEDPins(int redPin, int greenPin, int bluePin)
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void redON ()
{
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
digitalWrite(bluePin, HIGH);
}
void greenON ()
{
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, HIGH);
}
void blueON ()
{
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, HIGH);
digitalWrite(bluePin, LOW);
}
Circuit Hookup:
Color and Light Sensor
We thought that color would be a really simple qualitative test to assess algal growth at different locations around Lake Eerie. For this test, we utilized Adafruit’s TCS34725 RGB Color Sensor Breakout. The TCS34725 is a convenient sensor that allows us to measure the red-green-blue (RGB) values of a nearby object. We envision that the sensor could be mounted on a drone or boat and scan the RGB values of different areas of the lake. The breakout contains a neutral LED that shines a light on an object. The reflected light hits the TCS34725 and the TCS34725 is able to calculate the RGB values of the nearby object. We placed a red, green, and blue object in front of the sensor and observed the sensors output. It appears that the sensor output agrees with the dominant color of the object.
Additionally, sunlight is reported to affect algal blooms as well. The color sensor breakout also has the ability to measure luminous intensity which can be used to measure how much light the algal blooms are getting [8].
Circuit Hookup:
A Few Future Directions
Turbidity
Turbidity is the quantitative method for measuring how clear a liquid is. Turbidity can affect the conditions that algae grows. Low turbidity can be caused by water moving slowing. That leads to clearer water which is easier for light to penetrate creating better conditions for algae to grow [7].
The calculation of turbidity will be calculated with a turbidometer. The boat will have a device that will pick up a water sample from Lake Erie. Then a sample of light will be running through the sample where it would reach a light to frequency converter to measure the absorbance. Then with Bear’s law the concentration of particles can be calculated.
Conductivity Sensor
Salinity is the concentration of dissolved salts in a liquid. Salinity can affect the conditions that algae is grown in. Varying algae types need different conditions to thrive. Blue-green algae is the harmful algae in Lake Erie and needs lower salinity to grow. Blue-green algae is common in many bodies of water, and in 1999 Australia had an issue with blue-green algae. Their solution was to add salinity sensors. If levels fell below 2 ms/cm, it providing an early warning system. Our solution is to add a conductivity sensor which can convert the data to salinity. This along with the IOT system would give early warning detection to prevent algae outbreaks from happening.
Phosphorus sensor
In addition to nitrogen, phosphorus levels increase dramatically with algal blooms [8]. We have identified a source for a low cost phosphorus sensor that can be implemented with our solution [9].
Conclusions
Thank you for considering our project. We have demonstrated the various sensor capabilities that we have and have also provided paths for scaling up our design.
We have demonstrated the use of various sensors for measuring important parameters in monitoring algal blooms. These sensors can easily be mounted on boat or on a drone for real-time analysis of Lake Erie.
Citations
[1] https://www.epa.gov/nutrientpollution/climate-change-and-harmful-algal-blooms
[2] http://www.ecy.wa.gov/programs/eap/Nitrogen/Effects.html
[3] http://www.ecy.wa.gov/programs/wq/plants/algae/publichealth/GeneralCyanobacteria.html
[4] http://www.adbio.com/science/analysis/ph_scale.htm
[5] https://www.thoughtco.com/ph-of-common-chemicals-603666
[6] https://www.hunterlab.com/blog/color-measurement-2/measuring-water-quality-with-spectrophotometry-the-best-approach-for-identifying-the-unknown/
[7] https://www.cees.iupui.edu/research/algal-toxicology/bloomfactors
[8] https://www.epa.gov/nutrientpollution/harmful-algal-blooms
[9] http://www.benmeadows.com/hanna-checker-hc-handheld-colorimeter-reagents_37336090/?searchterm=phosphorus
Comments