Home Automation

First batch of custom Printed Circuit Boards received!

Yesterday I received my first batch of custom printed circuit boards. Printed circuit boards arriving in a box These are actually the 3rd set of boards that I have ordered, but I paid for premium shipping for them. The first 2 orders were made almost a week before these, and haven’t arrived yet. I’m testing to see how long the various shipping methods take. I’ll post the results once all 3 shipments arrive.

These boards mount directly behind the 4-switch wall switches used in my RV. Each can support up to 4 PWM LED driver circuits plus bluetooth and RF24 radios.

I plan on installing a few of these during my holiday time off.

Designing Printed Circuit Boards with Eagle

It never ceases to amaze me how much of a nerd I am. I absolutely love computerized, electronic technology. I don’t mean playing with things like Xbox or owning the lastest stereo equipment. I mean playing with the stuff that is used to create today’s leading edge products.
As mentioned previously, I’ve been playing with Arduinos, and recently teaching others about them. But now I’m ready to really expand their use in my RV.
I currently have 5 Arduinos installed in my RV, all communicating using inexpensive RF24 radios (nRF24L01). I’m still shocked at how low cost these things are. Total cost for each is about $7. At that price, I want to put one on just about every light and switch in my RV.
The ones I’ve built so far were put together using small breadboards. This works ok for fast prototyping, and is fun and easy, but they probably won’t hold up very well as we’re bouncing down the road (I mentioned that this is an RV, right?)
So I’ve started looking at more robust solutions. This typically means using printed circuit boards. Many years ago I made my own PCBs, either by dry transfer decals or etch resistant pen. But it’s really hard work, yielded only fair results, and isn’t easy to duplicate. Photo-resist techniques were available, but expensive and fairly touch also.
But today things are different. After doing some research this weekend, I’ve discovered that really great results can be achieved very inexpensively. Software is available free for designing circuit boards, and mail-order PCB manufacturing has become ridiculously cheap. The down side is that there is a pretty steep learning curve to doing this.
So that’s what I’ve been doing this weekend; installing and learning to use the free version of Eagle software. This software is used by the professionals, for example those great folks at SparkFun and Adafruit. And that’s where I found some great tutorials on how to use it. And the kind folks at Eagle support student and hobbyist activities by providing a free version for them. They only ask that we purchase a license if/when we start doing professional work with it. How cool is that?
The Eagle software is then used to create what is called “gerber” files. Gerber files can then be sent to a PCB shop for production.
The cost to do this? It depends on the size of the board made. But so far, my circuits ideas have been fairly small because I intend to use lots of small, simple units instead of fewer more complicated circuits. So I expect that any of my designs will fit onto a 5cm x 5cm board. These will cost me about $10 for 10 at iTead Studios. Yes, that’s about $1 each.
I can’t wait to get my designs onto PCBs!

Arduino Hackathon

After about a month’s preparation, we successfully conducted an Arduino Hackathon this past Friday. It was great to get more folks at work excited about all the things that can be done using this technology. I’m really looking forward to seeing what folks do with it, now that they understand it and have seen how easy it is to use. I’ll add some links to the Mutual Mobile website once pictures get posted there.

Playing with Arduino

I’ve been busy playing with Arduinos these past few months. I think I must have been locked in a cave the past 8 years or so. I’ve been shocked by how advanced and inexpensive these things have become. These things are awesome, and very inexpensive. I plan on installing a dozen or so throughout my RV to control just about everything. Couple that with my iPhone programming skills, HomeKit, Siri, and the new Amazon Echo, and this is going to be a high tech playground for me. Woohoo!

I had been struggling with getting nRF24+ radios working, to provide cheap communication between Arduinos. It turns out that a bunch of folks at MySensors have already implemented a very cool, open source solution along the same lines. This is an incredible site. The information there really helped me get my radios working. They’ve done a lot of good work to provide clear instructions on how to connect multiple Arduinos together using open source software. These Arduinos can then read various types of sensors in order to control all sorts of things. I feel like a kid in a candy store (“ooh, which one do I want next?”). The crazy part is the price of these parts. They have a really well done page listing out links to buy all the various parts at unbelievable prices. Thank you MySensors!

Unfortunately, I think I’ve let myself become spread too thin across exploring and playing with all these cool technologies. I’ve written an iPhone app and Apple Watch extension that uses the Lightblue Bean to display the level of the RV remotely. I got it working well enough to use for myself, but I haven’t taken the final steps to post it to the App Store so that others can use it also. It’s very close to being in a state that can be released to the app store, but I’d rather play with new Arduino projects instead of spending the time to finish and submit it. I’ve also setup several Arduinos to control fans and lights in the RV, but they’re still sitting on the workbench. I’m trying to get them connected to the internet so the Echo and iPhone can control them.

So now I’m going to try to be disciplined with myself, and focus on getting a few basic pieces done and installed before worrying about adding more advanced features. With the 3 day weekend coming up, I’m hoping to get the Lightblue Bean installed in my closet to control a string of led lights based on sliding door microswitches, and an Arduino Uno hooked up to control dimming some LED recessed spotlights that I installe over my booth workbench. I’ll post back later about how that goes.

Amazon Echo Arrived Today!

Another piece of my RV Automation project arrived today: the Amazon Echo. I’ve gone back and forth about whether to include an Echo in my project. My mind was made up last month though, when I received notification that Amazon was releasing an API to Alexa’s voice interface to developers. So I signed up for the developer program, and upon confirmation, I ordered an Echo.

Upon opening the box, I found the Echo, power cord, and remote control. Taking these out of the box, I found a single 2″ x 8″ instruction card that told me to plug it in, and then download the free Echo app. So I plugged-in the Echo, and a blue ring appeared at the top, with a cyan spot rotating around it. About 30 seconds later, the ring turned orange, and I was greeted with a very pleasant “Hello. Your Amazon Echo is ready for setup. Just follow the instructions in your Echo pack.”

Amazon Echo showing blue light ring

So far this is looking pretty good. Packaging is top notch, visual appearance is very modern and attractive, and the sound of Alexa’s voice is very pleasing.

So next I downloaded and installed the Echo app. I was a bit surprised to see that the Echo app only had a rating of 2.5 out of 5 stars. But proceeding on, the app downloaded quickly, then prompted me for my Amazon.com login upon starting. I was then instructed to wait for the orange light ring, and pressed Continue.

Amazon Echo showing orange light ring

I was then instructed to switch my iPhone’s Wi-Fi to connect to the Echo’s Wi-Fi hub (“Amazon-XXX”). Once I did that, Alexa told me it was setup, and to continue in the Echo app.

The app then prompted me for my network name and password. It then confirmed that I’d entered the password correctly, and completed the setup, ending with an introduction video.

The Echo app then walked me through saying a few things to Echo, like “Alexa, what’s the weather” and “Alexa, play It’s a Long Way There by Little River Band.”

I then explored the Echo app, providing information in the Settings pages, and running through Voice Training. This took about 30 minutes total.

Overall, setup was quite painless, and Echo seems to work great. Now my mind is racing on to all the things I’d like to do with it:

  • Control the lights in my RV
    Since my RV runs on 12v, I’m hooking up Arduino’s to control them. But there aren’t off-the-shelf solutions, like there are for normal 120v house lighting. So I’m expecting to need to use the Alexa API to route commands to a web server running on one of the Arduinos with an Ethernet Shield.
  • Control my Home Theatre and Stereo system
    Again, I may need to use the Alexa API to route commands to an Arduino with an IR interface. Someday I may be able to upgrade my TV and stereo to be directly controllable via WiFi or BTLE, but for now I should be able to simulate a universal remote.
  • Voice control my MIDI keyboard setup
    I’d like to be able to start/stop recording while I’m playing piano.
  • Query status of various inputs (temperature, humidity, level) related to my RV
    Even better yet would be to get notified when something is amiss, such as a leaky RV roof seam.

I could probably dream all night about this sort of stuff, but I think I need to pick something and try my hand at using the Alexa API. I’ll report back later my experiences doing so.

RV Automation using LightBlue Bean

I’ve started playing with the LightBlue Bean as a part of my RV Automation project. This $30 part combines a low power, 3.3v Arduino board with Bluetooth LE, several sensors, and an attached 3.3v watch battery. This means that it can be used to do a lot of jobs without any connections whatsoever, and it can talk with an iPhone over BTLE.

I first heard about this part from a github article that my friend Sean wrote. It’s a well written article, fun to read, and I recommend that you read it. Thank you, Sean.

What Can I Do With A LightBlue Bean?

Using Bluetooth

I think the best thing about this part is the built-in blue tooth.

iPhone Connection

I expect the bean to be a bridge from my iPhone to other Arduinos. BTLE makes it very simple to interface to an iOS device using

iBeacon

I may be able to take advantage of the fact that any BTLE device can be configured to act as an iBeacon. This will enable the iPhone app to determine proximity to it. This leads to all sort of automation possibilities:

  • Turning nearby lights on/off
  • Disabling security system when near
  • Unlocking doors

Of course, security will be important, so I’ll have to consider carefully the use of a passcode or some other system to prevent allowing unwanted access if my phone is stolen.

Using the built-in 3 axis accelerometer

The bean also includes a built-in 3 axis accelerometer. This means that it can detect motion in any direction.

Security System

One of the shortcomings of living in an RV is that it moves when walking around inside of it. I’m planning on turning this into an advantage, and use this as a component of my security system.

Leveling

The accelerometer will be used to help me level the RV when parking. Since gravity is indistinguishable from acceleration, it makes a great way to check for level. I’ll need a way to calibrate the level settings after mounting the bean, and I’ll want to convert the accelerator readings from Gs to angle for display on my iPhone.

Door Motion

Another possible application, but one I don’t plan on using at this time, would be to mount the bean to a door. Since it’s battery operated, this could be as simple as just sticking it onto a door.

Using the Temperature Sensor

This is a no-brainer, but does require me to think about where I mount it. Do I want interior or exterior temperature readings?

Using the RBG LED

Status Display

I expect to mount the LED such that it can be used for displaying status of some sort. It can display any color, and be dimmed and/or blinked, allowing for a large range of indications.

Interfacing with Other Arduinos

I expect the bean to be a bridge from my iPhone to other Arduinos using inexpensive RF24 parts. These can be purchased for under $2 each.

Replacing the Battery

I expect to connect it to my RVs 12v system eventually, so I don’t have to keep replacing batteries. This will require a 3.3v regulator. The LD1117v33 is available from Amazon for under $2.

HomeKit

I’ve been playing with Apple’s new HomeKit framework. It attempts to provide a way to integrated all your automated home devices, allowing a single app to control them all. Even better, Siri can be used.

This is still early, so we’ll have to see how it plays out. But you can bet I’m going to be looking at how to use this technology in my RV. I’ll be blogging about it going forward.