Jump to content

Building an Open Source Nest


Turk

Recommended Posts

By The Spark Team January 17, 2014

Earlier this week, Google bought Nest, a connected devices company, for $3.2 billion. This might seem like an ungodly sum for a company that makes thermostats and smoke detectors, but it makes absolute sense. Nests products are beautifully designed, their team is overflowing with talent, and they were the first company to figure out what the Internet of Things means to consumers and deliver products that people actually want.

But in order to do this, Nest had to spend millions of dollars on R&D to build the basic infrastructure behind the product. The high cost made it impossible for anyone but the extremely well-capitalized to enter the market and create connected things.

Well, we want to change that. At Spark, were making it easier to bring connected devices to market with the Spark Core, our Wi-Fi development kit, and the Spark Cloud, our cloud service for connected devices. And to prove it, we built our own approximation of the Nest Learning Thermostat in one day and weve open sourced everything. In this process, weve come to respect the incredible technical challenges that Nest has solved while also coming to understand how much the game has changed since they first started.

http://s3.amazonaws.com/blog.spark.io/finalproduct.mp4

Fair warning - were not claiming to have matched the Nest thermostat in a day; far from it. But remember every polished product starts as a rough prototype. As Alexis Ohanian said last week, The first version of everything you love is janky!

Hardware

First, you need hardware. In our case, that means sensors for temperature and humidity, plus a motion sensor to figure out whether youre home, and relays to control the furnace and the fan. We also need a display so you can see the current temperature, and an enclosure to protect the messy bits.

http://s3.amazonaws.com/blog.spark.io/breadboarded.mp4

The first thing we did this morning (after whiteboarding our attack plan) was to breadboard the hardware. Breadboarding is a non-permanent way to create an early hardware prototype. We chose a number of components for this product:

The Spark Core served as our connected brain.

We display the temperature on a few Adafruit 8x8 LED matrices. The interface for the displays is a common I2C bus.

The primary sensor is a Honeywell HumidIcon temperature and humidity sensor, which shares the I2C bus with the displays.

For our MVP, we decided a couple LEDs could represent whether the heat and fan were on. In the end the same pins would be connected to relays instead of the LEDs.

If you want to save energy when a persons not home, then you need a way to know when they are home so you can err on the side of comfort again. We added a Panasonic PIR motion detector.

All in all, it took about an hour to throw together this breadboarded prototype, although we had to order the components a couple of days beforehand. It took another couple of hours to pull together working firmware (see the software section below).

http://s3.amazonaws.com/blog.spark.io/cncmilled.mp4

The next step is to build an enclosure. The Nest enclosure is glass and aluminum, which are both very pretty but not very handy for prototyping. Instead, we chose acrylic and wood.

First, we CNC milled two wooden rings: one to act as a stationary base, and other to spin freely as a temperature controller (turn the ring clockwise to increase the temperature, and counterclockwise to decrease the temperature).

http://s3.amazonaws.com/blog.spark.io/lasercut.mp4

Next, we laser cut three acrylic disks: one to act as the faceplate (which we later sanded to make it frosty), a second to act as the wall mounting plate, and a third connects the spinning wooden ring to a potentiometer.

http://s3.amazonaws.com/blog.spark.io/enclosure.mp4

Once we completed the enclosure, we converted our breadboarded circuit into a more permanent design by permanently soldering the components.

http://s3.amazonaws.com/blog.spark.io/mohitsoldering.mp4

Software

Next, you need software. Some of this software runs on the thermostat (often called firmware), reading data from the sensors, controlling the relays, and displaying data on the screen. But since this is a connected thermostat, we also want a web interface so that it can be controlled from your smartphone or computer. And since its a learning thermostat, we also want to do some machine learning so that we can over time improve your comfort and energy efficiency. This software will run in the cloud.

http://s3.amazonaws.com/blog.spark.io/workingproto.mp4

Firmware is called firm because its traditionally more locked down than software, since it runs on a little chip that usually is never accessed again after the product is delivered to the customer. But adding an internet connection changes things pretty significantly. Firmware is no longer firm when you can update it from anywhere with the click of a button. With a Spark Core, you can flash new code onto your chip using our web IDE.

http://s3.amazonaws.com/blog.spark.io/joescode.mp4

Our thermostat is complemented with a cloud-based web app that handles all of the complex logic of the thermostat. By doing this in the cloud, we can iterate faster using high-level programming languages and frameworks like Ruby on Rails rather than low-level embedded C.

The Spark Cloud exposes your connected device through a REST API. That means that you can interact with it from any language that can generate HTTP requests, which is basically anything.

The beauty of a connected device is that it can be constantly improving, whether its by updating the firmware, updating the cloud software, or by using machine learning to optimize and improve the logic of the device.

http://s3.amazonaws.com/blog.spark.io/softwareinaction.mp4

Our user interface is a simple web app with a javascript knob that lets you select the desired temperature. The UI also includes a graph of historical temperatures, because data.

Connectivity

Once youve got your hardware and your software, its time to link the two worlds.

Somehow youve got to get your thing online, and there are dozens of ways to do this. The simplest method is by adding a Wi-Fi module, so your product can act as a client on your local Wi-Fi network.

The Spark Core has a Wi-Fi module built in, and because its integrated with the micro-controller, connectivity is made easy. The Core automatically connects to the Spark Cloud through an encrypted tunnel, so youve got a secure connection to a cloud gateway out of the box. No programming the Wi-Fi module, and no finding or building communications protocols.

Putting it all together

Once our thermostat was complete, it was time to assemble it all together into the final package and mount it on the wall.

http://s3.amazonaws.com/blog.spark.io/underthecovers.mp4

All in, we spent about $70 on components to put this together (including $39 for the Spark Core); the wood and acrylic were free. We started working at 10am and finished at 3am, with 3.5 engineers involved (one went to bed early), and the only work we did in advance was order the electronic components.

Get excited, crazy things are possible.

Were not saying that you can build a $3.2 billion company in a day. But we are saying that you can build a $3.2 billion company, and its easier now than its ever been before.

Connected devices/Internet of Things/M2M/Industrial Internet is a certified big deal, and the Nest acquisition proves it. It doesnt matter whether youre a software developer with no hardware experience, an embedded designer with no web experience, or a psych major with no experience whatsoever. This is the next frontier, and its time to check it out.

Your billion dollar company starts with a million dollar product, and your million dollar product starts with a hundred dollar prototype. So what are you waiting for?

To download the open source files for the Spark thermostat, visit our Github page.

http://blog.spark.io/2014/01/17/open-source-thermostat

Link to comment
Share on other sites


  • Views 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

  • Turk

    1

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...