Steam Pumpkin – My Steampunk Pumpkin

Halloween is one of my favorite times a year being ShadowLord and all. I was BatMan three times in my life and only once as a kid. Pumpkin carving is something I also get into. My first pumpkin at age 9 was an old farmer smoking a pipe. It even had a twinkling red LED in the corncob pipe. After burning up a handful of LEDs my dad taught me about current limiting resistors.

Fast forward 20 years and I am still shoving LEDs into pumpkins. This year my inspiration comes from steampunk, a growing subculture fascinated with steam-aged garb and future technology fusion. Steampunk was born of the H. G. Wells and Jules Verne visions of futuristic technology and style. Call it what you want, Steampunk is an inspiring movement of makers and re-users of technology and materials.

Here is my steampunk inspired pumpkin.

Where do you start?
I cobbled together whatever I could find that resonated steampunk. I found my Mom’s old purse that had some faux leather, brass loops, and a gold chain. I also grabbed an old candle holder, a lamp shade, a door hinge, a metal coffee filter, and some brass brads. My Dremel was used to drill, cut metal, and and cause sparks (insert grunt).
Full of hot air
I knew that I was going to add some technology to the design and I settled on an automated fog machine that would blow smoke from the ears of the pumpkin. Okay, I know it’s a little literal, but it is a steam pumpkin.
How do you do that?
Using the ioBridge IO-204, I rigged up the fog machine to trigger when someone walked in front of the pumpkin. I used a passive infrared sensor from Adafruit to detect motion. The IO-204 has an upcoming feature that allows for on board logic, meaning you can break off of the Internet and have local controls take over. To integrate it with the fog machine, I tapped into the wireless remote control that came with the fog machine. This made it easy to control using a single relay. To light the pumpkin, I bought a BlinkM RGB LED Blaster from Sparkfun. The LEDs are high intensity lights that you can mix colors together. It turned out to be a neat touch. When someone gets close, I set the color with the IO-204 to an evil red to accompany the smoke.

For more information and more “How-to” detail, check out Instructables.com.

Introducing The Steam Pumpkin
Here is a YouTube video of “Steamy Wonder” in action:


She Thinks My Toaster is Hot

One day you put your toaster on a social networking site. And then on another day you find out that your toaster has more friends than you.

Twitter Toaster System

This little story sounds made up. Well, it’s not.

My toaster has had a Twitter page since December 2008, tweeting the status of my toast making habits for all of the world to follow. On occasion people even write to the toaster to ask what it’s toasting. Oddly enough, it can tell you.

I get asked, “Why have your toaster on the Internet?” Well, it’s a starting point for future projects and part sarcasm. I have been working on gizmos, web control, and power / resource management projects with my friend Jason Winters of ioBridge for over a decade. One day I had the idea to overlay appliance usage data onto a graph of my power consumption for my house. My theory is to use this appliance meta data to reduce the power I use everyday by pointing directly to the power hogs. It’s a start to my internet of things at my house. If you want to get start your own Skynet, visit Wired’s Wiki on making things talk. I use the IO-204 control and monitor module from ioBridge.com.

OK, mostly it’s sarcasm.

My Toaster has been recently written about on Wired.com, ReadWriteWeb, PC World, Tiscali, De Morgen, XYCity China, etc. If you want to hear about it straight from the bread slot, you can get live updates from my toaster by following @MyToaster on Twitter.

I am now jealous of my toaster which has made for awkward moments when I want some crunchy Wonder Bread.

Internet-enabled Message Center

What are you up to now?

I took the leap and bought an Arduino from LiquidWare. An arduino is an open-source microcontroller that has a processor, some digital I/O pins, and analog inputs. You can create little standalone programs that monitor inputs, control LEDs, and pretty much anything that you dream up. My favorite projects are ones that involve the Internet. A microcontroller is rather simple by itself, but what if it could use the web to get answers, send email, maybe update my Twitter status? That means there is a unlimited number of projects ahead – Microcontrollers collaboarating in cyberspace. The missing link for the web part is the ioBridge IO-204. I know you are no stranger to the the IO-204, but for those of you who have not heard. The IO-204 sits on my network and relays data from its channels to ioBridge.com servers and back into my network. It allows for remote control and monitoring without network configuration and programming. One of the expansion boards is a two-way serial board that accepts serial strings and connects them to APIs of web services that ioBridge interfaces to and sends back responses. For instance, I can send the commands, “[[[calc|9*9]]]” and this returns 81. OK, maybe not impressive on the surface, but that result came from Google Calculator. Anything Google Calculator can solve, your microcontroller has access to those results. For more examples, visit the Serial Web Services API on the wiki.

Message Center Project

I wanted to combine these two worlds with a sample project – maybe it will inspire you to come up with something better, spark some ideas that you have. I have my arduino measuring my outside temperature here in Pittsburgh, which is an analog input scaled to Fahrenheit. At any moment I can press a button and get the temperature on the LCD screen – no Internet required. Since I have been planning a work trip to Atlanta, I also wanted to compare my temperature with hot-lanta’s. So, my project solves that. Using the “weather command”, I am able to get the weather anywhere in the world by zip code or city name.

I added a few more things to the message center. With another button I can get the stock quote of Google. My strike price was $405, so I have been watching it close. If it gets below $405, I get an automatic email from my message center. The stock quote comes from the Yahoo Financials API.

I have one more button that emails me a secret message when it’s pressed. I put this in here for when my mom comes into my room from when I am on the road. It’s aptly label, do not press. Next time, I will hook it to a light sensor in the basement to catch her when she turns on my lights. I am sure you all have the same issues with your mom.


Source Code

The arduino requires some c-like programming and I wanted to include the sketch for you to steal and use for your projects. You will see how I send the serial commands from the arduino to the IO-204 using the UART serial connection (pins 0/1) and recieve and parse the incoming results. I use a SoftwareSerial port for the LCD results. The push buttons are software debounced and use pull-up resistors for solid digital connections. The LED’s linked to each button use a 330 ohm resistor to protect them. I was aided by the Arduino Inputs tutorial on Ladyada.net, Debounce Tutorial, and the iobridge Wiki / Forum. Please let me know if you have any questions, maybe I can help. I have learned a lot about handling strings on the arduino.

//
// Message Center using Arduino and the ioBridge IO-204
//
// An open-souce Shadowlord Project
// www.IamShadowlord.com


#include SoftwareSerial.h>

// SoftwareSerial Pins
#define rxPin 2
#define txPin 3

// Setup Software Serial
SoftwareSerial
softSerial = SoftwareSerial(rxPin, txPin);

// Global Setup
int middleLED = 11;
int rightLED = 10;
int leftLED = 12;

int leftButton = 5;
int
leftButtonCurrent = LOW;
int leftButtonReading;
int leftButtonPrevious = HIGH;
long leftButtonTime = 0;
long
leftButtonDebounce = 200;

int middleButton = 4;
int middleButtonCurrent = LOW;
int middleButtonReading;
int
middleButtonPrevious = HIGH;
long middleButtonTime = 0;
long
middleButtonDebounce = 200;

int rightButton = 6;
int
rightButtonCurrent = LOW;
int rightButtonReading;
int
rightButtonPrevious = HIGH;
long
rightButtonTime = 0;
long
rightButtonDebounce = 200;

int tempPin = 5;
int tempAnalog = 0;
int
tempF = 0;

char* currentRequest = "";

// Start up program
void
setup() {

pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);

pinMode(leftLED, OUTPUT);
pinMode
(middleLED, OUTPUT);
pinMode(rightLED, OUTPUT);

pinMode(leftButton, INPUT);
pinMode(middleButton, INPUT);
pinMode(rightButton, INPUT);

softSerial.begin(9600);
delay(100);

Serial.begin(9600);
delay
(100);

Serial.flush();
delay(100);

// Setup LCD
clearLCD();
setBacklightBrightness(9);
delay
(1000);

// Test LEDs
digitalWrite
(leftLED, HIGH);
digitalWrite(middleLED, HIGH);
digitalWrite(rightLED, HIGH);

delay(1500);

digitalWrite(leftLED, LOW);
digitalWrite
(middleLED, LOW);
digitalWrite
(rightLED, LOW);

}

// Start main program loop
void
loop(){

// Get Analog Input and scale as temperature for ioBridge temperature sensor on arduino
tempAnalog = analogRead(tempPin);
tempF = tempAnalog / 6.875;

// Monitor left button status and debounce
leftButtonReading = digitalRead(leftButton);

if (leftButtonReading == HIGH && leftButtonPrevious == LOW &&
millis
() - leftButtonTime > leftButtonDebounce) {
if (leftButtonCurrent == HIGH) leftButtonCurrent = LOW;
else
{digitalWrite(leftLED, HIGH);
clearLCD();
delay
(100);
softSerial.print("Outside: ");
delay
(100);
softSerial.print(tempF);
delay
(100);
moveCursor("02", "01");
delay(100);
softSerial.print("Atlanta: ");
leftButtonCurrent = LOW;
//Request temperature in Atlanta via ioBridge
Serial.print("[[[weather|Atlanta]]]");
digitalWrite
(leftLED, LOW);
}
leftButtonTime = millis();
}

leftButtonPrevious = leftButtonReading;

// Monitor middle button status and debounce
middleButtonReading = digitalRead(middleButton);

if (middleButtonReading == HIGH && middleButtonPrevious == LOW &&
millis() - middleButtonTime > middleButtonDebounce) {
if (middleButtonCurrent == HIGH) middleButtonCurrent = LOW;
else
{currentRequest = "Google";
digitalWrite
(middleLED, HIGH);
clearLCD();delay(100);
softSerial.print("GOOG: $");
delay
(100);
middleButtonCurrent = LOW;
//Request Google Stock Price via ioBridge

Serial
.print("[[[stock|GOOG]]]");
digitalWrite
(middleLED, LOW);
}
middleButtonTime = millis();
}

middleButtonPrevious = middleButtonReading;

// Monitor right button status and debounce
rightButtonReading = digitalRead(rightButton);

if (rightButtonReading == HIGH && rightButtonPrevious == LOW &&
millis() - rightButtonTime > rightButtonDebounce) {
if
(rightButtonCurrent == HIGH) rightButtonCurrent = LOW;
else
{
digitalWrite
(rightLED, HIGH);
clearLCD();
delay(100);
softSerial.print("Alert: ");
delay
(100);
rightButtonCurrent = LOW;
//Send email via ioBridge

Serial
.print("[[[email|hans@nothans.com|Alert|Mom, is pressing your buttons]]]");
digitalWrite(rightLED, LOW);
}
rightButtonTime = millis();
}

rightButtonPrevious = rightButtonReading;

// Display serial messages
if(Serial.available() > 0){

delay(100);

char charIn = 0;
byte i = 0;
char
stringIn[32] = "";

while(Serial.available()) {
charIn = Serial.read();
stringIn[i] = charIn;
i += 1;
}

if (currentRequest == "Google") {

softSerial.print(stringIn);
int stockPrice = atoi(stringIn);
delay(100);
moveCursor("02", "01");
delay(100);
stockPrice = stockPrice - 405;
softSerial.print("Change: $");
delay
(100);
softSerial.print(stockPrice);
currentRequest = "";

}
else
softSerial.print(stringIn);
}

// End program loop
}

//
// ioBridge Serial LCD Functions and Parameters (for SoftwareSerial)
//

void displayMessage(char* message){
softSerial.print(message);
}

void clearLCD(){
softSerial.print(0xFE, BYTE);
softSerial.print("Z");
}

void setBacklightBrightness(int level){
// level
// 0=Off -> 9=Brightest

softSerial.print(0xFE, BYTE);
softSerial.print("B");
softSerial.print(level);
}

void setBacklightTime(int level, byte seconds){
// level
// 0=Off -> 9=Brightest

// seconds
// 01 = 1 seconds => 06 = 60 seconds


softSerial.print(0xFE, BYTE);
softSerial.print("T");
softSerial.print(level);
softSerial.print(seconds, BYTE);
}

void moveCursorHome(){
softSerial.print(0xFE, BYTE);
softSerial.print("H");
}

void turnCursorOn(){
softSerial.print(0xFE, BYTE);
softSerial.print("J");
}

void turnCursorOff(){
softSerial.print(0xFE, BYTE);
softSerial.print("K");
}

void turnBlinkingCursorOn(){
softSerial.print(0xFE, BYTE);
softSerial.print("P");
}

void turnBlinkingCursorOff(){
softSerial.print(0xFE, BYTE);
softSerial.print("Q");
}

void scrollMessage(int row, int speed, char* message){
// row
// 1=First Line -> 2=Second Line


// speed
// 0=Slowest -> 9=Fastest


softSerial.print(0xFE, BYTE);
softSerial.print("S");
softSerial.print(row);
softSerial.print(speed);
softSerial.print(message);
softSerial.print(0xFE, BYTE);
}

void moveCursor(char* row, char* column){
// row
// 01=First Line -> 02=Second Line

// column
// 01=First Position -> 16=Last Position


softSerial.print(0xFE, BYTE);
softSerial.print("L");
softSerial.print(row);
softSerial.print(column);
}

void drawHorizontalGauge(int row, char* leftLabel, char* rightLabel, char* length){
// row
// 1=First Line -> 2=Second Line

// leftLabel and rightLabel
// 2 character labels

// length
// a=Empty -> k=Full (filled in from left to right)


softSerial.print(0xFE, BYTE);
softSerial.print("G");
softSerial.print(row);
softSerial.print(leftLabel);
softSerial.print(rightLabel);
softSerial.print(length);
}

void drawVerticalGauge(int height){
// height
// 0=Bottom -> 8=Top (filled in from bottom to top)

softSerial.print(0xFE, BYTE);
softSerial.print("V");
softSerial.print(height);

}

Bonus Project

It’s simple, but I hacked together a power supply for the Arduino, which gets power from USB or a coaxial input from a transformer. I wanted to only run one brick, wall wart, so I hacked a USB cable. There are 4 wires in the USB cable (from pinouts.ru):

1 VCC Red +5 VDC
2 D- White Data –
3 D+ Green Data +
4 GND Black Ground

The IO-204 has a regulated 5VDC and ground (up to 1A – 4A total draw depending on supply) on each channel, so using a terminal strip, I connected the VCC and GND to a cut in half USB cable.

It’s magic – look ma, only one power source.

iTurn – iPhone and iPod Touch Hack

Since my toaster has been on the Internet Twittering my toasting habits, I have been flooded with email asking what I was going to do next. To be fair, most of the email suggested that I had too much time on my hands. My mom got me an iPod Touch for Christmas (she gave it to me a few days early). I have not had the thing out of my sight since she surprised me with a wonderful gift. She also gave me Batman which I transferred to the iPod. I turned the screen about 44 times a minute while watching The Joker and The Dark Knight try to out smart each other. This got me thinking, “Could I control a motor with the movement of the iPod?” I had my next hack.

The iPhone or iPod Touch has an accelerometer that detects how the device is oriented. As the devices moves off axis (from straight up and down) the screen rotates. I want to use that feedback to control the position of a motor or servo or cause specific events to happen depending on the device’s position.

Taking the ioBridge IO-204 module, I connected the servo controller and a servo to one of the channels. On the servo I taped a Best Western hotel pen to show the movement of the servo. I found from hours of testing that the Best Western worked the “Best” and Hampton Inn worked slightly worse.

iTurn Setup
On the ioBridge website, I created 3 widgets that corresponded with the orientation of the iPod. “Left” for when tilted towards the left, “Right” when I turned right, and “Forward” when I was holding the iPod normally (straight up and down).

Warning: The next part involves some light programming. I made a quick HTML file with some JavaScript that detected the orientation of the iPod and called the appropriate widget. The orientation code is below for those of you that are interested in trying this for yourself:

function updateOrientation() {
switch(window.orientation){
case 0: widgetExecute(“Upright Widget ID”);
break;

case -90: widgetExecute(“Right Widget ID”);
break;

case 90: widgetExecute(“Left Widget ID”);
break;
}
}

Load up the completed HTML file on your iPhone or iPod Touch and now you can control a servo with the turning of your iPhone. I call it “iTurn” (didn’t see that one coming, did you?).

Here is a YouTube video of the iTurn project:

Social Networking for My Toaster

My Toaster Tweets

That statement sounds odd. Well, let me explain. My friends would describe me as the kind of person that has a lot of time on their hands. They would be right. That time is never put to productive use, but over Thanksgiving I got the gumption to start a new project. Sometimes, I start little servo, robotic, web-based projects for my own gratification, but I get fed up with all of the time I invest just so I can impress my 3 friends that also have nothing do to over the holidays.

My friend Jason Winters has been working on an module that simplifies the connecting of projects to the internet. He sent me one of his ioBridge modules to beta test and my mind started spinning. My goal this Thanksgiving was to think of a crazy project that would be the most senseless thing someone has ever heard of before.

Again, My Toaster Tweets…

Twitter is a social networking site that allows you to tell the world your current status – kind of like a microscopic blog that gets to the point. You can write, “Hans is going to lunch” or “Hans is tired”, etc. It’s fun to follow people and see what they can do creatively with just a few characters of updates.

I use my toaster when I am home and I thought that the world may want to know when I’m toasting.

Twitter Screen Shot

How do you make a toaster twitter?

I grabbed my old bagel / toast toaster and glued a switch to the outside, so when the slider gets pressed down it triggers the switch and when it pops up, the switch opens (couldn’t be any more binary than that).

Toasting Position

The ioBridge module has a digital input that I can hook the switch up to and monitor that state of toasting or not. Using a terminal board, a pull up resistor (1k), and some alligator clips, I hooked up the resistor from the digital input to the +5v source from the module, and clipped my clips on the resistor and the ground. A few pictures are worth more than my description.

Toaster Hookup Close Up

Module Hookup

Here is the whole system hooked together:

Twitter Toaster System

The Web Stuff

Using the ioBridge website, I created an event widget that monitors the input state of that particular digital input. And when the input is “high”, the site sends an HTTP POST to the ThingSpeak API to send a message to Twitter. ThingSpeak calls this “ThingTweet” and is one of many services that you can use to build Internet of Things projects.

MyToaster IoT Gadget

Follow My Toaster on Twitter at twitter.com/mytoaster. I think that I proved that I have too much time on my hands.