Homework for Tuesday + goal for Tuesday

Homework for Tuesday + goal for Tuesday

Please see the following comments DUE for Tuesday (scroll all the way to the bottom of this post). I would assign more but some groups are WAY behind in Arduino and that doesn’t work. I will pause a bit for those groups to catch up but starting Tuesday we will pickup the pace for the PART II review with outside reviewers on Tuesday Feb 21. We will revise everything below for that review and diagram the site with your organization and unit “design”

Some libraries, sound sensor code and writing to SD card I have used in the past:

/Libraries
#include <SD.h>
#include <SPI.h>
#include <DHT.h>
#include <Wire.h>
#include <SoftwareSerial.h>
#include “Adafruit_PM25AQI.h”
//SOUND SENSOR THINGS//////////////////////////////
const int sampleWindow = 10000; // Sample window width in mS (50 mS = 20Hz) 12.10.17 was 1000
unsigned int sample;
/////////////////READ SOUND SENSOR////////////////////
    unsigned long startMillis= millis();  // Start of sample window
    unsigned int peakToPeak = 0;   // peak-to-peak level
    unsigned int signalMax = 0; //originally set to 0
    unsigned int signalMin = 1024;    //originally set to 1024
    // collect data for 10 seconds
    while (millis() – startMillis < sampleWindow)
    {
       sample = analogRead(4);
       if (sample < 1024)  // toss out spurious readings
       {
          if (sample > signalMax)
          {
             signalMax = sample;  // save just the max levels
          }
          else if (sample < signalMin)
          {
             signalMin = sample;  // save just the min levels
          }
       }
    }
    peakToPeak = signalMax – signalMin;  // max – min = peak-peak amplitude
    double volts = (peakToPeak * 5.0) / 1024;  // convert to volts
//SD CARD BEGIN/////////////////////////////////
  if (SD.begin())  {
    Serial.println(“SD card is initialized. Ready to go!”);
  }
  else  {
    Serial.println(“Failed”);
    return;
  }
  sd_file = SD.open(“data.txt”, FILE_WRITE);
  if  (sd_file) {
      sd_file.print(“Time”);
      sd_file.print(“,”);
      sd_file.print(“Humidity”);
      sd_file.print(“,”);
      sd_file.print(“Temperature_C”);
      sd_file.print(“,”);
      sd_file.print(“Heat_index_C”);
      sd_file.print(“,”);
      sd_file.print(“PhotoResistor”);
      sd_file.print(“,”);
      sd_file.print(“SoundSensor”);
      sd_file.print(“,”);
      sd_file.print(“RainSensor”);
      sd_file.print(“,”);
      sd_file.print(“pm10_standart”);
      sd_file.print(“,”);
      sd_file.print(“pm25_standart”);
      sd_file.print(“,”);
      sd_file.print(“pm100_standart”);
      sd_file.print(“,”);
      sd_file.print(“pm10_environment”);
      sd_file.print(“,”);
      sd_file.print(“pm25_environment”);
      sd_file.print(“,”);
      sd_file.print(“pm100_environment”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 0.3 um / 0.1L air”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 0.5 um / 0.1L air”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 1.0 um / 0.1L air”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 2.5 um / 0.1L air”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 5.0 um / 0.1L air”);
      sd_file.print(“,”);
      sd_file.print(“Particles > 10 um / 0.1L air”);
      sd_file.print(“\n”);
  }
  sd_file.close();
}
void loop() {
  sd_file = SD.open(“data.txt”, FILE_WRITE);
  if (sd_file)  {
    senddata();
  }
  else  {
    Serial.println(“error opening file”);
  }
  delay(1000);
}
void senddata() {
  for (long seconds = 00; seconds < 86400; seconds = seconds + (TIME/1000)) {
    float temp = dht.readTemperature();
    float hum = dht.readHumidity();
    float fah = dht.readTemperature(true);
    float heat_index = dht.computeHeatIndex(fah, hum);
///////////////WRITE DATA TO SD FILE////////////////////
    sd_file.print(seconds);
    sd_file.print(“,”);
    sd_file.print(hum);
    sd_file.print(“,”);
    sd_file.print(temp);
    sd_file.print(“,”);
    sd_file.print(((heat_index) – 32) * (0.5556));
    sd_file.print(“,”);
    sd_file.print(lightsensorValue);
    sd_file.print(“,”);
    sd_file.print(volts);
    sd_file.print(“,”);
    sd_file.print(rainSensorValue);
    sd_file.print(“,”);
    sd_file.print(pm10_std);
    sd_file.print(“,”);
    sd_file.print(pm25_std);
    sd_file.print(“,”);
    sd_file.print(pm100_std);
    sd_file.print(“,”);
    sd_file.print(pm10_env);
    sd_file.print(“,”);
    sd_file.print(pm25_env);
    sd_file.print(“,”);
    sd_file.print(pm100_env);
    sd_file.print(“,”);
    sd_file.print(part_03um);
    sd_file.print(“,”);
    sd_file.print(part_05um);
    sd_file.print(“,”);
    sd_file.print(part_10um);
    sd_file.print(“,”);
    sd_file.print(part_25um);
    sd_file.print(“,”);
    sd_file.print(part_50um);
    sd_file.print(“,”);
    sd_file.print(part_100um);
    Serial.print(“\n”);
////////////////WRITE DATA TO SERIAL MONITOR///////////////
    Serial.print(seconds);
    Serial.print(“,”);
    Serial.print(hum);
    Serial.print(“,”);
    Serial.print(temp);
    Serial.print(“,”);
    Serial.print(((heat_index) – 32) * (0.5556));
    Serial.print(“,”);
    Serial.print(lightsensorValue);
    Serial.print(“,”);
    Serial.print(volts);
    Serial.print(“,”);
    Serial.print(rainSensorValue);
    Serial.print(“,”);
    Serial.print(pm10_std);
    Serial.print(“,”);
    Serial.print(pm25_std);
    Serial.print(“,”);
    Serial.print(pm100_std);
    Serial.print(“,”);
    Serial.print(pm10_env);
    Serial.print(“,”);
    Serial.print(pm25_env);
    Serial.print(“,”);
    Serial.print(pm100_env);
    Serial.print(“,”);
    Serial.print(part_03um);
    Serial.print(“,”);
    Serial.print(part_05um);
    Serial.print(“,”);
    Serial.print(part_10um);
    Serial.print(“,”);
    Serial.print(part_25um);
    Serial.print(“,”);
    Serial.print(part_50um);
    Serial.print(“,”);
    Serial.print(part_100um);
    Serial.print(“\n”);
    if (seconds >= 58)  {
      minutes = minutes + 1;
    }
    if (minutes > 59)  {
      hours = hours + 1;
      minutes = 0;
    }
    sd_file.flush(); //saving the file
    delay(TIME);      //how long between each measurement
  }
  sd_file.close();   //closing the file
}

Homework for Tuesday

I.  Sensor prototyping  –  [post to blog as cagtegory “2.5 Sensors Control + Pilot”]

Control tests (good and bad baselines). In controlled setting. Document this in diagrams, photos, etc. List problems! problem are good. try to create limits of good and bad qualities. almost break the sensor…

Pilot Test – on site but only walking around one block.

Time – will you record over 15 minutes or over 24 hours?

Space – we will all measure first at quarter block locations but then hi-rez at every address How to write multiple lines of data Graphing the data in excel. Select data cells, INSERT/ (first graph)…select data and change graphics icon of line weight and color Think about a time column converting seconds to time (Format)

Ill updated the Google My Map dropping pins for 3 x 3 block area.

I used this converter online: https://mygeodata.cloud/converter/kml-to-csv  and I added the points up to 72. Do look at the Google My map to know which block is measured in which order. I normally measure each block clockwise starting from the upper left (NW)

You will find a new 3×3 template on our Google Drive here: https://docs.google.com/spreadsheets/d/1CLfRxxkim9aD-EUcfp7OYfpmuiBbKkxyRcNc2W4HQTA/edit?usp=share_link

eventually you will make your own map, dropping a pin for every street address and adding more for multiple facades of one address (Ill explain in class), or for your own sensor locations.

II. Premiere Movie – [post to blog as category  “2.6 Phenomena clips”]  you may have to make a Vimeo account to host

start to record video/audio clips on your phone: a) conceptual good and bad, b) on-site and c) baseline locations around town.  If you download any video be careful to document the source. 

Organize your clips in folders. Name the folders per phase changes and types of phenomena.

Be careful how / not to record children and try to record backs of peoples heads so they are not identifiable. Be very conscious of the sensory quality other than sight.

Consider short clips of 3-5 seconds, 10-30 seconds Pics are also good to collect.

III.  Design – Site Background drawings  –  [post to blog as category  “2.7 Background dwgs”]

  1. Site section from Market building to center of street (beautiful like work vector drawings with light illustration layer)
  2. 3D model and iso/axo of the site (see SA+UD Hult Plaza design )  from market building to center of street VERY carefully document EVERYthing on site now such as ground material, lines, materials, trees, benches, trash, lights, curbs – must all be vector. control line weights and types. cut at ground level.
  3. Site plan – see above. same rules. vector. same content.
  4. diagrams of Programming and human use of space and conditions of that use (example below is just that…base this on your own qualities)

PRINT all and bring in Tuesday on 11×17. only then can we jump to the unit scale

 

///

Tuesday in class I will carefully explain the Data Management workflow from

  1. Arduino SD card raw data CSV
  2. cleaned data save as excel file
  3. graphs
  4. workflow to GIS VIZ (Elephant) tool, namely z-line tool