SENSING
Above: arduino at site - humidity, soil moisture, and water level [three modes of water sensing]. Due to the malfunction of the solar battery pack, was not able to get data for more tha 1 hr. However, as I had intended to deploy the robot for a week, it would have been swept away in another round of flooding. Due to another technical difficulty or sd card not reading on my computer, I have not yet been able to visualize this data. However, this is a prototype and I am excited to further pursue this work in Spring 21’.
Below: fabrication process and testing, theodore teichman co-collaborator (code/design)
arduino code (designed by Theo Teichman)
#include "dht11.h"
#include "Adafruit_seesaw.h"
Adafruit_seesaw ss;
#include
#include
dht11 DHT11;
#define DHT11PIN 7
#define WaterLevelSensor A0
#define SDpin 10
float WaterLevel = 0;
float SoilMoisture = 0;
float Humidity = 0;
void setup () {
Serial.begin (115200);
ss.begin(0x36);
SD.begin(10);
//if (!SD.begin(10)) {
//Serial.print("error");
//}
//else {
//Serial.print("Success");
//}
SD.mkdir("milton_sensing");
}
void loop() {
int chk = DHT11.read(DHT11PIN);
Humidity = DHT11.humidity;
File Air = SD.open("air.csv", FILE_WRITE);
if (Air){
Air.print(Humidity);
Air.println(",");
Air.close();
Serial.print("Humidity :");
Serial.print(Humidity);
}
else {
Serial.println("error opening air.csv");
}
uint16_t capread = ss.touchRead(0);
for (int i = 0; i <= 100; i++)
{
WaterLevel = WaterLevel + analogRead(WaterLevelSensor);
SoilMoisture = SoilMoisture + capread;
delay(1);
}
WaterLevel = WaterLevel/100.0;
SoilMoisture = SoilMoisture/100.0;
File Water = SD.open("water.csv", FILE_WRITE);
if (Water){
Water.print(WaterLevel);
Water.println(",");
Water.close();
Serial.print("Water Level :");
Serial.print(WaterLevel);
}
else {
Serial.print("error opening water.csv");
}
File Soil = SD.open("soil.csv", FILE_WRITE);
if (Soil){
Soil.print(SoilMoisture);
Soil.println(",");
Soil.close();
Serial.print("Soil Moisture :");
Serial.print(SoilMoisture);
}
else {
Serial.print("error opening soil.csv");
}
delay(1000);
}
#include
dht11 DHT11;
#define DHT11PIN 7
#define WaterLevelSensor A0
#define SDpin 10
float WaterLevel = 0;
float SoilMoisture = 0;
float Humidity = 0;
void setup () {
Serial.begin (115200);
ss.begin(0x36);
SD.begin(10);
//if (!SD.begin(10)) {
//Serial.print("error");
//}
//else {
//Serial.print("Success");
//}
SD.mkdir("milton_sensing");
}
void loop() {
int chk = DHT11.read(DHT11PIN);
Humidity = DHT11.humidity;
File Air = SD.open("air.csv", FILE_WRITE);
if (Air){
Air.print(Humidity);
Air.println(",");
Air.close();
Serial.print("Humidity :");
Serial.print(Humidity);
}
else {
Serial.println("error opening air.csv");
}
uint16_t capread = ss.touchRead(0);
for (int i = 0; i <= 100; i++)
{
WaterLevel = WaterLevel + analogRead(WaterLevelSensor);
SoilMoisture = SoilMoisture + capread;
delay(1);
}
WaterLevel = WaterLevel/100.0;
SoilMoisture = SoilMoisture/100.0;
File Water = SD.open("water.csv", FILE_WRITE);
if (Water){
Water.print(WaterLevel);
Water.println(",");
Water.close();
Serial.print("Water Level :");
Serial.print(WaterLevel);
}
else {
Serial.print("error opening water.csv");
}
File Soil = SD.open("soil.csv", FILE_WRITE);
if (Soil){
Soil.print(SoilMoisture);
Soil.println(",");
Soil.close();
Serial.print("Soil Moisture :");
Serial.print(SoilMoisture);
}
else {
Serial.print("error opening soil.csv");
}
delay(1000);
}