Thursday, February 20, 2014

Pretty little lights

I've been busy investigating LED technology and I've learned a few things like many cheap LED bulbs don't work well in a table lamp. I've also learned about bulb type and shapes, color temperature, color rendering index (CRI), that LEDs fade over time and LED WAF. I've found a few bulbs that work (so far, let's see how long these things last). I am worried about cheap bulbs and bulb life. If I understand things correctly, my LED bulbs will slowly fade over time, cheap bulbs more so as they push the components past design recommendations. I've already seen CFL bulbs die a smokey and smelly death. I'm hoping that won't happen with LED bulbs.
Since LEDs are small, it might be time to rethink the light fixtures. I've seen a number of interesting lamp/light designs. So with that thought I picked up a Adafruit NeoPixel RGB LED Strip. I plan on using them on the Dollhouse. It should be interesting to see how they get used an what I can do with them. I intend to control them with the chipKit Pi from Pytomation on the Raspberry Pi. If I understand the interface correctly I'll need to setup the ChipKit board to have 8MHz SPI setup. More on that later.

Labels: , ,

Tuesday, February 18, 2014

Raspberry PI, topped with a chipKit Pi

In a previous posting I hinted about using the chipKit Pi instead of the Arduino Uno with my Raspberry Pi and the Z-Wave board. The chipKit board fits nicely on the Raspberry Pi and gives me the equivalent of a serially connected Arduino on the IO header of the Pi. Using the chipKit_Pi with Pytomation instead of the Arduino will give me a nice platform to interface to my Dollhouse. In addition the Z-Wave interface makes for a nice demonstration of technology that normal consumers can buy. Hopefully I'll be able to do a few preview demonstrations at IXR before TCF 2015. I'll definitely need a few more Z-Wave devices before then.

My choice of hardware has confused a few people. They ask why one or the other. A lot of what I do involves the internet. I love the Arduino, it's inexpensive, small, supports plenty of libraries and easy to use. But I don't want to try and squeeze IP support into such a small processor. Team that up with a Raspberry Pi instead of an Ethernet shield and the ease of programming provided by Linux and the Pi makes the extra cost more than worth it. Now choosing between an Arduino Uno and a chipKit Uno32 comes down to more what I have on hand more than the cost of the 2 boards (Uno32 is more expensive). The chipKit does edge out the Arduino in CPU and system resources. So when it comes time to decide, it is the right tool for the job. :-).

Oh and that tight timing I mentioned above, that would be the 60 LED/meter strip I'll be working with. At the moment I'm not sure how it will be used in the Dollhouse but I know it will.

Saturday, February 15, 2014

Refactoring my HA system

Things have been settling down a bit and I can finally get back into my HA projects. I started looking at what I have, what I want, what is available and reviewing what I've written. For the last 2 decades I've been running Misterhouse and works well enough but I feel that it needs a bit of work and that Perl 5 isn't the best choice for OOP that HA needs to take advantage of. There are other reasons but those will suffice for this discussion. I actually started to write my own HA project in Javascript using Node.js. I created the Irrigation Control package with Node.js. I really like it though the asynchronous nature of Node.js took a lot of getting used to for me. One problem that Node.js has is that if an event's processing takes a long time or hangs, the entire program waits with it. This is where a bit of threading would be nice (threading causes other difficulties). While there are ways to work around the lack of threads, I find that I need to bend over backwards in my thinking to do so. So I've been looking for some other solution that has the asynchronous and the threading support needed by today's HA systems. I know Python has both.

Enter Jason Sharpee's Pytomation, written in Python it's clearly OOP based (and I have a lot to learn on that front). Pytomation uses the Twisted library for asynchrous events and has built in support for threading/multitasking. I've made the effort to get it running on my Linux system and it's working well with an Arduino as my digital and analog devices to control. I still have a ways to go but I'm pretty sure that I can have something working well enough to do a new HA presentation for the Trenton Computer Festival. I've done HA Presentations there in the past and I'd like to reuse the Dollhouse with additional devices to control. I think Pytomation would work great and I have a lot of new devices; Connect by TCP lights, WeMo outlets and chipKit/Arduino controlled RGB LEDs for starters.