Tuesday:
Today is going to be a lab day. We are focusing on learning more about exactly how the Arduino functions. The morning is dedicated to reading chapters 4 & 5 of the Arduino Cookbook so that we can start figuring out how the I/O interface works on the Arduino UNO. Sending and receiving multiple fields was the first major hurdle we dealt with today. While we were working on that our group was given a pH probe with the power charger and instruction book. Joe and Lori took point reading about that new equipment. There were no instructions for connecting the probe with an Arduino but we will search online to see if the necessary code already exists before reinventing the wheel. After lunch we came back and had a brainstorming session about the lesson plan we intend to create. One key feature is a scale model of the artificial river system that we can build within the constraints of budget and free space in a classroom. Joe sourced the parts online and submitted the request for approval.Parts list for a scale model of the artificial stream system:
Rubbermaid 31-Quart Plastic Storage Container. Cost- 9.97X 4= $39.88
http://www.lowes.com/ProductDisplay?partNumber=345750-315-1787044&langId=-
1&storeId=10151&productId=3373762&catalogId=10051&cmRelshp=req&rel=nofollow&cId=PDIO1
Gutters: $6.47
http://www.lowes.com/pd_12066-322-RW100_4294806370_4294937087_?
productId=3009950&Ns=p_product_qty_sales_dollar|
1&pl=1¤tURL=%2Fpl_Gutters_4294806370_4294937087_%3FNs%3Dp_product_qty_sales_dollar
|1&facetInfo=
Epoxy: $4.99
http://www.lowes.com/pd_40308-69-1405604_0__?
productId=3203639&Ntt=epoxy&pl=1¤tURL=%2Fpl__0__s%3FNtt%3Depoxy&facetInfo=
Water pump: $24.47
http://www.lowes.com/pd_58695-60084-FP155_4294765370_4294937087_?
productId=3036184&Ns=p_product_qty_sales_dollar|
1&pl=1¤tURL=%2Fpl_Pond%2BPumps_4294765370_4294937087_%3FNs%3Dp_product_qty_sal
es_dollar|1&facetInfo=
Tubing: $7.98
http://www.lowes.com/ProductDisplay?partNumber=62573-48650-VT3800&langId=-
1&storeId=10151&productId=3036731&catalogId=10051&cmRelshp=rel&rel=nofollow&cId=PDIO1
5 gallon empty bucket: $3.97
http://www.lowes.com/pd_356492-1152-50640_0__?
productId=3694238&Ntt=5+gallon+empty+bucket&pl=1¤tURL=%2Fpl__0__s%3FNtt%3D5%2Bgall
on%2Bempty%2Bbucket&facetInfo=
Gravel: $3.28 X2= 6.56
http://www.lowes.com/pd_103110-76450-PVB40RC_4294728554_4294937087_?
productId=3589380&Ns=p_product_qty_sales_dollar|
1&pl=1¤tURL=%2Fpl_Bagged%2BRock_4294728554_4294937087_%3FNs%3Dp_product_qty_sal
es_dollar|1&facetInfo=
While he was working on that Lori continued researching the probes we would use. Joe and Lori also collected resources to help us move forward with various stages of the project.
Research:Real world Water Quality Management http://www.oregon.gov/OWEB/docs/pubs/wq_mon_guide.pdf?ga=t
Dissolved Oxygen and Temperature http://www.newton.dep.anl.gov/askasci/chem03/chem03334.htm
pH meter information http://en.wikipedia.org/wiki/PH_meter
Aquatic River Tank http://www.rivertank.com/
Healthy River Systems http://www.epa.gov/bioiweb1/aquatic/rivers_and_streams.html#health
Dr. Fu presented us a puzzle and asked us to write some code that would use a light sensor to take an analog reading of the light level and use that reading to vary the blink rate. I worked on that assignment. The solution he had in mind was the one found below as Light Rate.
Light Rate
const int ledpin = 13; // set led to pin 13
const int sensorpin = 0; //set sensor to analog pin 0
void setup() {
pinMode(ledpin, OUTPUT); //sets LED to output mode
}
void loop() {
int rate = analogRead(sensorpin); //checks light level and sets rate based on analog reading
digitalWrite(ledpin, HIGH); //turns on LED
delay(rate); //keeps it on for a length of time based on light level
digitalWrite(ledpin, LOW); //turns off light
delay(rate); //keeps it off for a length of time based on light level
}
That program gave me another idea and, with feedback from the team, we set up a night light program. The first one that I wrote seemed to work but I couldn’t make the light stop flickering when the sensor was blocked. We all put our heads together and tried different configurations for the circuit, different resistors, etc... Watching three well educated teachers, a professor and an experienced grad student hover over a simple circuit with handfuls of components and a multimeter and looking confused would have probably been hilarious for our students. Especially since the issue was a simple coding error because I forgot to take out a delay that I put in during the early stages so I could visually track changes. *sigh*
Flash Night Light (broken)int lightPin = 0; //PhotoResistor Pin
int ledPin = 13; // Led Pinboolean sensorState = false; //zeroes sensor state
void setup()
{
pinMode(ledPin, OUTPUT); //sets the led pin to output
digitalWrite(ledPin, HIGH); //turns on led
Serial.begin(9600); //sets data rate
}
void loop()
{
int threshold = 1000; // sets the analog reading for specific circuit
if (analogRead(lightPin) > threshold && sensorState == true)
//takes analog reading from the light sensor and compares the result to threshold
{
digitalWrite(ledPin, HIGH); //turns on LED when light level is below threshold
sensorState = false;
delay(50); //pause to see change
}else{
if(sensorState == false){
digitalWrite(ledPin, LOW); //turns off LED when light level is above threshold
sensorState = true;
delay(50); //pause to see change
}
}
}
Night Light (fixed)
int lightPin = 0; //PhotoResistor Pin
int ledPin = 13; // Led Pin
boolean sensorState = false; //zeroes sensor state
void setup()
{
pinMode(ledPin, OUTPUT); //sets the led pin to output
digitalWrite(ledPin, HIGH); //turns on led
Serial.begin(9600); //sets data rate
}
void loop()
{
int threshold = 1000; // sets the analog reading for specific circuit
if (analogRead(lightPin) > threshold && sensorState == true)
//takes analog reading from the light sensor and compares the result to threshold
{
digitalWrite(ledPin, HIGH); //turns on LED when light level is below threshold
sensorState = false;
}else{
if(sensorState == false){
digitalWrite(ledPin, LOW); //turns off LED when light level is above threshold
sensorState = true;
}
}
}
While I tinkered with code we won’t actually use Lori and Joe brainstormed a list of hypotheses or questions students might come up with before beginning this project:
As the day wound down Joe started putting pieces together for our group presentation, Lori kept pulling and organizing resources and I slapped together this blog.
1. Will we see consistency in our 3 variables (temperature, pH, and DO) throughout tanks because of enclosure size constraints? If so, which changes need to be made with design?
2. How does each variable influence the other?
3. Can we expect DO levels to increase in our system because of increase in turbulence?
No comments:
Post a Comment