Friday, December 17, 2010

Half way

Well my thesis has officially reach the half way point with the end of Master Project 1. I presented my work to the school and had a great presentation. I had 11 demo's up and running, 8 based on JeeNode hardware and additional 3 running on Arduino (because I ran out of JeeNodes). In the coming days I'll work on posting photos, details and code demos.

Currently I'm spending a week relaxing after some stressful finals and working on fixing some minor issues. This week I added better support of interrupts and started experimenting with implementing a sleep cycle to conserve battery. Next up comes rewriting the processing script to match the updated modular Arduino code.

Tuesday, November 30, 2010

Google Code Setup

Well I finally made the jump and got and my code setup on Google code to start sharing my HomeNet Code. You can also find some documentation on how it all works 1800 lines of code and growing...

Google Code: HomeNet

Tuesday, November 23, 2010

Even More Modular

My last code post simplified things, but many things were hard coded in. These weekend I modularized things so you can choose which network adapters you needs as well as what devices are connected.
#include <ports.>h>
//#include <portslcd.h>
#include <rf12.>h>
#include <homenet.>h>
//#include <homenetdevices.h>
#include <homenetdevicelcd.>h>

//Start HomeNet Packet Stack
HomeNet stack(0x04);//0x01 is RF12 base station //0xFF is PC uplink

//Setup Network Adapters
//HomeNetPortSerial portSerial(PORT_SERIAL, stack);  //PORT_SERIAL tells the adpater which serial serial port to use (for future support of the arduino mega)
HomeNetPortRF12   portRF12(stack);

//Setup attached devices
HomeNetDeviceStatusLights statusLights(stack);
//HomeNetDeviceTMP37 tmp37(stack);
//HomeNetDeviceLight light(stack);
HomeNetDeviceLCD lcd(stack);

//package the setup info in a nice neat arrays
 HomeNetPort*  ports[] = {&portRF12};//,&portSerial}; 
 HomeNetDevice*  devices[] = {&statusLights,  &lcd};// &light , &tmp37};

MilliTimer sendTimer;

void setup() {
  //initize home net with the setup info
  stack.init(ports, 1, devices, 2); 
  stack.registerStatusLights(statusLights); //setup status lights
}

void loop() {
  //receive incoming packets
  stack.receive();
  
  if (sendTimer.poll(10000)){
   // PayloadBuffer buffer;
   // buffer.print("TEST NODE 3");
   // stack.addUdpPacket(0, 2, 0, CMD_STRING, buffer.payload());
    //stack.schedule(2,255,0); //type, toNode, toDevice
     
  }
  
  //process packets in the stack- send packets that ready
  stack.process();
  delay(1);

}

Thursday, November 18, 2010

More Code

So the code finally reached a tipping it's time to package the code up into a library. I'm calling it HomeNet because it describes its perfectly it's a new home net work and amazingly enough, there isn't anything going by the name yet.

Compared to the long mess of code posted before, Moving most of the code to a library really simplified things:

#include <ports.h>
#include <rf12.h>
#include <homenet.h>

HomeNet stack(0x04);//start stack with a node id
MilliTimer sendTimer;

void setup() {
  // put your setup code here, to run once:
  stack.init();

}

void loop() {
  // put your main code here, to run repeatedly: 
  stack.receive();
  if (sendTimer.poll(2000)){
    PayloadBuffer buffer;
    buffer.print(123,DEC);
    stack.addUdpPacket(0, 255, 2, CMD_BYTE, buffer.payload());
  }
  stack.process();
}

and the processing sketch using the library
import processing.serial.*;
import xmlrpclib.*;
import org.apache.commons.codec.binary.Base64; //part of the xmlrpclib

XmlrpcClient homeNetXmlrpcClient = new XmlrpcClient("http://matthew.sgcs.usf.edu/mcdportal/public/xmlrpc.php?api_key=dfgdfgdgdgd");
XmlrpcServer homeNetXmlrpcServer = new XmlrpcServer(8081);



final int  NODE_ID = 255;
final int PACKET_TIMEOUT = 150;
PacketStack stack = new PacketStack(NODE_ID);

Serial myPort;  // The serial port


XMLElement xmlConfig;



XMLElement commands[];
XMLElement devices[];

String findXMLid(XMLElement[] xml , int value, String rAttribute){
  String rValue = ""; 
  for(int a = 0; aif(unhex(commands[a].getAttribute("id")) == value){
      return commands[a].getAttribute(rAttribute);
    }
  }
  return rValue;
} 


void setup() {
  size(600, 400);  // Stage size
  //noStroke();      // No border on the next thing drawn
  homeNetXmlrpcServer.add("testserver", this); //setup server
  println("HomeNet XML-RPC Server started at " + homeNetXmlrpcServer.ip()+":8081/RPC2"); // Note that /RPC2 is hard-coded to URI in the Apache Library.
  
  textFont(createFont("Consolas", 14));
  //fixedFont);
  
  xmlConfig = new XMLElement(this, "config.txt");
  devices = xmlConfig.getChildren("devices/device");
  commands = xmlConfig.getChildren("commands/command");
  
  //load the above as hash table from my sevrer.
  
  // Print a list of the serial ports, for debugging purposes:
  //println(Serial.list());
  
  String portName = Serial.list()[1];
  myPort = new Serial(this, portName, 115200);
}

boolean arduinoBoot = false;
int count = 0;
long sendTimer;
void draw() {
  
  if(arduinoBoot == false){
    delay(2500);
    sendTimer = millis();
    arduinoBoot = true;;
  }
  
  if((millis() - sendTimer) > 2000){
    //DataPacket packet = build_udp_packet(NODE_ID,0,3,2,CMD_STRING,str_to_payload("Hello "+count));
    //packet.status = STATUS_READY;
    sendTimer=millis();
    count++;
  }

  stack.process();
    
  stack.tempSerialCheck(myPort); //this is temp until I add support for multiple serial ports, and pass a list of ports to the packetStack
}
void packetEvent(DataPacket packet){
  packet.status = STATUS_CLEAR;
  Hashtable send = new Hashtable();
  String packetBase64 = new String(Base64.encodeBase64(packet.payload));
  send.put("received",packet.received);
  send.put("packet", packetBase64);
  println("Server Reply: "+homeNetXmlrpcClient.execute("HomeNet.addPacket", send));
}  

void serialEvent(Serial port) {
  stack.buildSerialPacket(port);
}
Much easier to use now!

Friday, November 12, 2010

First Tests

I finally completed enough of the packet code that I finally test to see if it actually works! and Amazingly enough ti works. Packets can now be sent from a remote wireless node to a receiver and passed to the computer. It also works the other way, data from the computer can be sent to a remote node. I recorded a video but I don't have it up yet.

Code after the jump

Tuesday, November 9, 2010

XML Config File

Its starting to be pain to setup on the constants in both Arduino and processing and in the future php so it's time to create a configuration file that all of these different languages can use (sort of)

And here it is:
<?xml version="1.0"?>
<configuration>

<devices>
  <device id="0x01" code="DVC_TMP37">Temperature Sensor TMP37</device>
  <device id="0x02" code="DVC_LIGHT">Light Sensor LDR</device>
  <device id="0x03" code="DVC_SHT21">Temperature and Humidy Sensor SHT21</device>
  <device id="0x04" code="DVC_DOORCONTACT">Door Contact Sensor</device>
  <device id="0x05" code="DVC_WINDOWCONTACT">Window Contact Sensor</device>
  <device id="0x06" code="DVC_MOTION">Motion Sensor</device>
  <device id="0x07" code="DVC_2LINEDISPLAY">2 Line Character Display</device>
  <device id="0x08" code="DVC_POWER30">30A Current Sensor</device>
  <device id="0x09" code="DVC_POWER100">100A Current Sensor</device>
  <device id="0x10" code="DVC_SMARTOUTLET">Smart Outlet</device>
  <device id="0x11" code="DVC_RGBLIGHT">RGN LED Light</device>
  <device id="0x12" code="DVC_sound">Sound Sensor</device>
  <device id="0x13" code="DVC_SWITCH">Simple Switch</device>
  <device id="0x14" code="DVC_STATUSLED">Simple Status LEDS</device>
  <device id="0x15" code="DVC_BUZZER">Alert Buzzer</device>
</devices>

<commands>

  <!-- System Commands Port 0 -->
  <command id="0x00" code="CMD_ERROR"  payload="message" return="CMD_ACK"></command>

  <command id="0x01" code="CMD_VERSION" payload="" return="CMD_FLOAT">
    Get current version of firmware on the node
  </command>
  <command id="0x03" code="CMD_BATTERYLEVEL" payload="" return="">
    Get current battery level
  </command>
  <command id="0x3E" code="CMD_PING" payload="varies" return="CMD_PONG">
    Send Test Pack, node should reply back pong
  </command>
  <command id="0xE3" code="CMD_PONG" payload="varies" return="CMD_ACK">
    Response to a Ping Command
  </command>
  <command id="0x11" code="CMD_ACK" payload="packetid" return="CMD_BYTE">
    Acknowledge Packet, letting the sender of a packet know that data arriced safely
  </command>
  <command id="0x21" code="CMD_GETNODEID" payload="" return="CMD_BYTE">
    Get Node's current ID (node id 0 is for broadcast)
  </command>
  <command id="0x22" code="CMD_SETNODEID" payload="passcode" return="CMD_ACK">
    Changes NODE ID, used for initial setup
  </command>
  <command id="0x23" code="CMD_GETPLUG" payload="byte port" return="CMD_BYTE">
    Get the device code for what is attached on the node
  </command>
  <command id="0x24" code="CMD_SETPLUG" payload="passcode" return="CMD_ACK">
    Changes Device ID, used for initial setup
  </command>

  <!-- Plug commands Ports 1-15 -->
  <command id="0xC1" code="CMD_AUTOSENDSTART" payload="node to, int" return="CMD_ACK">
    Set up the node to automatically send sensor data to a particular node 
  </command>
  <command id="0xC2" code="CMD_AUTOSENDSTOP" payload="node to" return="CMD_ACK">
    Stop auto sending sensor data
  </command>
  <command id="0xD0" code="CMD_GETVALUE" payload="" return="Value">
    Get a value from a plug
  </command>
  <command id="0xD1" code="CMD_SETVALUE" payload="" return="Value">
    Send a value to a plug
  </command>

  <command id="0xE0" code="CMD_ON" payload="" return="CMD_ACK">
    Simple Turn on
  </command>
  <command id="0xE1" code="CMD_OFF" payload="" return="CMD_ACK">
    Simple Turn Off
  </command>
  <command id="0xE2" code="CMD_LEVEL" payload="byte" return="CMD_ACK">
    Set a light to a level 0-255
  </command>

  <!-- Value commands -->
  <command id="0xF0" code="CMD_BYTE"   payload="byte" return="CMD_ACK"></command>
  <command id="0xF1" code="CMD_STRING" payload="string" return="CMD_ACK"></command>
  <command id="0xF2" code="CMD_INT"    payload="int" return="CMD_ACK"></command>
  <command id="0xF3" code="CMD_FLOAT"  payload="float" return="CMD_ACK"></command>
  <command id="0xF4" code="CMD_LONG"   payload="long" return="CMD_ACK"></command>
</commands>

<!-- One day more stuff will be setup too  -->
<pachube>
  <apikey></apikey>
  <feeds>
    <feed name="Bedroom">
      <datastream id="0" node="" plug="" device="" />
    </feed>
  </feeds>
</pachube>

<webserver>
  <address></address>
</webserver>

</configuration>

Processing has built in tools for reading XML and this quick sketch reads the XML file a translates it in to list of #defines for the Arduino. this way as the lists of devices and commands evolve, it's very easy to translate it from one language to another.
XMLElement xml;

PFont myFont;
PrintWriter file;

int i;
String spaces(int count){
 String spaces = "";
  for(int a = 0;a<count;a++){
   
   spaces += " ";
  } 
  return spaces;
}

void setup() {
  size(200, 200);
  
  myFont = createFont("Consolas", 14);
  textFont(myFont);
  
  xml = new XMLElement(this, "config.txt"); //in txt
  file = createWriter("define.txt");
  
  XMLElement commands[] = xml.getChildren("commands/command");
  
  for(i = 0; i<commands.length;i++){
    file.println("#define "+ commands[i].getAttribute("code")+spaces(20 - commands[i].getAttribute("code").length())+commands[i].getAttribute("id"));
  }
  file.println(""); //blank line
  XMLElement devices[] = xml.getChildren("devices/device");
  
  for(i = 0; i<devices.length;i++){
    file.println("#define "+ devices[i].getAttribute("code")+spaces(20 - devices[i].getAttribute("code").length())+devices[i].getAttribute("id"));
  }
  file.flush(); // Write the remaining data
  file.close();
  exit();
}
And here is the Arduino Code the script above generated for me
#define CMD_ERROR           0x00
#define CMD_VERSION         0x01
#define CMD_BATTERYLEVEL    0x03
#define CMD_PING            0x3E
#define CMD_PONG            0xE3
#define CMD_ACK             0x11
#define CMD_SETNODEID       0x21
#define CMD_GETNODEID       0x21
#define CMD_SETNODEID       0x22
#define CMD_GETPLUG         0x23
#define CMD_SETPLUG         0x24
#define CMD_AUTOSENDSTART   0xC1
#define CMD_AUTOSENDSTOP    0xC2
#define CMD_GETVALUE        0xD0
#define CMD_SETVALUE        0xD1
#define CMD_ON              0xE0
#define CMD_OFF             0xE1
#define CMD_LEVEL           0xE2
#define CMD_BYTE            0xF0
#define CMD_STRING          0xF1
#define CMD_INT             0xF2
#define CMD_FLOAT           0xF3
#define CMD_LONG            0xF4

#define DVC_TMP37           0x01
#define DVC_LIGHT           0x02
#define DVC_SHT21           0x03
#define DVC_DOORCONTACT     0x04
#define DVC_WINDOWCONTACT   0x05
#define DVC_MOTION          0x06
#define DVC_2LINEDISPLAY    0x07
#define DVC_POWER30         0x08
#define DVC_POWER100        0x09
#define DVC_SMARTOUTLET     0x10
#define DVC_RGBLIGHT        0x11
#define DVC_sound           0x12
#define DVC_SWITCH          0x13
#define DVC_STATUSLED       0x14
#define DVC_BUZZER          0x15

Monday, November 8, 2010

Ping Pong Packets

After another week of work on my packet code, I finally have a working example of call and response working. Processing sends a Ping packet to the Arduino and the Arduino replies back Pong along with the payload of the original packet. Next step is to expand this to connect to wireless nodes.

Code after the jump

Wednesday, November 3, 2010

Goals and Issues

Below is current look at some of goals and issues I'm currently dealing with-

So far my project has three main components:

Sensor Network <-> Base Station  <-> Web Interface

They are interconnected and pass data between each other.

Sensor Network


The sensor network is gathering the sensor data is currently based on Jeenodes which are Arduino based nodes.

Status: Hardware has been solder together, sensors have been purchased and the code for the protocol has been written.

Goals
  • Create robust adaptable nodes that can easily be reconfigured
  • Create Wired and Wireless Links
  • Create a Mesh Network
 Current Issues
  • How to design so an average user can configure a node? Pre programed ROM? Dip switches? Web interface?
    • Solution: Processing sketch that directly communicates with node to set address and sensor configuration to the Arduino ROM
  • Current Wireless Chip doesn't do mesh networking: cost prohibitive

Base Station


A Server program running on a PC reads packets of data from the sensor network and passes them on to a web interface. Currently using a Processing.org Java Program

Status: Protocol code has been ported to java. Actual interface still needs to be built.

Goals
  • Be user configurable
  • Easy to deploy/setup

Current Issues
  • How to Connect to Web server?
    • XML-RPC seems like the simplest solution right now and offers a lot of flexibility. 
    • Using EEML like pachube might work too but would require a lot more code.
  • How to save settings? flat file, SQL database, remotel?
    • I haven't decided how to solve this yet. Some settings must be saved locally, ie web server address, Pachube api key. Using an XML file is the best soultion for this. 
    • Other settings like node and sensors names would be better stored in a better database if it is to scale to thousands of sensors. Can it call a remote server to get this info or should it be local?
  • How to store data if Internet Connection goes down?
    • Store it memory is the easiest, SQL would be better

Web Interface


Status: In planning.

The web interface right now is going to be using LAMP Linux, Apache, mySQL and PHP.  The code is going to based on the Zend Framework and a UI library I started writng a while back. The front end is going to use jQuery and jQueryUI. Graphs will use the Google Graph API.

Goals
  • Work on a varety of platforms and screen sizes
  • Use Web 2.0 Ajax etc. Jquery
  • Create an interactive Remote for the network
Current Issues
  • Server local or remote?
    • A good webserver is hard for an average user to setup. A remote server can also handle more users. User can also access the remote to get info about power/data outages

Tuesday, November 2, 2010

XML-RPC A better way to connect Processing and the Web

After yesterdays post about how to connect the webserver to the processing sketch, I thought that there had to be a better way and there is.

There is a nice XML-RPC Library for Processing that someone at MIT wrote. XML-RPC is very common on the web so there are multiple ways to implement in php, the best way is probably with the built in XML-RPC Class. After reading the documentation the built in funtions aren't well documented. It looks like I will be using the ZendFramework XML-RPC Module

Monday, November 1, 2010

First Packet Test

The Arduino sends test packets to  processing which decodes them on screen

IMG_3087

Code after the jump

From Processing to the Web

An Arduino is connected to a PC that is running a program created in Processing. It reads the data stream from the arduino and then it can publish the data to an online service like pachube or my own server.

The main user interface of my project is going to be web based so it can be used on all sorts of devices from laptops to cellphones. Processing doesn't make a very good webserver to build an interface around however there is some really good webserver software - Apache, PHP and MySQL.

Linking the webserver to the Processing program is a bit of challenge. A webserver doesn't typically have a program always running, rather the program runs only when generating a web page. To send data to the webserver involved calling a webpage with get/post data. For the webserver to send data to the Processing sketch involves using a simple socket server. I haven't found any example of this online but I think I can combine some of this processing code and some of this php code and make it work.

Update: there is a better way to connect things- XML RPC

Communication Protocol

One of the big steps is developing a language for how all the nodes talk to each other.

There are several existing protocols like BACnet and LonWorks. These a both full featured but almost too complex for what I need right now. I looked to see if anyone had used an arduino with either of these protocols but my search turned up blank. So I decided to write my own.

Data is sent in packets. Each packet is like a letter that has a to and from address and carries a payload inside.

There are several types of packets based on what sort of data is being carried

The first three I plan on implementing are
  • TCP Packet - based on the Transmission Control Protocol, well a very simplified version but when a node receives one of these packets it sends a ack (acknowledgment) packet letting the sender know that the packet reached it destination.
  • UDP Packet - Based on the User Datagram Protocol, again a simplified version. These are packets that don't need acknowledgment. These is used when data is constantly being sent and lost packets would be outdated by the time they were resent
  • Broadcast - this is variant of UDP that doesn't have a set destination, rather it has a max number of hops that the packet will take and all nodes will take a look at it's data

Each packet has a 8 byte header and 2 byte footer. this a lot smaller than the 20 byte header of a standard TCP packet.

8 bits = 1 byte

So far my protocol looks like this
  1. 8 bits - Length of Packet (could be shorter if we don't need big packets
  2. 8 bits - Settings (could be smaller only using 2 bits right now
  3. 12 bits - From node, allows for 4096 nodes
  4. 4 bits - From ports (allows 16 ports on a node)
  5. 12 bits - To Node (or ttl Time to live, if broadcast)
  6. 4 bits - From Port
  7. 8 bits - Packet ID; So that packets can be put back in the right order
  8. 8 bits - Command; read, write, etc  (could be shorter)
  9. 56 bytes Payload
  10. 16 bits - Checksum (verifies data didn't get corrupted in transmission)

Tuesday, October 19, 2010

Soldering Fun

A while back I got a free sample of some power meter chips. These awesome little chips can very accurately measure power consumption. I really want to build my own smart outlet and hook it up to my network. These chips will enable me to do it.

IMG_2347
they are tiny surface mount chips

IMG_2354
to test one out on breadboard i had to solder an adapter board. And success! One side is perfect and the other side was close, 3 pin got bridged with solder but it was easy to fix. So far this is the smallest thing I've hand soldered.

Wednesday, October 13, 2010

Where good Ideas come from...



There was also an Article in the Wall Street Journal about Ideas
The premise that innovation prospers when ideas can serendipitously connect and recombine with other ideas may seem logical enough, but the strange fact is that a great deal of the past two centuries of legal and folk wisdom about innovation has pursued the exact opposite argument, building walls between ideas. Ironically, those walls have been erected with the explicit aim of encouraging innovation. They go by many names: intellectual property, trade secrets, proprietary technology, top-secret R&D labs. But they share a founding assumption: that in the long run, innovation will increase if you put restrictions on the spread of new ideas, because those restrictions will allow the creators to collect large financial rewards from their inventions. And those rewards will then attract other innovators to follow in their path.

The problem with these closed environments is that they make it more difficult to explore the adjacent possible, because they reduce the overall network of minds that can potentially engage with a problem, and they reduce the unplanned collisions between ideas originating in different fields. This is why a growing number of large organizations—businesses, nonprofits, schools, government agencies—have begun experimenting with more open models of idea exchange.
[WSJ]

Smart Mirrors



[Engadget]

Sunday, October 10, 2010

Testing the JeeNodes

This week I finished Soldering together my first set of JeeNodes and I tested out them out by running the PingPong test program.

IMG_2330

Adding to my Room Sensor

I also bought an ambient light sensor that suppose to be more sensitive than a Light Dependent Resistors. I needed my small arduino for another experiment so I moved everything over to a arduino mega. i2c is in a different spot so that's why the Temp/Humidity sensor moved.
IMG_2341

Here is the arduino code
#include <Wire.h>
#include 
#define samples 5

float H[samples];
float T[samples];
int   L[samples];
byte current = 0;

LibHumidity humidity=LibHumidity(0);

boolean readSerial()
{
  if(Serial.available() && (Serial.read()==65)) {
    return true;
  }

  Serial.flush();
  return false;
}

void setup(){
  Serial.begin(9600);
  pinMode(58, OUTPUT);
  pinMode(59, OUTPUT);
  digitalWrite(58, HIGH);
  digitalWrite(59, LOW);
}
void loop(){
  H[current]=(float)humidity.GetHumidity();
  T[current]=(float)(humidity.GetTemperature() * 1.8 )+32;
  L[current] = analogRead(3);
  current++;
  if(current == samples){
    current = 0;
  }
  
  if(readSerial() == true){
    float h2 = 0;
    float t2 = 0;
    int l2 = 0;
    
    for(byte a=0;aSerial.print(h2/samples);
    Serial.print(',',BYTE);
    Serial.print(t2/samples);
    Serial.print(',',BYTE);
    Serial.println(l2/samples);
  }
  delay(1000);
}

And here is the Processing code that uploads the data to Pachube
import processing.serial.*;
import eeml.*;

DataOut dOut;
float lastUpdate;

Serial myPort;      // The serial port
int whichKey = -1;  // Variable to hold keystoke values
String inByte;// = ' ';    // Incoming serial data
String[] message;

float humidity;
float temp;
int light;

void setup() {
  size(400, 300);
  // create a font with the third font available to the system:
  PFont myFont = createFont(PFont.list()[2], 14);
  textFont(myFont);

  println(Serial.list());   // List all the available serial ports:

  String portName = Serial.list()[2];
  myPort = new Serial(this, portName, 9600);
  myPort.bufferUntil(10);
    
  // set up DataOut object; requires URL of the EEML you are updating, and your Pachube API key   
  dOut = new DataOut(this, "http://api.pachube.com/v2/feeds/10505.xml", "API KEY GOES HERE");   
  
  //  and add and tag a datastream    
  dOut.addData(0,"Humidity");
  dOut.addData(1,"Temperature");
  dOut.addData(2,"Light");
}

void draw() {
  background(0);
  text("Light: " + light, 10, 220);
  text("Temp: " + temp, 10, 190);
  text("Humidity: " + humidity, 10, 160);
  text("Last Received: " + inByte, 10, 130);
  text("Last Sent: " + lastUpdate, 10, 100);
 
  if ((millis() - lastUpdate) > 60000){
        myPort.write(65);
        delay(5000);
        println("ready to POST: ");
        dOut.update(0, humidity); // update the datastream 
        dOut.update(1, temp); // update the datastream 
        dOut.update(2, light); // update the datastream 
        int response = dOut.updatePachube(); // updatePachube() updates by an authenticated PUT HTTP request
        println(response); // should be 200 if successful; 401 if unauthorized; 404 if feed doesn't exist
        lastUpdate = millis();
  }   
}

void serialEvent(Serial myPort) {
  inByte = trim(myPort.readString());
  message = split(inByte,',');
  humidity = float(message[0]);//float(myPort.readStringUntil(','));
  temp = float(message[1]);//float(myPort.readString());
  light = int(message[2]);
}

void keyPressed() {
  // Send the keystroke out:
  myPort.write(65);
  whichKey = key;
}

Friday, October 1, 2010

Soldering Fun

I got my new soldering Iron Yesterday so I got right to work soldering one of the JeeNodes Together

IMG_2312

IMG_2308

IMG_2310

Haven't tested it yet. Saving that fun for later.

First Experiment: A Success!

Today I officially started my Internet of Things.

IMG_2300
Arduino with a Humidity/Temperature Sensor

upload feed
Basic Processing Script uploads the Humidity/Temperature of my Apartment to Pachube


Humidity


Temperature

Check out the Live feed

Tuesday, September 28, 2010

Reading: Interactive Architecture

Interactive Architecture
"Interactive Architecture" by Michael Fox and Miles Kemp, 2009.

This book is amazing. It covers the changing paradigm of architecture in the 21st century. The book covers many aspects of my Master's Project from. the embedded computing to it's environmental impact and it's effect on the sociological and psychological implications. through the next week, I write about each of it's sections and my thoughts.

Physical Change - Kinetic Architecture

Embedded Computation

Project Landscape - Adaptable Space; Living, Working, Entertainment and Public Environments

Environmental Impact - Energy Efficiency, Sustainable Solutions, Environmental Cognizance

Enhancing and Extending Activities - Active Participation


Sociological and Psychological Implications - Changing Lifestyle Patterns, Behavior Awareness, Building Awareness, Sense of Place, Control of Space, Attachment to Space

Design and the Profession - Designing Interactive Systems, Economic Feasibility

New Horizons - Technology Transfer, Interface Design, Autonomous Robotics, Evolutionary Systems

“A new epoch has begun!”

Article: 6 Ways to Better Living: Inside an Internet of Things Home

I did some more research on the web today on the "Internet of Things" and found this great article that summarized some of the things a web enabled house can do. Read online at ReadWriteWeb (quoted below)
What if we took the leading sensor-based products currently being developed or already on the market, put them all under one roof, and added a typical American family? Would they just be the techiest family on the block, or would it have a significant impact on their lives?
Here are six ways this Internet of Things family can see their lives change. They exercise more, save energy and water, budget better, know where their kids are at any moment, and they'll always have the right lighting for activities in the house.

Bank Account-based Motivation

We talked last month about Green Goose, which is a green egg with an ethernet connection that can sense how many miles a person has ridden on their bicycle instead of a car. This data ultimately could be synced up with each family members' bank account. So if they chose to ride a bike instead of a car, an automatic transfer of the allotted monthly gas money saved goes from a checking account into a savings account. Green Goose has plans for other similar sensors.

Health and Fitness

When it comes to physical fitness, this family has all the devices we explained in our sensors to keep you fit post. From Nike Plus running shoes, which sends running data to Mom's iPod via a sensor, to grandpa's exercise games via Wii Fit to their youngest son's training program via NordicTracks iFit, to Dad's miCoach pacer, this family is being encouraged by sensors to better understand and improve their physical health.

Water Conservation

The Waterpebble is a simple sensor that's placed in the shower. It measures the duration of the first shower, and when the next person takes a shower a green light inside the pebble will turn to orange to let the person know that their shower-time is half way up. Once the shower goes longer than the recorded time, the pebble gives off a red light. The best part is that after each shower the Waterpebble will fractionally reduce the amount of time the person will be allowed to shower. There's also a reset button for when someone in the family is having a bad day and needs a longer shower.

Energy Use Scoreboard

All electrical appliances in this house plug into Picowatt Wi-Fi smart plugs, which allow the family to communicate and control energy usage via a command center like Intel's prototype home energy monitor. This monitor is what the New York Times refers to as an Energy Use Scoreboard, which calculates energy usage and displays costs in real-time. Once this technology hits the market, the family will be able to add a few goal-setting apps to the control panel and they'll have the tools they need to minimize their energy use.

Alert Services

Last January we reported on Trackle and the emerging era of alert services. In the Internet of Things house not only does Trackle alert the family about vital events and information going on in their neighborhood, but when Mom wants to make sure her daughter gets safely home from school on her own, she simply puts a Touchatag RFID tag in her backpack, which alerts Mom when her daughter is safely home.

Lighting Optimization

Finally, this home's lighting can be regulated by Pachube (pronounced patch-bay) and Arduino. As we reported last summer, light sensors can be connected to Arduino, which is an open-source electronics prototyping platform. The light sensor data is then sent to Pachube, which connects the sensor data to the Web where the lighting can be controlled via twitter or via a home energy monitor.
Overall, it's important to remember that we're still in the early days of Internet of Things. As these products continue to develop we'll find more and more ways for our devices to coax us to refine our health and our environment.

[ReadWriteWeb]
My first order of electronic parts came in today! Time to start experimenting!

IMG_2289
Ah the unboxing.

IMG_2288
Electronic parts look so much smaller in real life.

IMG_2286
I liked the boards from Jee Labs that I ordered a bunch a stuff from them. All of them require assembly. My new Soldering iron won't be here until Wednesday :( (I fried my last one) So it's going to be a couple of days until I have these ready to play with.

Reading: Refabricating Architecture

Refabricating Architecture: How Manufacturing Methodologies are Poised to Transform Building Construction
"Refabricating Architecture" by Stephen Kieran and James Timberlake, 2004
How Manufacturing Methodologies Are Poised to Transform Building Construction
I first read this book three years ago while researching modular construction and the KieranTimberlake's Loblolly House Project.

The book looks at how we can apply ideas from other types of manufacturing like ships and cars to building construction. It got me started at looking at how building construction is lagging behind other types of construction in speed, efficiency, and technology.

My favorite example is looking at how today car's are filled with complex technology. Sensors are integrated through out the car, detecting tire air pressure, engine performance, and even a crash- all to provide a safer, more efficient vehicle. If anything thing goes wrong the cars tells us through a warning light and some now even have the ability to send information straight to your smart phone.

I think it's time we started looking at how we can integrate technology into the core of architecture to create new buildings that respond to their occupants and to the environment around them.

Monday, September 27, 2010

Precedent: Media House Project

I first read about this project as a short article in an architecture magazine, the details were sparse but I really like the ideas. I looked a little deeper and I discovered that the people behind the project had published an entire book detailing the project.

Media House Project: The House Is The Computer The Structure The Network

This project, more than any other, is what inspired my thesis.

The Media House Project was a joint project between UPC. Barcelona Tech and the MIT Media Lab back 2001-2002. MIT focused on developing new technology for the home and Barcelona Tech did a series of studies on how integrate MIT's work into a new Architecture.
The House is the Computer
The Structure is the network
This statement sets the framework for the project. Instead of the computer being separate from the house, it is integrated into the structure of the building

Most of the book was student essays detailing different aspects of the project.
Some of my favorite essays were:

Intelligent Environment: This looked at how we can augment our lives with microcomputers.

Housing X-Ray: A photo essay that deconstructed the lives of several families to show how they live in their homes. It also looked at all of the stuff, furniture, knickknacks, toys, we place inside of our homes.

Intelligent Space: Discussed the MIT Smart Rooms Project, and how it can be incorporated into a building

Structural Model: discussed network layouts: MegaBus - Devices share a common pipeline. Ring - devices are on a ring and pass data in circular fashion. Star, Structure and Relations - devices branch off of a central node.

Structure Vs Infrastructure: How MIT integrated their Internet 0 network into the the structure of the full scale demonstration Model. They used a system similar to that used in track lighting, where devices could be added as needed to the structure.

Media Kitchen: This proposed an early version of the Microsoft Surface. They proposed using them in the kitchen as a way to organize food, layout meals, display cookbooks and more.

Play place - a show case of technology for educating and entertaining children in the house. It's a lot like Microsoft Kinect for Xbox

Chromotherapy - An experiment of using Colored Light to affect the mood of the people in the dwelling

Domos House Website - Discussed a web interface for the House, Lots of great ideas, but a lot has changed in webdesign since this book was written.

Presentation - I love the way the presented this project to the public. They built a full scale model of their experiments and then put on a performance, like a stage show, with the students showing how their piece of the project works

Agenda for the Informational Home - The Closing statement of the book laid out 6 areas for the "Future Informational Home", (i would simply call it a smart house).
1) Internet 0: the house a great brain,
2) Internet 2: large format video.
3) Informational structures (building the network into structure of the house)
4) Manufacturing dwellings,
5) Open dwelling: flexibility of distribution,
6) The house's website

These are the 6 areas I am focusing my Thesis on. My Plans:

1) Build a simple network using off the shelf parts (Arduino).
2) Not critical but worth noting: Youtube, gigiabit lan and fiber optics already exist today, and Internet 2 is well on it's way.
3 & 4) I think these go hand in hand, the future of housing is in modular construction. I think any sort of sensor network could easily be integrated inside of these modular parts and be snapped together onsite.
5) My proposed sensor network makes traditional wiring obsolete. Switches and Light bulbs are independent, and can be reconfigured on the fly.
6) I think the interface to the house is one of the most important parts. How do you see the information the house is producing while your at home? at Work? away at vacation? How do show off your greeness online on Social Media?

Sunday, September 26, 2010

Arduino's used in an Actual Building

They revamped the Arduino blog and they are posting some interesting stories.

Some time ago I was informed that the surfaces of the amazing Media-TIC building (from Cloud 9 / Enric Ruiz Geli) were Arduino-based, sensing the environment/atmospheric changes and offering a 20% saving on climate control:
The building is in the shape of a cube and formed by large iron beams covered in a plastic coating of inflatable bubbles, which offer glimpses of the fluorescent structure of the building. The attractive covering also has a functional utility as a way of regulating light and temperature, primarily preventing 114 tons of CO2 a year from escaping from the building, and offering a 20% saving on climate control.

Every facade of the Media-TIC is different: from the outside, they reveal parts of their interior spaces and give a diverse plasticity, while from the inside they offer spectacular views.
I did a quick search for more info on how they integrated arduino's but I haven't found anything so far

Another interesting thing from the blog is that someone has created a arduino plugin for Rhino's GrassHopper

Firefly for Grasshopper / Arduino from Jason K Johnson on Vimeo.

This is definitely something I will look at using in the future

[Arduino Blog]

New Arduino's

At MakerFaire NY the folks at Arduino annouced new boards: The arduino uno, a replacement for the Duemilanove and the Arduino Uno Mega, A replacement for the mega.


The main change is a new USB to serial Chip onboard that will open up a lot of new possibilities and the mega has an even more memory.  The best part is the older boards are now going on sale! Once the old Mega drops to $40 I might buy a few more...

[Arduino Blog]

Friday, September 24, 2010

Video: IBM- The Internet of Things

Sometimes youtube is a waste of time, sometimes you can find cool videos

You Too Can Join the Internet Of Things

I read a lot news online and this one relates: You Too Can Join the Internet Of Things . It talks about the growing open source community behind the Internet of Things. In this case using mbed.org a ARM based development kit.  ARM chips are faster than the AVR chip found on the arduinos I'm using but right now the cost is much higher and their not a whole lot of code written for them yet.
For many years now, Silicon Valley has hyped a concept known as the Internet of Things.

The thinking goes that just about everything, be it a shirt, toy, wall or milk jug, will have a chip or some kind of sensor in it that transmits information. People talk about refrigerators that can discern what’s inside of them and recommend recipes or order more milk for delivery just as that gallon jug begins to run out. Or maybe a restaurant gleans some kind of information about its wait staff based on the movement of plates.

A lot of the stuff sounds hokey and adds complexity to situations where the current order of things works just fine. But advocates of the Internet of Things argue that it’s tough for us to really grasp what useful creations people will build with the sensors in these early days with the technology.
[New York Times]

Update: Wired Posted a followup

Will the Internet of Things Be Open or Closed?

Now, at Adafruit Industries’ blog, DIY-engineering all-star Limor Fried counters the Times’ warm enthusiasm for ARM’s approach with some ice-water skepticism: “mbed requires an online compiler, so that you are dependent on them forever. You cannot do anything without using their online site, ever.”

[Wired]

Reading: Smart Rooms

"Smart Rooms" by Alex P. Pentland, Scientific American April 1996, pages 68-76

"In creating computer systems that can identify people and interpret their actions, researchers have come one step closer to building helpful home and work environments"

This is an older article but it has some very relevant ideas. They discuss using cameras to read human movement and behavior to interact with a virtual environment. The funny thing is this is becoming a reality this year when Microsoft releases "Kinect" for the Xbox 360 for Christmas.



I think this sort of interface is whats next for how humans will interact with computers. It opens a lot of new possibilities for how one's house can "see" it occupants and connect with them.

Reading: Internet 0, Interdevice Internetworking

"Internet 0, Interdevice Internetworking" by Neil Gershenfeld, and Danny Cohen, IEEE Circuits & Devices September/October 2006, pages 48-55 (read online pdf)

This article goes over the technical aspects of the proposed Internet-0 but It also goes over some of the background. They developed Internet-0 to be an open standard to replace the 10+ that exist currently.  This would enable competition in the market so devices made by different companies could communicate with each other much like how different brand computers can connect to the same internet.  I think this is great idea but looking at this 6 years later, it doesn't seem the idea has taken off.

Reading: The Internet of Things

"The Internet of Things" by Neil Gershenfeld, Raffi Krikorian and Danny Cohen, Scientific American October 2004, pages 76-82.

"The principles that gave rise to the internet are now leading to a new kind of network of everyday devices, an Internet-0"

"Giving everyday objects the ability to connect to a data network would have a range of benefits: making it easier for homeowners to configure their lights and switches, reducing the cost and complexity of building construction, assisting with home health care. Many alternative standards currently compete to do just that— a situation reminiscent of the early days of the Internet, when computers and networks came in multiple incompatible types."

"To eliminate this technological Tower of Babel, the data protocol that is at the heart of the Internet can be adopted to represent information in whatever form it takes: pulsed electrically, flashed optically, clicked acoustically, broadcast electromagnetically or printed mechanically."

"Using this “Internet-0” encoding, the original idea of linking computer networks into a seamless whole—the “Inter” in “Internet”—can be extended to networks of all types of devices, a concept known as interdevice internetworking."

This article details the network I first read about in the "Media House Project". Internet 0 is a simplified version of Internet 1 for connecting simple devices like light switches, thermostats, locks, security sensors. They don't have need for a speed network, with expensive electronics, they only require a basic network and that can be accomplished with cheap chips.

I really like this system but I think they overcomplicated things. A little background- Data over a network is sent in packets, each one has a header with information about where that bit of data is from and where is is suppose to go. In system described in the article, they used the same header that is used in Internet-1, It's great for sending large packets to billions of computers but on a simple network, it's overkill. I propose using the same ideas of the Internet-1 header but scaled down.

Smart Sensors to Network the World

"Smart Sensors to Network the World" by David E. Culler and Hans Mulder, Scientific American June 2004, pages 84-91.
"An emerging class of pillbox-size computers, outfitted with sensors and linked together by radios, can form perceptive networks able to monitor a factory, a store— even an ecosystem. Such devices will more intimately connect the cyberworld to the real world"

"Thumb-size computers called motes combine microprocessors and memory with radio transceivers, onboard power supplies and a variety of sensors."

"Motes are inexpensive enough to deploy by the thousands in factories, farms or wildernesses. Each mote can collect and analyze sensor readings independently but can also link up with neighboring motes in a mesh like perceptive network."

"Motes are already being manufactured by Crossbow, Intel and others. Early prototype systems have helped biologists study seabird nests and redwood groves. Perceptive networks are also being developed to monitor vibrations of manufacturing equipment, strain on bridges, and people in retirement homes."
This article discussed several practical examples of sensor networks being built by UC Berkely and Intel. They used small microcontrollers with wireless transmitters to gather environmental data. One system being built by Intel was designed to measure the environment inside of an Intel factory monitoring temperature, humidity and vibration to detect problems before it production was affected. The article predicts that these kinds of computers will soon be found in our homes, workplaces, and public spaces and it will likely raise substantial privacy concerns.

Reading: Building around the Mind

"Building around the Mind" by Emily Anthes, Scientific American Mind April/May 2009, pages 52-59

"Brain research can help us craft spaces that relax, inspire, awaken, comfort and heal"

"Architects have long intuited that the places we inhabit can affect our thoughts, feelings and behaviors. Now behavioral scientists are giving their hunches an empirical basis."

"Scientists are unearthing tantalizing clues about how to design spaces that promote creativity, keep students focused and alert, and lead to relaxation and social intimacy. The results inform architectural and design decisions such as the height of ceilings, the view from windows, the shape of furniture, and the type and intensity of lighting."

This article discussed the effects of architecture on the human mind. It had in interesting story about how Jonas Stalk and how he teamed up with Louis Kahn to build the Salk Institute as the place to creative scientific breakthroughs. A study in 2007 proved that people are more creative in spaces with taller ceilings. It makes us feel less physically constrained and able to think bigger. Another study published in 2000 showed that having windows to the outside improves scored higher on tests. It proved that having a view to nature has a calming effect and improves focus.

For me, this article continued my thinking about how adding technology to our environment will affect us. Will the technology be beneficial to our well being or will it just cause us stress?

OnStar Tv Ad

A lot of this project is has been inspired about how our cars are becoming smarter and I just saw a new TVad from OnStar that they have created an app to remotely monitor your car. I think we should have the same thing to monitor our homes. (app preview starts at 0:25)

Thursday, September 23, 2010

Reading: No Place like Home

"No Place like Home" by Antje Flade, Scientific American Mind February/March 2007 pages 70-75.
"What makes a house feel like home?"

"What makes for a “good home”? Generally speaking,
five criteria seem especially important: contact with
neighbors, privacy, flexible usage, opportunities for personalization,
and security."

"That said, people have very different ideas about what
living accommodations should offer. These preferences
depend on age, culture, life circumstances and previous
housing experiences."
This article got me thinking about how whether adding more technology to our homes is a good idea. Do we want increased control or is it just increased complexity.  Will adding technology takeaway our feeling of home?  Will it enhance our feeling of home or will it cause us frustration? Perhaps there is a middle ground? I think it varies a lot from person to person. Some people want to always know whats going on in their house, but others want to leave out in the woods with only the basics.

I see my system as a way to simplify home maintenance and enable an owner to take better care of their house. I admit that it adds an additional layer of complexity to ones house but think as a society we will accept this increase. New cars today are a great example; the are becoming more and more automated. We are made instantly aware if there is an issue with the engine or if a tire has low air pressure. Most drivers are oblivious to all the work car's computer does and I see my system doing the same thing for buildings.

Readings

I've spent the past month doing a lot of reading. I was looking through the archives of Scientific American looking for an article on the MIT Media House and I found several other interesting articles that brought up some issues I hadn't thought about before.

Responses

Goals for the next month

  1. Blog Daily about Progress
  2. Build a demo test to upload environmental data to pachube
  3. Solder and assemble JeeLinks wireless sensor hubs
  4. Setup sensors and get additional data data uploaded to pachube
  5. Build user interface to the system - In room display, Web interface, Phone Interface

Wednesday, September 22, 2010

First Experiment: Arduino + Processing + Pachube

I bought parts this week to start my first of a series of experiments: To track the temperature and humidity of my apartment.

After looking at the available temperature and humidity sensors, I was disappointed to learned that most had large margin of error. I settled on the  SHT21 from Liquidware. I'm going to use an arduino to read the values and then a program written in processing will upload this data to pachube.com which will generate graphs of  the data.

Stay Tuned!

Monday, September 20, 2010

Another Cool Site

I stumbled upon a new site of someone who is also looking a physical computing: Jee Labs
This is a daily weblog about my experiments based on the mix of electronics and computing called “Physical Computing”. I’m building little “sensor nodes” to measure electricity use, temperature, light, etc. which they transmit wireless to one of the central computers in the house. One goal is to better understand how we’re using electricity and how we’re heating the home, so that we can try to improve on it. We’ve achieved a roughly 15% reduction in the past year, simply by paying a bit more attention to everything. There’s still a lot to do, particularly with gas consumption, as our house is fully open and very hard to heat locally.
Looking through his site, he has mad his own arduino module and a whole set up components that can connect to it. I'm feeling inspired today by some of his experiments and bought some parts to build my first demo. More on that to come.

The US Partner of his parts is modern device

Sunday, September 19, 2010

Diy Smart Outlet Precendents

Tweet-A-Watt
  • Adapts a cheap power monitor to send power usage to Twitter

EnerJar
  • One of the First DIY Power Meters
  • Unsafe due to lack of optical isolation

PowerBox
  • Builds upon EnerJar to create a safer device
  • Includes a Relay to remotely disable power

Pico Bay Power Charting
  • Uses Contactless CT sensors to measure current
  • Uploads data to the internet

Humidity Sensors

Sparkfun: Humidity and Temperature Sensor - SHT15 Breakout
  • Digital 2-wire interface
  • Precise dewpoint calculation possible
  • Accuracy +/- 1.5% 
  • Measurement range: 0-100% RH
  • Absolute RH accuracy: +/- 2% RH (10...90% RH)
  • Repeatability RH: +/- 0.1% RH
  • Temp. accuracy: +/- 0.3°C @ 25°C
  • Fast response time < 4 sec.
  • Low power consumption (typ. 30 µW)
  • $41.95
  • Datasheet
SparkFun: Humidity Sensor - HIH-4030 Breakout
  • Near linear, analog output
  • 4-5.8VDC voltage supply
  • All pins broken out to a 0.1" pitch header
  • Laser trimmed interchangeability
  • Accuracy +/- 3.5% 
  • Low power design, typical current draw of only 200μA
  • Enhanced accuracy
  • Fast response time
  • Stable, low drift performance
  •  $16.95
  • Datasheet
Liquidware: Humidity and Temperature Sensor SHT21
  • Bidirectional communication over a single pin on I2C protocol
  • Energy consumption: 80 uW (at 12 bit, 3V, 1 measurement/s)
  • Relative Humidity operating range: 0-100% RH
  • Relative Humidity resolution of 0.03%
  • Relative Humidity Response Time of 8 sec (tau 63%)
  • Accuracy +/- 1.5%
  • Temperature operating range: -40 to +125°C
  • Temperature resolution of 0.01 C
  • 4 pins: +5V, GND, Clock (SCL), Data (SDA)
  • Board is 5V tolerant, allowing sensor to run from a 5V supply on Arduino I/O pins
  •  $39.93
  • Datasheet
Adafruit: Sensiron Temperature/Humidity Sensor - SHT11

  • Communication: Two-Wire Serial
  • Provides a fully calibrated, digital output
  • Measure temperature with a resolution of 0.01 degrees and within +/- 2 degree accuracy
  • Measures relative humidity with a resolution of 0.03%and within +/- 3.5% accuracy
  • Low power consumption (typically 30 μW)
  • Power requirements: 2.4 to 5.5 VDC
  • Dimensions: 0.43 x 0.49 in (11 x 12.5 mm)
  • Operating temp range: -40 to +254.9 �F (-40 to +123.8 �C)
  • $35
  • Datasheet
Seeed Studio Electronic brick - Indoor Temp & Humidity sensor

Thursday, September 16, 2010

Current Smart House Research Projects

Drexel Smart House
Drexel Smart House is a student-led, multidisciplinary project to construct an urban home to serve as a “living laboratory” for exploring cutting edge design and technology. Participants will conduct research and develop designs in the areas of environment, energy, interaction, health, and lifestyle with the ultimate goal of improving quality of life in the urban residential setting.


bwired.nl
I really think automating your home or business and controlling your energy can help to reduce the worlds growing energy problem. So the reason for me to show this all online is to let the people see what is possible today en how it can be done. And hell yeah there are some crazy things online as well but that's for getting the conversation going and believe me it fun to do :-)

Homesense Project
Homesense is a project that rethinks how we design smart homes and investigate how we interact with technologies at home.

Homesense brings the open collaboration methods of online communities to physical infrastructures in the home. Instead of having products forced on them through a top-down design process, selected households will create their own smart homes and live with the technologies that they have developed themselves without any prior technical expertise.

iDorm
The Intelligent Dormitory (iSpace) is a student study bedroom built using the same design, furniturethe idorm and fittings as those found in the halls of Residence at the University of Essex. The iSpace was built by re-fitting a room in the Computer Science Department. Unlike normal student accommodation on Campus the iSpace’s furnishings are fitted with intelligent gadgets that can detect and learn the occupant’s behaviour with the aim of providing services that could improve the quality of their lives by generating an environment that suits their needs. These intelligent gadgets communicate with each other allowing groups of agents to coordinate their actions, and allowing remote access to their services via networks (e.g. Internet, GSM etc).


MIT Media House Project
the House is the Computer,
the Structure is the Network.
A multidisciplinary team of more than a hundred people developed the Media House, a prototype of a domestic living space unveiled in Barcelona in 2001, writes Lucy Bullivant. The project is a technologically advanced interface for interaction that is a benchmark of its kind.
pdf Article

Wednesday, September 15, 2010

The green switch

Green Switch

I love this site's ideas for saving energy. They sell smart outlets that can be remotely turned off so devices don't waste power in standby.

I would love to couple these with a per outlet power meter so you can track exactly how much power a device plugged in is using. I've already started researching chips and relays to try and build something like this.

Initial Communication Hub Design

 My first sensor hub is going to be based on an Arduino Mega. I'm going to build it in shield form and then if it's successfull I might attempt to integrate an arduino directly into it.
 
It is going to have 4 link ports tied to hardware serial ports to connect to adjacent hubs. These wires are going to be cat5 with data in rs-485 format and the remaining 4 wires used for power.  The shield is going to have a stepdown DC to DC chip so that 48v power can be sent over the line and stepped down to the 5v required for the arduino and sensors.

To connect sensors, there are goingto be 4 more cat5 jacks with pin devoted to power, analog sensors, i2c, and digital i/0

(sketches coming soon)

Next week I will order parts to start breadboarding the hub

Online data charting

So far I've discovered these online resources for charting enviromental data from a sensor network

pachube.com - the youtube of sharing environmental data
-has lots of code sample for arduino, php and processing
-looks very promising
-the shortest route to sharing information so far

Google Power Meter
http://www.google.com/powermeter/about/

Google chart API
http://code.google.com/apis/chart/
If I build my own php app, this likily to be used

Temperature Sensors

How to Monitor a house

(Work in Progress)
In building sensor networks there are  2 main design patterns using either wired or wireless networks

Central System

Sensors connect to a central computer that handles all of the information.

Pro's
  • Only one computer to program
  • Data is gathered all in one place 
  • Wireless: devices can sleep to save power when between gathering samples.
  • Wireless: cheaper transmitters.
Con's
  • If the computer crashes, no data can be gathered. 
  • Wired: lots of wires, and the signal gets degraded the longer the cable is.
  • Wireless: All the sensors have to be in range of the base station

Distributed
Pro's
  • Each sensors has it's own microcomputer that logs the data 
  • Data can be stored until it can be shared
  • Less wires
  • Network can withstand multiple device failures
Con's
  • Complex
  • Harder to program
  • More hardware, More expensive 
  • Wireless: modules can't sleep because they have to relay the messages of others.
My Plan

I plan on building a network that combines the strengths of both systems. Sensors in a house are often clustered together.  I plan on building a set of sensor hubs that are placed through out the house and are interconnected building a mesh network. Each hub can read multiple sensors and relay this data to it's neighbors. passing along messages until it reaches an output point.

Input and Output

This post is an Index to future posts detailing available parts for building a complete sensor network

Input Sensors

Environmental

Energy/Resources
  • Electricity
  • Water
  • Gas

Proximity
  • Sonar
  • Infrared
  • Key
  • RFID
Security
  • Door Latches
  • Windows Break Sensors
 Output

Visual
  • LED Lighting
  • Screens
Audio
  • Music Systems
  • Security Alarm
  • Audio Information System

Mechanical
  • Shading Devices
  • Doors
Both
  • Smart Phones

    Tuesday, September 14, 2010

    Master's Project Components

    Part 1- Research Existing Smart Home Technology to incorporate into USF Solar Decathlon Project

    Part 2 - Develop a new smart house network system to connect, sensors and control devices

    Part -3 Look at how we as human interact with architecture and whether adding technology to architecture is a step in the right direction.

     

    Wednesday, September 1, 2010

    Master's Project

    After a very rough week, I am finally starting to work on my Architecture Thesis Master's Project.  It's going to a year long project looking at the future of architecture and how new technology is going to change the way we interact with buildings.

     I plan on keeping my blog as a journal of my research. I spent much of the summer doing preliminary research and finding sources and now It's time for me to review all of it and get my thoughts sorted out.

    My Current Abstract:

    Enabling Walls to Talk

    Today, computers can be found in items we use everyday like our cars, coffee maker and toys but we have yet to truly integrate them into the buildings we create. Currently, the systems we use are an afterthought, a mess of wires running through walls back to a central computer. I propose that by using modular/prefab construction, a micro controller, a cheap single chip computer, can be integrated into every piece of building and joined together during assembly on site to create a distributed computer network that wraps around the building. This network will consolidate existing control systems like security systems and thermostat controls into a single unified system that creates a foundation for a whole new generation of integrated devices.  This way, inputs like light switches and security sensors are programmed rather than hard wired to outputs like lights, shades, locks and other actuators, creating a very flexible environment.

    I will build a prototype of such a system with the goal of patenting it and study how our interaction with our built environment changes.  I will look at what happens when our buildings can interact with us with the same tools we use everyday like the internet, email, Facebook and Twitter.  Users will be able to gain finite control over their surroundings and be better informed about their environmental impact.

    Will being aware of what going inside our walls make us change the way live for the better?