Bridging the Gap Between Nest and Line Voltage Thermostats

nest

I recently decided to switch my old thermostat to a Nest and figured that it should be easy considering my current thermostat just controlled a simple electric wall heater. Unfortunately, it was only after taking my old thermostat off the wall that I realized that it was in fact a line voltage thermostat (Honeywell’s T410AA), which means that it uses high voltage (240 V) and acts as an in-line switch between the electric wall heater and the power supply. The problem with this is that systems like the Nest run off of low voltage (24 V) and can’t be used to switch a high voltage system.

To fix the issue I started researching. Surely I wasn’t the only person who wanted to switch their old school line voltage thermostat with a Nest! Unfortunately, a bunch of the solutions were on Nest’s old community site which had since been taken down. However, I was able to find out about a relay/transformer that according to the reviews should be able to bridge the gap between line voltage (240 V) and the typical low voltage setup used for modern thermostats like the Nest (24 V). The schematic for it shows the method for hooking it up to known thermostat wires.

aube-relay

The Aube Relay RC840T-240 does exactly that. It takes 3 wires carrying the line voltage (connected to Black, Blue, and Red) and then connects them out via 3 wires (R, C, W) carrying low voltage. This works to connect the line voltage wall heater with controls from the Nest system.

thermostat-wiring

After connecting everything up, I tested the Nest to see if it worked and low and behold! It worked like expected. The only thing left after wiring and testing the setup is to mount it properly. However, the relay/transformer does not fit inside the original electrical box so I will need to devise a workaround to get it to all fit within the wall up to code.

Read the Continuation here: http://blog.anthonyngu.com/2017/01/10/finishing-touches-installing-nest-w-line-voltage/

Unboxing the Bluz Dev Kit – Kickstarter

logo_nobg
In April of 2015 I found a Kickstarter called Bluz which offered a cloud-connected Bluetooth LE development kit that could be run off a coin cell battery for months or even years on end. The Bluz is very similar to a product called the Particle Photon released earlier last year and the Photon has quickly become one of my favorite development platforms for developing Maker projects. I figured that a Bluetooth LE dev kit would be a great addition to my maker tools.
DSC_5101.00_00_11_32344.Still001
After a bit of wait, it arrived on my doorstep and I figured that I would record an unboxing video and a simple test with the Bluz.
Since I pledged $49, I received what they call the Wearables Kit which included one Bluz dev kit, a Coin Cell Battery Shield and an Accelerometer shield.
sparkfun_imu
The accelerometer shield that I received was not a custom Bluz created one, but actually a Sparkfun branded shield that I had already purchased on my own (an extra never hurt).
battery_shield
The coin cell battery shield is unique to the Bluz and allows it to be powered off a single coin cell battery. Included in this shield is an on/off switch that is surprisingly missing from the number of other battery shields that I’ve bought and tested.
bluz
The Bluz itself looks very similar to the Particle Photon and actually has the same footprint so that it can take advantage of the same shields as the Photon. It even piggybacks off the Particle’s online development tools and the same deployment pattern (aside from the need to be hooked to a gateway that I’ll talk more about later). One big difference in the immediate presentation of the Bluz is that it does not have a micro USB port for powering it. This is partly due to the fact that it can supposedly last longer periods of time on very little battery and its primary purpose is to not be continually connected to an outlet. The’ recommended method of powering it is to use the coin cell shield, or the VIN, or 3.3V pin
For my unboxing, I didn’t have a method of powering it through the Vin or 3.3V pin directly or a coin cell battery lying around, so I decided to use a Particle Shield Shield in order to breakout a DC Power connection (which ends up powering it through the Vin pin anyways).
The major thing to know about the Bluz is that it needs to be connected to a gateway or the Bluz iOS or Android apps in order to communicate to the cloud. While there are plans to open source the iOS and Android connection code, they haven’t been released yet and this is a pretty big limitation for anyone like myself that wants to use a direct communication line between Bluetooth devices and the Bluz. However, Bluz sells a gateway shield that can be attached to a Particle that allows up to 8 Bluz to connect to it and communicate to the cloud.
gw_shield
Also, I have yet to test out the claim that it can last months or years on a single coin cell battery, but will be using it future projects and will be testing this out. There is one difference in the code that supposedly helps the Bluz achieve this feat. The code inside the loop function contains a System.sleep call in the default sketch.

I expect the Bluz to be a worthwhile investment and can’t wait to see what kinds of projects I can build with this low powered Bluetooth LE dev platform. I love that they leveraged the Particle ecosystem and online development IDE as well.

Hackster Hardware Weekend (Hackathon)

I had the chance to participate this past weekend in a Hackster.io Hardware Weekend in Seattle and was blown away by the setup. Like most hackathons, they had big sponsors like Intel, Microsoft, Spark, AT&T, etc. However, unlike most of the software hackathons I have been to, they provided some hardware for people to use including Intel Edison boards with Seeed Studio Starter Kits and more. They also provided some cool and useful swag like a portable charger (which I used to power a Spark Core for my demo) and a small portable Leatherman pocket tool that is perfect for my recent maker lifestyle. The energy they provided was just spectacular and even though it was their first time hosting a hackathon, I think it went smoothly.

The food wasn’t just your normal pizza and salad hackathon meals. It also included a legitimate breakfast with bacon, eggs, bagels, cheese, etc. Lunches and dinners were comprised of delicious sandwiches (kind of like Banh Mi), mexican food, and one meal of pizza. On the side they have a whole bunch of candy, popcorn, and more snacks along with the steady supply of coffee, soda, juice, and water.

Unfortunately, like with most hackathons, the crowd of participants thinned out by day 2 with most of the remaining people being interested in learning more or deeply involved in the hacking process.

I came to the event without a clue as to what I was going to build and not really sure if I wanted to join a team, make one, or run it solo. After hearing about some of the prizes for using certain APIs (Weather Underground and WebRTC) I decided to focus my time on the Weather Underground APIs. Even after deciding what I wanted to use, I didn’t really have a clear understanding of what my final product would be and how it could change the world. I just decided to start hacking something together that I thought would be cool to own and ended up going down the path alone.

Stages of my Creation:

  1. Started with the idea to read the forecast for the day and display it to you through an small LCD screen so that I wouldn’t need to pull up an app to view the forecast. Decided to use the Intel Edison, Cylon.js, and the Weather Underground APIs to do this.
  2. Added functionality that would open your windows using a servo if your indoor temperature was past your comfortable zone and the outdoor temperature was colder. I also added functionality to change these settings through buttons and rotary angle sensors on the board.
  3. Added functionality to push the data to the cloud
  4. Realized that I could also connect to a Spark Core and communicate with it via WiFi and the Cloud from the Intel Edison, so I integrated a lighting scenario with a wireless connection.
  5. Created a prototype case for the now deemed “Hub” in Autodesk Fusion 360.
  6. Created a webpage using AngularJS on Azure that would showcase the data my back-end was receiving so that I could view information on the go.

The prototype Open Source Home Automation Hub was born.

Some things I’ve come to realize for my next hackathon:

  • Work in teams! I worked solo this weekend and although I did a lot of work to combine all the components, I definitely could have gone further with the idea and took it to the next level ending up with a professional product rather than a hacked together demo.
  • Set up a team before hand and know the expertise of everyone in the team and how best to leverage them. (This also might mean vet out the people who might have less to contribute if you are going hardcore)
  • Sometime’s it’s more about the presentation, the story, and the idea than the execution during the hackathon (although that might be due to the hardware nature of this hackathon). After all, you only have so much time both to hack and to present your creation.
  • Network! This is really just a great opportunity to meet other people in a related field and find out their skills and platforms of choice. Who knows? You might find a couple new tools that might be useful for your future endeavors.
  • Roll with it. A vision is great, but be able to adapt if things don’t work out quite like you expected.  Sometimes code breaks and it can be stressful but learn from it and debug better.
  • Have fun!

Updated Experience with Spark Core

After a week of continual use with the Spark Core I have an updated view on the Spark ecosystem.

It’s incredible how easy it is to develop and connect your core to sites developed in Node.js (check out the project I made: http://sparkrgb.azurewebsites.net/). The biggest part of that project was making sure the RGB strip worked and the UI for the website interface. Connecting the two together was the simplest part. The only major disadvantage to using the Spark ecosystem is the fact that you are required to use their Spark cloud to communicate to your device. (Although they are open sourcing a spark-server on Github, it uses the same format as the Spark Cloud.)

Here are some of my personal remarks on the ecosystem:

  • Connecting the Spark to a Mac is pretty easy through USB, but doing it on your Windows machine requires a little more driver interaction. See my blog post on that here.
  • Resetting your Spark’s preferred WiFi connection with the mobile apps is horrible when you compare it to the simplicity of using the command-line interface on your development machine through USB.
  • The Spark Core remembers 7 WiFi credentials. If you add an 8th it will remove the 1st.
  • In order to compile an INO into the firmware, an internet connection is needed on your development machine at least, so there is no way to develop on a self-contained network even if you do not plan to use internet connected capabilities.

Overall, I think that the Spark ecosystem provides the best experience for developing IoT devices currently.

Add Speech Recognition Easily!

Just found out about a cool HTML5 Web API that is built into Google Chrome.

microphonedisabled

Since it is vendor prefixed, this API will only work if a user’s browser supports it (for now Chrome). The cool thing about it though is that in order to use it on your site, all you need to do is write some javascript that checks for “webkitSpeechRecognition” and then creates an instance of it, and then use it. Combine this with your IoT devices and you’ve got voice enabled commands for your interacting with your devices!

This tutorial walks you through the basics of how it gets integrated:
http://updates.html5rocks.com/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API

This is the full sample: https://github.com/GoogleChrome/webplatform-samples

Developing for Spark through USB

Although the Spark Core is perfect for IoT developers, you don’t NEED to connect your Spark Core to WiFi to code on it or have it run some firmware. (Although you will need it on your development machine)

By placing the following line of code at the top of your file, your spark will not try to connect to the internet when booting.

You will need to install spark-cli and login:

To flash your code onto your Spark via USB, your spark core needs to be put into DFU (Device Firmware Upgrade) mode:

  1. Hold down BOTH (RST and MODE) buttons
  2. Release only the RST button, while holding down the MODE button.
  3. Wait for the LED to start flashing yellow
  4. Release the MODE button

The core should now be in DFU mode

You will also need to install dfu-util and add it to your system path so that your development machine can recognize your Spark core and flash it.

(If you are using Windows, I suggest dfu-util-0.8-binaries.tar.xz)

Here is a great tutorial for installing the DFU driver. They use Zadig to install the driver for the Spark core so that your development machine will recognize it.

Once you open Zadig, click Options -> List All Devices
Select the device “CORE DFU” and the “libusbK” driver, then click Install Driver.

Now you can open up your terminal again and type the commands:

(Note: You will need to set your Spark to DFU mode every time that you want to flash new firmware onto it through USB)

Node.js with SparkJS on a Website

Never used Node.js before? Want to test out SparkJS? This is the guide for you.

Background: I have done some development in Node.js before to build websites and small maker projects, but it has been a while since I touched Node.js, so I needed a refresher when I decided to work with the SparkJS package.

Things you will need:

Install node & npm

This will start up the basic express web server that you can navigate to from a web browser by going to the url: http://localhost:3000/

Create an index.html file in your myapp\views folder with the content from here:

Add another line at the end of the index.jade file that says

The whole project can be found at https://github.com/anthony-ngu/sparkjs-example

In order to download the proper node modules, you will need to run the following command from the example directory:

Reading Material: