[DMS 8013] Assessment document (Tide code)

Posted in Uncategorized on May 13th, 2016 by Yue Wang

For the project, before I changed some detail, DHT11 basic code from Arduino library:

https://www.adafruit.com/product/386

The Processing classic code learning at Jeremy Blum’s tutorial:

http://www.jeremyblum.com/2011/02/13/arduino-tutorial-7-i2c-and-processing/comment-page-1/

Here is final Arduino code: 

#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2

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

}

void loop()
{

int chk = DHT11.read(DHT11PIN);

Serial.print((float)DHT11.humidity, 2);
Serial.print(“,”);

Serial.print((float)DHT11.temperature, 2);
Serial.print(“,”);

Serial.print(Fahrenheit(DHT11.temperature), 2);
Serial.print(“,”);

Serial.print(Kelvin(DHT11.temperature), 2);
Serial.print(“,”);

Serial.print(dewPoint(DHT11.temperature, DHT11.humidity));
Serial.print(“,”);

Serial.print(dewPointFast(DHT11.temperature, DHT11.humidity));
Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));

delay(1000);
}

double Fahrenheit(double celsius)
{
return 1.8 * celsius + 32;
}

 
double Kelvin(double celsius)
{
return celsius + 273.15;
}
double dewPoint(double celsius, double humidity)
{

double RATIO = 373.15 / (273.15 + celsius);
double RHS = -7.90298 * (RATIO – 1);
RHS += 5.02808 * log10(RATIO);
RHS += -1.3816e-7 * (pow(10, (11.344 * (1 – 1/RATIO ))) – 1) ;
RHS += 8.1328e-3 * (pow(10, (-3.49149 * (RATIO – 1))) – 1) ;
RHS += log10(1013.246);

 

double T = log(VP/0.61078); // temp var
return (241.88 * T) / (17.558 – T);
}

double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity*0.01);
double Td = (b * temp) / (a – temp);
return Td;
}

Final Processing code:

import processing.serial.*;

Serial port;

String temp_c = “Lets go!”;
String temp_f = “”;
String data = “”;
int index = 0;
PFont font;

int rad = 50;
float xpos, ypos;

float xspeed = 3.8;
float yspeed = 3.2;

int xdirection = 1;
int ydirection = 1;
void setup()
{

size (500,500);
println(Serial.list());
port = new Serial(this, Serial.list()[0], 9600);
port.bufferUntil(‘.’);
font = loadFont(“AgencyFB-Bold-200.vlw”);
textFont(font,155);

noStroke();
frameRate(50);
ellipseMode(RADIUS);
xpos = width/2;
ypos = height/2;
}
void draw()
{
background(0,0,0);

fill(173,255,47);
text(temp_c,70,175);
fill(255,105,180);
text(temp_f,70,370);

xpos = xpos + ( xspeed * xdirection );
ypos = ypos + ( yspeed * ydirection );

if (xpos > width-rad || xpos < rad) {
xdirection *= -1;
}
if (ypos > height-rad || ypos < rad) {
ydirection *= -1;
}

ellipse(xpos, ypos, rad, rad);

}
void serialEvent(Serial port)
{
data = port.readStringUntil(‘\n’);
println(data);
if(data!=null){
temp_c = data;

String[]values;
values = splitTokens(data,”,”);
temp_c = values[1];
temp_f = values[2];
}

}

 

[DMS 8013] Assessment document (in progress images and video)

Posted in Uncategorized on May 13th, 2016 by Yue Wang

 

 

 

 

For this porject, I use DHT11 temperature and humidity sensor to measures the environment temperature and humidity data transfer by Arduino, then use Processing to show the data.

Here is DHT11 temperature and humidity sensor:
1 2

Here is Arduino connect and data display:3 6

And this part of is Processing display: 7 8In progress, I take 3 videos to record the ongoing work, first one is Arduino link and code display: https://www.youtube.com/watch?v=3bgTY-EiHjg

Second one is first time display on Processing:

https://www.youtube.com/watch?v=ta2WlDAR8to

And then is after my developed, final display on Processing:

https://www.youtube.com/watch?v=kbrU2x3pSg0

 

[DMS 8013] – Arduino and Touch sensor play

Posted in Uncategorized on May 7th, 2016 by Yue Wang

IMG_9651 IMG_9652

 

This is Arduino touch sensor, I try to make it work.

The touch sensor used Capacitive Sensing Library by Paul Badger

1

 

The showing video:

https://www.youtube.com/watch?v=YpgqqP-0mlg

But the problem is the light not working…the online tutorial about touch sensor always have a light, but the connection with light and touch sensor dosen’t clear. Even the arduino screen show the touch sensor already work and the data changed but I should continue try to make the light work.

[HSS 8121] – Ethnography

Posted in Uncategorized on May 5th, 2016 by Yue Wang

‘Ethnography’ was first time HSS8121-Enterprise and Research Methods class topic, It’s talk about Naturally occurring settings, ordinary activities, social meanings, menmber categories, multiple data sources, coding, and qualitative interpretative analysis etc.

But the deep impression on me is Professor John ask our to do a group activity, thinking  ideas for a public art work, it set on Northumblum street, each group have 2-3 members and 1 hour to prepare on Northumblum street. My partner Mia Wang and Daniel Parry.

In this hour, we have sufficient discuss and improve each other’s idea, take some sketches.

For example:

Our first idea for this public art work is Band stand. Support table, micophone, chair and amplifier sound etc. It is not only a art work, but also can let  buskers have a good place to take perform whatever rainy day or windy day. If lots buskers in the stand, maybe will have a funny mix.

0505_2

 

Second idea is Chair map, as the picture, use street original floor light and chair make a big map in the street, every chair can be set little screen link with app to introduce the Newcastle landmarkes and guide.

3

 

Third idea is two Big trees seperate from street beginning and endding, hanging lots of bags and umbrella. As we know the Northumberland street is a shopping street, if some one forget their bag they can get a bag at the beginning Big tree and return the bag for at the street end, same way for umbrella.

2

 

Anyway, really interesting class.

Share a cute sketch from Daniel, LOL:

5

 

[DMS 8013] – Hack Day work.

Posted in Uncategorized on May 5th, 2016 by Yue Wang

This project made with Sean, and fixed by Tom.

The books data from Newcastle City Council website.

1

We used Processing and Arduino together to show the books data from 1500-2016, I made the Processing code and Sean produced the data link with Arduino code and touch part. When you touch the button you can see the Newcastle published books data from 1500-2016 and select the data displaying by year.

This is first time processing code:

Table table;
PFont font;
int arduinoNum = 1593;
void setup() {

font = createFont(“Calibri-Bold-40.vlw”,25);
textFont(font);

fill(0);
size (1200,580);
background(198);

table = loadTable(“data.csv”, “header”);

 

println(table.getRowCount() + ” total rows in table”);
///how do we match a number from the arduino to a row / date?

int arduinoNum = 2001;

for (TableRow row : table.rows()) {

int id = row.getInt(“publ_y”);
// String species = row.getString(“species”);
// String name = row.getString(“name”);
if (arduinoNum==id) {
String year = row.getString(“publ_y”);
String author = row.getString(“author”);
String title = row.getString(“title”);
println(“found it !”, id, author, title);
}
// println(name + ” (” + species + “) has an ID of ” + id);
}
}
void draw() {
background(255);
int i=2;

for (TableRow row : table.rows()) {
int id = row.getInt(“publ_y”);
// String species = row.getString(“species”);
// String name = row.getString(“name”);
if (arduinoNum==id) {
String year = row.getString(“publ_y”);
String author = row.getString(“author”);
String title = row.getString(“title”);
println(“found it !”, id, author, title);
text(author,20,i*40);
text(title,width/2,i*40);
i++;
}

}
//make the arduino value increase over time
arduinoNum++;
}

The showing video:

https://www.youtube.com/watch?v=inTwCGj0PRE

 

After the discuss, Tom fix the code and make it smoothly.

This is Tom fixed code:

Table table;
PFont font;
int arduinoNum = 0;

int numYears = 2016-1500;
DataPoint [] points;
void setup() {

font = createFont(“Calibri-Bold-40.vlw”, 25);
textFont(font);

fill(0);
size (1200, 580);
background(198);
points = new DataPoint [numYears];

for (int i=0; i<numYears; i++) {
points [i] = new DataPoint(i);
}
table = loadTable(“data.csv”, “header”);

for (int i=0; i<numYears; i++) {
int year = int(table.getRow(i).getString(“publ_y”));
String author = table.getRow(i).getString(“author”);
String title = table.getRow(i).getString(“title”);

///update the appropriate point
points[year-1500].authors.add(author);
points[year-1500].titles.add(title);
}
println(table.getRowCount() + ” total rows in table”);
///how do we match a number from the arduino to a row / date?
}
void draw() {
background(255);
int verticleSpacing = 48;
//
if (arduinoNum>=0 && arduinoNum<points.length) {
DataPoint thisPoint = points[arduinoNum];
int date = thisPoint.date;
for (int i=0; i<thisPoint.titles.size(); i++) {
String title = (String) thisPoint.titles.get(i);
String author = (String) thisPoint.authors.get(i);
text(title+” “+author+” “+str(date), 10, verticleSpacing+(i*verticleSpacing));
}
}
arduinoNum++;
println(arduinoNum);
if (arduinoNum>=numYears) {
println(“restart”);
arduinoNum=0;
}
}

And the showing video:

https://www.youtube.com/watch?v=TSubZtci8xg

Great experience from this HACK Day! Feel the strong team work and learning new staff!