September 8, 2011

1 JeeLink and 2 JeeNodes go to a bar ...

I find myself in an interesting situation where I have one house near Denver and one apartment in Steamboat Springs. Our family is going to live in the apartment the whole year with an occasional trip down to Denver every once in a while. To be able to keep an eye on things and reduce the power footprint while retaining as much comfort as possible when we go back, I set out to automate a few things in the house. I had looked around for things and had tinkered with PIC MCUs in college but I had never done much with them except a water fountain game for the kids located under our deck. More on that later.


One of the main issues is cost of course, as with most tinkerers, this is not serious enough that I would want to invest in a commercial solution or expensive electronics platforms. I looked at the arduino platform because it's obviously very popular and so modular that a 4 year-old could put something together without knowing anything about electronics. Unfortunately, I did not find anything "arduino" that met another one of my requirements: wireless simplicity.


Enter JeeLabs.


I stumbled upon the work of Jean-Claude Wippler (widely known simply as jcw) and the JeeLabs community at large, which counts lots of very active and really helpful members. What I really like about this community is that they are not going to belittle the new comer who knows little about the platform but au contraire, they will teach you how to fish instead. This has been one of my most agreeable and educative experience to date.


The merits of the JeeLabs platform are many but let me name a few that really helped me get things done instead of spending countless hours figuring things out:

  • It is somewhat "standard" as it builds on the arduino strengths and makes things even easier
  • Arduino libraries are functional right out of the box, you only need to know pin numbers are shifted on your JeeNode compared to the Arduino
  • It has an ULTRA simple, fairly reliable and pretty good range radio module making your setup instantly accessible over wireless. THAT alone is awesome. The radio module it sports isn't as reliable as other more expensive solutions are (XBee comes to mind) but it is absolutely good enough for most applications around the house. To draw a parallel, I would use this one: over IP networks, the same difference exists between TCP and UDP. TCP is reliable. UDP is not. It does not mean that UDP is UNRELIABLE. Get the nuance?
  • It is rock bottom cheap. You can get a JeeNode on ModernDevice for $22. That's with radio. C'mon. How's that even possible...
  • JeeLabs makes lots of simple yet useful "plugs", so there very little you will actually need to do yourself. It's more like Lego than electronics really, there is no glory in putting something that works together, they have already done all the work of making it easy. Literally plug and play.
  • There's also a nice JeeLink which is nothing more than a JeeNode in a USB stick format. That thing is sweet! Stick it in your USB port, start talking wirelessly to the other nodes or write your Perl/python/ script/program to drive all the nodes on your network.
Here's what I had in mind for my particular situtation: I needed to be able to control the heater / cooler in my house to be able to turn the heat up a couple of days before going home so we wouldn't find ourselves sleeping in a house at 5C (40F).

So I set out on an experiment and bought a JeeLink and JeeNode with 2 relay plugs to see if I could make a JeeNode turn the heat/cool/fan on remotely.
Unsurprisingly, the hardware part of it took all of 2 hours to solder the components on the boards and debug the lousy soldering points by resoldering a couple of times.
What was more surprising is that even though I had not written any C since 2004 (so 7 years give or take) it was very easy to find examples that I could tweak to do what I needed. So in about a day's worth of work, I had a way to remotely control the HVAC.

But I needed to make this whole contraption a wee bit smarter so it could replace the regular thermostat for good. I bought a second JeeNode that I rigged with 3 temperature sensors:
  1. indoor temperature: the sensor sits right on the JeeNode board. This temperature is used to trigger the HVAC in the appropriate mode.
  2. outside temperature: the sensor sits on a window sill outside. This temperature is used mostly for monitoring purpose and it allows the central software to be a little smarter than the regular unit by avoiding, for example, turning the AC on in summer if the outside temperature drops below the target temperature, which frequently happens at night in summer in Colorado.
  3. duct temperature: the sensor is tucked in the air vent where it can measure the output air temperature of the HVAC unit. This is helpful as a feedback mechanism to make sure that the heater or cooler actually work when turned on. If it doesn't, the central software will send me an SMS with Twilio.
All in all, it took me an entire week, working on it off hours, after work or on the 2 week-ends, and the most time was actually spent on the software part, I had to contribute fixes to java libraries for Pachube where I put my temperature metrics and figure out some timing conditions using RXTX but overall it was a great learning experience.

So: what will you do with your JeeNodes?

No comments:

Post a Comment