CheerLights Robot for Your Nursery

I shared my latest project over on my Nursery Hacks website. It combines some of my favorite things… IoT, CheerLights, ThingSpeak, Particle, and building things for my soon-to-be-here son’s nursery.  I didn’t want a bright light in the nursery, but I did want to build a little CheerLights display for something in the background.

I found a Robot Nightlight on Amazon and purchased it. This little robot is a great night-light and you can change the color using the included infrared remote control. To connect this light to CheerLights, I built an IR controller that is internet-connected using the Particle Photon. The Photon subscribes to the latest CheerLights color on ThingSpeak and transmits the IR code as if the button was pressed on the remote control.

To build your own CheerLights Robot, visit Nursery Hacks for the parts and code.

Twilio Rickrolls You Using Their API

I have been working with the Twilio API for a few of my projects. I have used Twilio to call me when disk space is running low on a server or to call my house and request its status. Twilio is a cloud-based communications platform for sending and receiving text messages or placing phone calls. Twilio is wrapped up nicely with a RESTful API so ThingSpeak or MATLAB can use it without a lot of setup.

Tonight, I was following a beginner tutorial that I wrote for using Twilio and ThingSpeak, and I noticed that their voice example plays a friendly greeting and then by surprise Twilio starts playing Rick Astley’s “Never Gonna Give You Up”, for the world’s geekiest rickroll.

Twilio’s example points to this Url: https://demo.twilio.com/docs/voice.xml.

If you look closer you will see the following code:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say voice="alice">Thanks for trying our documentation. Enjoy!</Say>
    <Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>

Go ahead and click: http://demo.twilio.com/docs/classic.mp3

CheerLights is Back for the Holidays

For the third holiday season in a row, the CheerLights project is gearing up. The idea behind CheerLights is to show that we are all connected by synchronizing the color of lights around the world. Christmas lights are a staple around the holidays and with Internet-connected lights, the color of your lights matches the color of everyone else’s lights.

It has been a real treat watching this project evolve as more and more people add lights… and other things. Things like Android and iPhone apps that check the latest color of CheerLights, an old Commodore 64, and Christmas trees.

To control the lights around the world, send a Tweet mentioning @CheerLights and a color. The command is processed by ThingSpeak platform and distributed to all of the lights listening to the CheerLights API.

@CheerLights I am dreaming of a White Christmas

Another powerful aspect of the CheerLights project is that is shows off what is possible with the emerging Internet of Things. With a single message sent via a social network like Twitter, 1000’s of objects around the world are in sync with each other. Lights are connected by many types of controllers, such as Arduino, ioBridge, Philips, and the Raspberry Pi. This project is only possible through the Internet and the coordination of developers around the world.

Learn how to join the project at CheerLights.com.

We are all connected…

Ziggy Comic – Is It My Tweeting Toaster?

On September 17th, I got a bunch of Facebook messages that said my Tweeting Toaster was now a Ziggy comic. 🙂

Ziggy Toaster Comic

My Tweeting Toaster is a step in the self-aware direction for appliances. This Ziggy cartoon made me smile, but it also made me realize the inevitability of social objects and the Internet of Things and then Skynet. Hmm, and Ziggy was the name of the computer in Quantum Leap…

[via gocomics.com]

Greencastle, Independent Film on Kickstarter

“Greencastle” is an upcoming independent film that I am fortunate to be a part of. I make a small cameo as District Dean Roy Baker giving a commencement speech for a correspondence school graduation.

Created by my long time comedy writing partner, Koran Dunbar, “Greencastle” is a film about a single father who works at a small-town pet store in Greencastle, PA. Poitier struggles against self-doubt and an unclear life direction while trying to raise his young son. In the midst of his “quarter-life crisis” enters Leslie, an attractive woman running from an ugly past. Fate brings them together, but Poitier discovers that opportunities only come to those who take chances, and he must come to terms with his own past before he can embrace his future with confidence.

The crew behind “Greencastle” filmed the movie over the summer of 2011 and the footage turned out great as you can see in the trailer above. They want to take “Greencastle” to a wider audience and looking to use a website called Kickstarter to do so. Have you heard of Kickstarter? Kickstarter is a website where people can post their project and raise funding by offering incentives such as autographed scripts or items related to the output of the project.

“Greencastle” is already submitted to film festivals like SXSW and I would love to see where this project could go with everyone’s help. Check out the Kickstarter for “Greencastle” and see if this is something that you are interested in supporting… Thanks!

EL Pumpkin is Spanish for Electroluminescent Pumpkin

EL Wire is a flexible wire that glows when you apply electricity to it. I am seeing more and more things trimmed with EL Wire and it makes for interesting effect. If you watched America’s Got Talent you might have seen a finalist called Team iLuminate. The iLuminate team used EL Wire to create animations and lighting effects on top of group dancing.

My nephews and niece were in town for Halloween and I was struck with the idea of adding a little animation to our Halloween Pumpkin. I wanted to make a pumpkin that changed expression. We made a basic smiley face and angry face by carving grooves into the face of the pumpkin. Then, we laced the EL Wire in and out of the grooves. We used red for the mad expression and blue and green for the smile expression. It was pretty easy to do and I had fun sharing my bits knowledge with the kids. It was rewarding to hear them come up with their own ideas – “We could hook an MP3 player up to this and scare people” or, “What if we added motion detection?”. It was also fun to hear my 5-year-old niece Zoey say, “Electroluminescent”.

Parts:

Notes:

I think the Blue EL Wire worked the best and looked the best. The red looks a little orange. The Green EL Wire sometimes didn’t illuminate. You can only illuminate 2 strands of EL Wire at a time with the stuff I had from SparkFun. I need to experiment more with EL Wire and get an EL Wire controller to do some more intricate animations. I will post future projects if I come up with anything interesting.

Always start with sketches when you start your project. It’s important to have a plan to allow yourself to stray knowingly.

EL Pumpkin Sketches
EL Pumpkin Sketches

EL Wire is LED of the future if you ask me…

ThingSpeak: Building My Own Twitter (for Things)

Over the past several months I have been working on software to allow “things” to form social networks and send status updates via the Internet. At first glance this may sound very impractical. Hopefully, in a few years this will make more sense as better applications come out. Remember how ridiculous my toaster sounded three years ago? I gave that thing a voice and since has been on TV and more people are interested in it than my Twitnot not saying ter status updates. More proof? At CES 2011 there were at least 10 appliances that could send Twitter status updates. I am not saying that I created them, but I am that they didn’t know about My  Toaster and it’s 600+ followers on Twitter. With this project, I wanted to take it a few steps further and build something from the ground up that’s focused on collecting enormous amounts of data from everyday objects, allowing devices to interact with each other, and building applications to present some meaning. The ThingSpeak project is finally ready to go and open to anyone that wants to start building applications.

My Problem

One problem with the Internet of Things is the concept of “the killer app” – the app that defines a new industry. The internet connected refrigerator is our poster child. Recently, Ryan Rusnak connected a mini fridge to the iPhone via ioBridge, added a motor controlled beer selector, and strapped on an air cannon to fire beers to his couch from 25 feet away – now that’s a killer app. So, my problem was trying to find an application that highlights key features of ThingSpeak and why it’s different.

My App

What I come up with is the idea of “my_house”. “my_house” is a collection of “rooms” that all hold computers, appliances, and sensors aka things. I recently installed some light sensors in “my_room” that push light levels to the ThingSpeak API. I did this to remind me when to turn my lights on so I don’t work in the dark when I get plugged in. And an interesting side benefit was that now I can detect whether or not someone is in the room based on the light level. I will admit this could have been done other ways, but sometimes you solve problems with what you have lying around. “my_house” already keeps track of my location using Google Latitude to control my thermostat.

Eureka moment…

Now I can tell when my mom goes into my room when I am out on the town, most likely Sheetz!!!

Below is a screenshot of the demo app and how I aggregate the data collected by my light sensors. Here are a few things I want to point out:

  • “my_house” is sending the status updates via a collection of networked sensors
  • The status updates were generated by the light sensor device itself
  • The timestamps were recorded by the ThingSpeak API
  • If you click the chart icon you get what the actual light level was
  • The app works in real-time and you can check it out here

"Twitter of Things" ThingSpeak Demo App

The Technical Details

The light sensor uses a Netduino Plus that connects to my home network over Ethernet. This device uses Microsoft .NET Micro Framework and I wrote an application that interfaces with the ThingSpeak API. I also wrote a tutorial over at the ThingSpeak community site on how to use the Netduino Plus for those that want to get started with it fast.

The front-end application is written using only HTML, CSS, and jQuery. I have the fully documented source code attached and you can also see the app live in your web browser.

Light Sensor Netduino Plus

Project Files:

Automatic Thermostat Control Based on Location and Weather

The Pittsburgh Perl Workshop will be held at the Carnegie Mellon University on October 9-10, 2010. The PPW is a gathering of Perl programmers from around the world (and near Pittsburgh) to learn more and discuss the future of Perl.

At this year’s PPW, I will be giving a talk called, “Connecting the Internet of Things with Perl“ (visit pghpw.org for schedule info). I will also explain how to create an Internet of Things application using off-the-shelf Perl modules and web control technology by ioBridge.

As you may or may not know, Perl is a really powerful programming language that enables everything from fast prototyping of web applications to large-scale software platforms. What makes the language unique is the library of modules available to you. If you get a great new idea for a web app, you can get started quickly and find modules that others have written. In some cases, it’s literally copy-and-paste.

A big movement for the past few years is this concept of The Internet of Things. More things will be on the Internet than people in the next few years, so my talk is to highlight why Perl is still relevant after 20 years and needs to be apart of this emerging technology. Internet of Things applications involve connecting sensors and controllers to the web. Perl is perfect for parsing lots of data, pushing data into databases, and connecting services together, known as “mashups”.

My Internet of Things project, written in Perl, allows your current location and home weather conditions to control your home heating and cooling system.

Location Aware Home Automation using Google Latitude API and ioBridge API

I call it,  ”Location Aware Home Automation”. You don’t have to do anything to control your HVAC/Thermostat, it all happens based on where you are. If you are home, the thermostat regulates the inside temperature as normal. When you leave, systems turn off or enter power saving modes. When you get near your home, the heating/cooling system kicks back on so you have a comfortable temperature by the time you get back home. In order to pull off all of this passive and automatic functionality, I have mashed up several APIs from Google Latitude, WeatherBug, and ioBridge.

Using the API for Google Latitude, I track the location of my Android mobile phone. When I get near my home, I check the weather using Google Weather API, WeatherBug API, and my home temperature (via ioBridge) to see if I need to to use the air conditioner, the heater, or neither. If I do need to control the HVAC, I send the control commands using the ioBridge API that routes the commands to the IO-204 controller that’s hooked up to my thermostat.

This application is really just a beginning. Right after I got everything working, I started having a flood of ideas. I can see some real power here.

The ‘How To’ Portion of the Show

Google Latitude

You have to enable Google Latitude on your mobile phone and get your Badge ID. This ID represents your position in the world, your latitude and longitude. Visit the Google Latitude API site for more information.

Install the latest Geo::Google::Latitude Perl module from CPAN.org – this module completely abstracts the access to the Google Latitude API for you. All you have to do us pass your ID and the module returns the date, time, last known latitude and longitude (the values are in decimal degrees).

use Geo::Google::Latitude;
my $gl=Geo::Google::Latitude-&gt;new;
my $id="7832225593622256926";
my $badge=$gl-&gt;get($id);
my ($lat2, $lon2) = $badge-&gt;point-&gt;latlon;

Calculating how far you are away  from home

You have to figure out how far you are from home, you do this by doing some math. Oh wait, there’s a Perl module for that. Install Geo::Distance and all you have to do is tell it what latitude and longitude to compare and it spits out the distance.

use Geo::Distance;
my $geo = new Geo::Distance;
### Home Location
my $lon1 = "-79.76408";
my $lat1 = "39.980342";
### Calculated Distance
my $distance = $geo-&gt;distance( 'mile', $lon1, $lat1 =&gt;; $lon2, $lat2 ); # Use 'meter' to calculate distance in meters

Getting the Weather

You can use a number of weather APIs to get weather data for your home location. All you need to know is where you live. The easiest to implement is Google Weather (Weather::Google), but the WeatherBug API has a lot more information you can use for other Internet of Things things you may do.

 use Weather::Google;
my $gw = new Weather::Google(15401); # Zipcode
my $current_outside = $gw-&gt;current-&gt;{temp_f}; #Use temp_c for Celsius

Connect to ioBridge

All you have to do to connect with ioBridge is to send command via the ioBridge Widget API. First you create the control widgets for your heating and cooling system. For mine, I can use relays. Others may need serial strings, which you can send as well. Once you have the widgets created, locate there widget ID’s and send them to the API.

use LWP::Simple;
my $Air_Conditioner_widgetID = "Gb2Q1FUKPmzZ"; ### Replace with your widget ID's
my $Heater_widgetID = "9c3WEGHKemnzJ";
my $Inside_Temp_widgetID = "D32SDghy98iOu";
my $ioBridgeAPI = "";
$ioBridgeAPI = "http://www.iobridge.com/widgets/static/id=" . $Inside_Temp_widgetID . "&amp;value=1&amp;format=text";
my $current_inside = get($ioBridgeAPI);
### Test if the heater or the air condition should be turned on
if ($current_outside &gt;= 78 &amp;&amp; $current_inside &gt;= 72) {
$ioBridgeAPI = "http://www.iobridge.com/widgets/static/id=" . $Air_Conditioner_widgetID . "&amp;value=1&amp;format=text";
get($ioBridgeAPI);
}
elsif ($current_outside $ioBridgeAPI = "http://www.iobridge.com/widgets/static/id=" . $Heater_widgetID . "&amp;value=1&amp;format=text";
get("$ioBridgeAPI");
}

Putting it all together

Once you have the entire built all you have to do is call the app periodically using CRON Linux or Task Scheduler on Windows. Here is a TXT file of the Perl application with all of the parts tied together, probably will be easier to read and understand.

The hardware side uses the ioBridge IO-204 connected to the control lines of a thermostat or an HVAC control box. The lines switch at 12 volts, so I use relays trigger them. Other thermostats that I researched use serial lines which the IO-204 can tap into using RS-232.

It may seem like a lot of work, but just think about what is happening. Feeds from Google Latitude and WeatherBug are being processed and passed to your home network via the Internet. All of this is happening without your direct interaction – your things are working for you. I hope that you can see that is a start of some pretty amazing applications of technologies that will advance over time. A lot has changed in the past year, I can’t image what comes next.

If you get around to building a project like this, please drop me a line. I love this stuff.

Dominion Card Game Review and Storage Project

Thanks to my friends in the StruebSquad, I have been playing a lot of board games as of late. They started me off with some pretty stock games and then slowly introduced me to deeper Euro Games, Cooperative Games, Abstract Strategy, and Miniatures Games. Now I know what Meeples are, I have said, “I have Wood for Sheep”, and I have even oar raked another ship recreating an ancient naval battle.

Dominion Card Game Storage

The latest game I have been playing is called, “Dominion” by Donald X. Vaccarino and published by Rio Grande Games in the United States. Dominion is a board game style card game. In the box you get a number of action cards, resource cards, and victory point cards. Each game you pick 10 of the action cards which will be common for all of the players. With resource cards like Copper, Gold, Silver, and Potions, you can buy action cards, resource cards, and victory point cards. At the end of the game you add up the victory point cards and the player with the most points wins the game. Each turn you can play an action card and/or buy cards if you have the right resources. Dominion starts with collecting actions and resources and finishes with a race to gain victory points. During the whole you are striking a balance with resources, actions, and victory points.

I really love this game and my appeal for Dominion is three fold:

    • It’s highly re-playable – with new expansion and card combinations, you can play a new game almost every time
    • It’s really balanced – everyone has the same chances to get the common action cards, unlike a lot of other card games
    • It has a lot of strategy – you have to adapt to how other people play, find good card combos, and know when to switch between gaining resources to gaining victory points

Digression…

You might be thinking, “Hans, I have not heard of this game before, what gives?” My quick reply would be, “There are a lot of games out there,” Hans said gamely. If you have grown up in the United States, there are a few games that everyone has been introduced to – Monopoly, Sorry, The Game of Life, Candy Land – if you are “lucky” you might have played Risk, Scrabble, Stratego, and Trivial Pursuit. In general, you will notice that US favorite games are mostly luck based, meaning you use a randomizer (dice or a wheel) and then move a piece on the board. There is a big part of the game you can’t control, but in most cases these games are fun. Some of my best memories as a kid was playing games with the family and extended family. Now, in other parts of the world the games are less luck based and more choice based. Most European and Korean games are games played with a lot of choices. You have to choose what to do and each player has the same opportunity. As long as your playing board games, I am okay with either style of game or a game with a good combination of luck and choices. I recommend Lost Cities, Pandemic, Acquire, Settlers of Catan, Power Grid, and Divide and Conquer 😉 to name a few gateway games.

Regression…

The designer and publishers of Dominion have released multiple expansions and promo cards that add more action cards and twist to the base game. An issue of storage and portability comes into play. You want to take Dominion over to a friend’s house or to a convention, you would have to carry 4 boxes. After some research online [Labels, Box], I created my own storage solution. I took one box and pasted in dividers. Using card stock and labels, I then added dividers for each set of cards. The result is that all of the cards are in one box in order like a file cabinet.

Dominion Card Game Storage

Looks like there will be a new expansion for Dominion called Prosperity that is scheduled for release Aug/Sep 2010. Just maybe it will be ready for Gen Con 2010 that starts in early August this year. The good news is that I think that expansion will fit in my uni-box as well. The box is getting heavy.

It’s time for you to Throne Room + Woodcutter and buy Dominion and the expansions.