"Bitcoin + Azure + Traffic Light"
- Posted: Apr 18, 2014 at 6:00 AM
- 12,286 Views
Chris Walker, Friend of the Community and Blog, hardware geek extraordinaire, Matt Cavanagh bring us
For Microsoft Build 2014, the Internet of Things team at Microsoft put together a very cool Netduino-powered traffic light.
Here's what it looks like on the inside:
The Netduino Plus 2 inside the traffic light can also pull down Bitcoin data from Azure in real-time, displaying the value changes as they happen (green = value going up; yellow = value steady; red = value going down).
Here's a great blog post by Matt Cavanagh, explaining how to put together your own Netduino-powered Bitcoin Traffic Light:
And here's a quick video of the demo in action (with an RGB LED instead of the life-size traffic light):
This same code could be reused to indicate when a big software build completed, to indicate the current air quality in a building, to warn of little-time-remaining in a meeting, etc.
Thanks a bunch to Matt Cavanagh (roguemat), to the IoT team at Microsoft and to Philip Lo and his NETMF dev team at Microsoft for enabling, building and showcasing this IoT demo at Build! [GD: Post taken in full]
If you haven’t heard, “the cloud” is kind of a big deal right now. Microsoft Azure is Microsoft’s slice of it (with 54% of Fortune 500 companies running on Azure today), and is the reason that when you take a photo on your phone it magically appears on your PC (amongst other things). No one understands the cloud, but we know it is powerful
At BUILD 2014, Microsoft announced their plan for allowing everything from your teddy bear to your traffic light (because people totally have these) to connect to Azure. And yes, this includes connecting up a full sized traffic light…
What does that mean? Well, you could hook up your sprinkler system and a soil-moisture sensor to Azure and water your plants from half-way across the world. Or get a push notification to your phone when your significant other raids the cookie jar. Or just about anything else that involves moving data from one place to another without needing to setup any infrastructure.
That also falls in nicely with some stuff I’ve been working on with the team at SecretLabs (the Netduino and AGENT makers) to make it really easy to hook up their devices to Azure, and to get things like sensor reading into the cloud with minimal effort.
So to create a nice little illustration of the IoT running on NETMF, I created a simple demo. This is based off Netduino and Windows Phone Bitcoin tracker on Azure. [Steve Teixeira's awesome traffic light demo at BUILD 2014 was based off of this code.]
There are 2 variations (well, 3 if you include the one that was used in the presentation which is very similar to the latter):
BTC + Netduino standalone
In this demo you connect an Ethernet cable to a Netduino, which then pulls the latest Bitcoin price from an Azure service. To display the result (price up/down/steady), we use a traffic light (or some LED’s if you don’t have one handy).
WP + BT + BTC + LEDs
In this demo you pair a Windows Phone with a Netduino (via a Bluetooth module on the Netduino). By tapping any of the first three circles it will tell the Netduino to change the color of the traffic light/LED. By tapping the bottom circle (the BTC one), the Windows Phone will automatically send color commands based on the BTC price.
To start with, let’s look at the Azure service which is common across both variations.
BTC + Netduino standalone
The Netduino code isn’t too complicated. It basically just constantly downloads the latest price and then changes the state of the LEDs. If the price goes down it will show red, up shows green, and stable/no change shows yellow/orange. When the LEDs change to red or green, there is a 30 second delay before it will switch back to yellow – this is to make it clearer because else it would just flash for a second.
WP + BT + BTC + LEDs
In this variation the Windows Phone connects via Bluetooth to the Netduino. Wire and code it like in this post on Bluetooth with Netduino and WP8.
The UI on the Windows Phone app is pretty straightforward, and uses a bunch of visual states to control which circle is selected.
So although these were pretty trivial examples, they’re a good introduction into using external services on anything from a consumer phone/tablet, to a programmable microcontroller.
Note that nothing here is using the new SDKs I talked about above – but once those launch it will be considerably easier to hook your Netduino into the cloud.