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