Sistema de monitoramento ambiental do-it-together (Sibel Deren Guler-Estados Unidos/Turquia)

De nuvem
Ir para: navegação, pesquisa

Logo2.jpg

Resumo

I propose to create a system of do-it-together environment monitoring modules that indicate and log data about properties such as water, soil and air quality. The modules will be powered by rechargeable batteries and can be charged by a hand-powered device (with solar panel backup power), located in a public venue for everyone to access. When the power station is not used for the batteries it can charge low power appliances such as cell phones. The system will empower citizens with the ability to measure the quality of their environment and create sustainable communication of this information.

Process

day 1:

finally got started! had small meeting in the morning with the advisors and then made a plan for all of the different parts of my project and what i need help with etc

tried to hack the soil moisture/light/ph sensor i got from home depot only to discover there is nothing inside!

P1000177 copy.jpg

it is just a switch and lots of wires with an analog coil meter. nothing is amplified and even the photocell light sensor doesn’t work so i don’t think it’s good for much. we tried to put it back together to use just the ph part, as this is what we can’t make out of other stuff but it stopped working entirely. oh well, i can still use the probes to make something else and the meter can also become something cool? leslie has experience with the moisture sensors so she is going to help me with this

P1000175 copy.jpg

also tested some air quality sensors, they seem to be working pretty well.

day 2:

very productive day! we built a small module for the attiny AQ tester and got software serial working with attiny!!!! this is a dream come true, seriously i’ve been trying to get that to wok for way to long. apparently the trick is to use an ftdi table to send to RX and TX from the attiny to arduino, that way the baudrate doesnt get all messed up.

i think we will make 3 more mini boards with the tiny.

also put together most of the arduino pro board, it is equiped to have 6 sensors on it and an SD car.

also started planning out to fio board and the other group has xbee working so hopefully that shouldnt take long.

also taught deborah and isabel how to solder, they are super into it :)

tomorrow we go into town for the weekly fair, so hopefully i’ll find something that inspires a possible case/cultural aspect to the project

Week 2

Day 1:

finished doing some test with the arduino pro board and built a small water to LED color module. i think i should build a soil moisture/light one as well, but i’m not sure if i can fit all of that on an attiny chip. leslie helped to test the moisture sensor, i think that will be ready by tomorrow.

P1000243 copy.jpg

P1000238 copy.jpg

also discovered that the DHT sensor doesn’t work on the fio board. found some forums that report similar problems, possibly due to voltage but this doesn’t make sense because the sensor works when plugged into 3.3 volts on the uno board.

javier made progress on the charging station, i’m excited to see it coming together :)

Day 2:

I need to remember to start recording! Tested SD card with the pro and started to write code for storing in XML format. We discovered that we can’t really log time without an RCT or some kind of similar chip, so we’re going to use the Arduino Time/Date library and try to sync through Serial for now. Finally got it working and decided to take the sensor for a walk, but I noticed that it started to get very hot. Apparently the ozone sensor is the culprit, so i’ll have to do some more testing to see how to resolve this

Leslie also helped setup the Xbees but we might have a problem with the xbees on hand, the Fio only works with S1, but we only have 1 S1, so we might have to change the plan. But I found this encouraging project last night: (weather station)

I’ve started to think more about the visualizations and cases. The rest of the walk turned into a longer adventure to one of the neighboring towns with isabel but my camera battery died along the way, i’ll have to go back and take pictures! But along the way I started thinking about craft/activities and the cases. I don’t think there is anything that is very culturally significant between these towns, it’s apparently actually quite seperate and divided but the materials used for construction and decoration seem to be common throughout so I’m thinking of using that. I also stopped into a ceramic studio and talked to the artist about possibly making some cases, but he said it would take a month and it was pretty expensive…so we decided to DIY.

For the AQ sensors I’m going to work with Javier to make a small bamboo case that can hang in a tree or something. for the water sensors I’m thinking some kind of crochet/nit cozy that fits around a cup and houses the sensor. And for the soil moisutre, I’m thinking of putting it under a stone so it bends into the dirt. Not sure about the pro and fio board, but i think I shoud wait until those are in better working condition.

For the visualization: I think I’m going to try and make some sort of “map of rings” like a combination of this:

http://visual.ly/colourdar-helsinki-2011-2002 and http://visual.ly/eco-literacy-map where each ring is a different element being measured and the colors change across the ring over time. can’t find source code for either of these graphics but i’ll keep digging and make some simple sketches later tonight. 

Day 3:

the visulaization is coming along beautifully! this might be the first time i started to sketch something out in processing and decided to keep with the original design. thiago made an xml parser, so i just have to combine that with my output. i went for a wlak with Lot today to get some senro data from his quadcopter but unfortunately something went wrong and it didnt log. i think we will try again tomorrow. here is a video and some pic of the sensor on the copter:

javier made this beautiful little bamboo case for the AQ sensor:

P1000273 copy.jpg

also we’ve decided to cancel the Fio board for now and use bluetooth instead of an xbee since we only have one xbee that works with the Fio :(. I think it will be cool to have an all in one prototype of the bluetooth, sd card, and sensors though. If it works well it shouldn’t be too hard to make a Fio version anyway and that could have other sensors like the pH and color sensor.

Day 5:

ocode, code, code. but! got bluetooth working through to processing and storing to xml. need to restructure the visualization code in the way it processes the xml, but that should be easy enough. not much to show, was coding for most of the day.

P1000258 copy.jpg

alsgot the MQ-7 to pulse and read but need more current to take a reading…

Day 6:

thiago made some more magic XML decoding functions for Processing so I worked on making the visualization coherent. also picked color scales for all of the different elements.

started to make circuit schematics in fritzing, but i think i need to upgrade my library and it said that would tak 12 hours to download, so i’ll wait until the internet is stronger.

Enviropcb pcb.jpg here are some pictures of the final module

in parts: P1000285 copy.jpg

assembled: P1000288 copy.jpg

Week 3

I made a cozy for the water sensor- the circuit lives inside this small cloth and the leads of the sensor can bend over the top of the cup into the water. The color of the light indicates the quality of the water- blue = good, yellow = not so good, pink = terrible. The first version went from green to red:

IMG 0682.JPG

ATtiny

This is the pin-out of the ATtiny85 chip we used

// ATMEL ATTINY85
//
//                +-\/-+
//        PB5  1|        |8  VCC
// (AI 3) PB3  2|        |7  PB2 (AI 1)
// (AI 2) PB4  3|        |6  PB1 PWM
//        GND  4|        |5  PB0 PWM
//


code for software serial:

int analogInPin = 3;  // Analog input pin that the potentiometer is attached to
int sensorValue = 0;        // value read from the pot
int outputValue = 0;        // value output to the PWM (analog out)
//SoftwareSerial myserial(rxPin, txPin);
void setup()  {
   Serial.begin(38400);
   //  pinMode(rxPin, INPUT);
   //pinMode(txPin, OUTPUT);
   pinMode(analogInPin, INPUT_PULLUP);
   Serial.println("ATtiny45 Software serial");
}
void loop() {
  sensorValue = analogRead(analogInPin);           
  outputValue = map(sensorValue, 0, 1023, 0, 255);           
  Serial.print("sensor = " );                     
  Serial.print(sensorValue);     
  Serial.print("\t output = ");     
  Serial.println(outputValue); 
  delay(100);   
}

code for VOC:

int REDPin = 0;    // RED pin of the LED to PWM pin 4
int GREENPin = 1;  // GREEN pin of the LED to PWM pin 5
int BLUEPin = 2;   // BLUE pin of the LED to PWM pin 6

int aqsensor= 0;

void setup() {
   //rgb led pins
   pinMode(REDPin, OUTPUT);
   pinMode(GREENPin, OUTPUT);
   pinMode(BLUEPin, OUTPUT);
}

void loop() {
  aqsensor= analogRead(2);
 
  //COLORS

  if (aqsensor < 60){  
    //turn LED green VOC
    digitalWrite(REDPin, LOW);
    digitalWrite(GREENPin, HIGH);
    digitalWrite(BLUEPin, LOW);
    //Serial.println("green");
  }
   
  if (60< aqsensor< 80){ // yellow VOC
    digitalWrite(REDPin, HIGH);
    digitalWrite(GREENPin, HIGH);
    digitalWrite(BLUEPin, LOW);
    //Serial.println("yellow");
  }
 
  if (80< aqsensor){ //red VOC 
    digitalWrite(REDPin, HIGH);
    digitalWrite(GREENPin, LOW);
    digitalWrite(BLUEPin, LOW);
    //Serial.println("red");
  }
}


code for water conductivity:

const float ArduinoVoltage = 3.3; // CHANGE THIS FOR 3.3v Arduinos
const float ArduinoResolution = ArduinoVoltage / 1024;

const float resistorValue = 10000.0;
int threshold = 3;
int analogValue=0;
int oldAnalogValue=1000; 
float returnVoltage=0.0;
float resistance=0.0;
double Siemens;
float TDS=0.0;

//int inputPin = 3;
int ouputPin = 5;

int REDPin = 0;    // RED pin of the LED to PWM pin 4
int GREENPin = 1;  // GREEN pin of the LED to PWM pin 5
int BLUEPin = 2;   // BLUE pin of the LED to PWM pin 6

void setup() {
   //Serial.begin(9600);

   pinMode(ouputPin, OUTPUT);
   pinMode(REDPin, OUTPUT);
   pinMode(GREENPin, OUTPUT);
   pinMode(BLUEPin, OUTPUT);

   //pinMode(inputPin, INPUT);
}

void loop() {
   while(((oldAnalogValue-analogValue)>threshold) || (oldAnalogValue<50)) {
      oldAnalogValue = analogValue;
      digitalWrite( ouputPin, HIGH );
      delay(10); // allow ringing to stop
      analogValue = analogRead(3);
      digitalWrite( ouputPin, LOW );
   }
 
   returnVoltage = analogValue *ArduinoResolution;  

   if (TDS < 2) {
      digitalWrite(REDPin, LOW);
      digitalWrite(GREENPin, LOW);
      digitalWrite(BLUEPin, HIGH);
   }
   if (2 <TDS < 4) {
     digitalWrite(REDPin, HIGH);
     digitalWrite(GREENPin, HIGH);
     digitalWrite(BLUEPin, LOW);
   }
   if (TDS > 4) {
      digitalWrite(REDPin, HIGH);
      digitalWrite(GREENPin, LOW);
      digitalWrite(BLUEPin, HIGH);
   }
 
   delay(5000);
}

Bluetooth and SD Code

Send from Arduino to Bluetooth:

#include "DHT.h"
//dht initial
#define DHTPIN 2  
#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE);

// Water Conductivity Monitor
const float ArduinoVoltage = 5.00; // CHANGE THIS FOR 3.3v Arduinos
const float ArduinoResolution = ArduinoVoltage / 1024;
const float resistorValue = 10000.0;
int threshold = 3;
int H20inputPin = A3;
int H20ouputPin = 3;

//AQ sensors
int ozone ;
int VOC ;
int soil;

void setup(){
   Serial.begin(115200);
 
   pinMode(H20ouputPin, OUTPUT);
   pinMode(H20inputPin, INPUT);

   dht.begin();
 
  //delay(40000); //wait to calibrate before starting to log
}

void loop() {
   VOC = analogRead(A0);
   ozone = analogRead(A1);
   soil = analogRead(A2);

   //read from dht 
   float h = dht.readHumidity();
   float t = dht.readTemperature();

   //water conductivity 
   int analogValue=0;
   int oldAnalogValue=1000;
   float returnVoltage=0.0;
   float resistance=0.0;
   double Siemens;
   float TDS=0.0;

   while(((oldAnalogValue-analogValue)>threshold) || (oldAnalogValue<50)) {
      oldAnalogValue = analogValue;
      digitalWrite( H20ouputPin, HIGH );
      delay(10); // allow ringing to stop
      analogValue = analogRead( H20inputPin );
      digitalWrite( H20ouputPin, LOW );
   }
   returnVoltage = analogValue *ArduinoResolution;  
   resistance = ((5.00 * resistorValue) / returnVoltage) - resistorValue;
   Siemens = 1.0/(resistance/1000000);
   TDS = 500 * (Siemens/1000);
   //end water conductivity 

   Serial.print(VOC); //water
   Serial.print(","); 
   Serial.print(ozone); //water
   Serial.print(","); 
   Serial.print(TDS); //water
   Serial.print(","); 
   Serial.print(t);//temperature
   Serial.print(",");
   Serial.print(h); //humidity
   Serial.print(","); 
   Serial.print(soil); //water
   Serial.print('\n');

}


Arduino Bluetooth to XML

/* 
  Serial String Reader
  Language: Processing

  reads in a string of characters from from a serial reader
  until it gets a linefeed (ASCII 10).
  
  Then splits the string into sections seperated by a commas
  Then converts the sections to ints, and prints out

*/

import processing.serial.*;
int linefeed = 10;
Serial myPort;
void setup(){
        println(Serial.list());
        myPort = new Serial(this, Serial.list()[0], 9600);
        myPort.bufferUntil(linefeed);
}

void draw(){
        //nothing
}

void serialEvent(Serial myPort){
    String myString = myPort.readStringUntil(linefeed); 
    if (myString != null){
        myString = trim(myString);

        int sensors[] = int(split(myString, ','));
  
        for(int sensorNum = 0; sensorNum < sensors.length; sensorNum++){
            print("Sensor " + sensorNum +": " + sensors[sensorNum]+ "\t");
        }
        println();
    }
 
}

Screenshots

Bluetoothscreen.png

Screenviz1.jpg

Screen shot 2012-11-13 at 4.23.05 PM.png

Final Sensor Cases

AQ Tiny:

P1000311.jpg

Soil Tiny prototype:

P1000324.jpg

Water Tiny

P1000317.jpg

Charge station:

Charger2.jpg

Sensors + bluetooth:

P1000334.jpg

Eloopbag:

P1000338.jpg