Friday, July 25, 2014

Tampa IoT Society – and the start of a new era

This morning before I started my client work, I took a few minutes to configure my highly customized Intel Galileo board and was able to successfully run Windows on a Very Small device.  I’ve order some really cool parts from SparkFun that I hope to integrate with the board over the weekend. 

MyGalileo

Also – today I am announcing that I am formally rebranding the Tampa .NET Microframeworks Group as the Tampa IoT Society. Our next meeting August 19st  will be dedicated to going through how to get started and what you can do.  I’ll also be sharing and discussing our vision of what we will be looking at for the next 12 months.

-twb

Friday, June 20, 2014

DataBinding 101 – AppCamp Materials

On June 20, 2014, I will be presenting on DataBinding for your applications at 2014 AppCamp Tampa.

And here are the completed demo files

 

-twb

Sunday, June 15, 2014

Cloud/Azure Based HVAC System at Casa De Wolf

The Problem

We live in a house that has four heating and cooling zones in it with a Heat Pump that isn’t exactly cheap to run.  The different zones makes the electric bill a little less painful in that we can only heat and cool the rooms we need to.  For example at night, we keep our bedroom relatively chilly at 68f while I let my office warm up to 80f.  While I’m working, I cool my office to 76f and let our bedroom warm up to 80f. 

To enable this heating and cooling we have thermostats in each room and dampers that shut off the airflow to the different zones when we don’t need to heat and cool them.  The brains for this is a small embedded controller.  Our house was built in the early 90’s and the controller is the original one that came with the house.  This means the user interface on this is very dated and setting it requires and engineering degree (we’ll not really but I’m the only that knows how to do it and it’s a major pain in the butt).  Also since it is so difficult to set, I’m sure we are wasting considerable energy heating and cooling rooms that we don’t have to and really have no way of monitoring the usage.

In addition the only control we had was at the zone level.  That means that to cool down one room we needed to cool down all the rooms in the zone.  This was a problem in that my office has a lot of computers and takes more to cool down than my wives office.  Her room was cold while my room was just relatively comfortable.

The Solution

Of the past few months I’ve been building a new controller for this, I created my own board base on STM32F407 with the following features:

  • Solid State Relays to Control the HVAC systems (cool, fan, compressor)
  • Solid State Relays to Open and Close the Dampers for the zones
  • Motor Controllers to control vents embedded in each room to heat/cool individual rooms
  • Ethernet MagJack and Controller
  • Real Time Clock
  • MicroSD Storage
  • Electric IMP

I have four Insteon wireless thermostats and have also hardwired a number of DHT22 Temperature Sensors so I could monitor temperatures in rooms without wireless thermostat.

So with all this hardware in place I needed some way to monitor the different room temperatures and determine when to turn on the HVAC system, open and close the dampers and vents.  Originally my plan was to just program everything on the primary board, but want to make sure I get the kinks worked out of the system first.  After all it gets very hot in the Florida summers and my wife wouldn’t appreciate any bugs in the software that would cause our house to get unbearably warm.  So I decided to write the controller software in .NET and have something I can easily update and monitor.  I needed a home for this and considered running on a PC on my network, but decided on putting this as an Azure Worker Role.

Basic workflow

1) Worker Role talks to the controller board and pulls the temperatures
2) It then compares the temperatures to the setpoints at a room level
3) It then determines which rooms and zones need to be cooled
4) After it figures out what it needs to do, it sends commands back to the controller board to activate the heat pump and open/close dampers and vents.

Programming

Programming the System is accomplished with a Windows Phone 8 application.  This updates the worker role, which in turn saves the settings to Azure Table storage as JSON.

Web Site

You can take a live look at my system by going to http://lagovista.cloudapp.net:8095/

Over time I’ll add some additional parts to this post as I evolve my system, but feel free to contact me if you want more information or have questions.

-twb

Wednesday, May 21, 2014

Last Mile Tips – Live at Tampa WP8 User Group Meeting

On May 20, 2014, I’ll be speaking along with Kelvin McDaniel and Nick Randolf to talk getting through the last mile on your application.

Here are the slides from the presentation:

-twb

Tuesday, May 20, 2014

Last Mile #6 – Start Putting in Graphics/Icons ASAP

When you build your application, don’t ignore the icons and graphics.  You may need some specialized graphics or icons for your application but in a lot of cases you just need some simple graphics for a button or similar.  You may be tempted to just use the same icon throughout the app  imagewith the idea to come back later and add some graphics all at ones.  I’ve found it’s better just to take a two-three minute detour to go ahead and find an applicable graphic add it to the app, see how it looks/feels as you use the app and add additional features and potentially replace it if necessary. 

One place I’ve found a great source of professional icons is from Syncfusion Metro Studio, what I like about their icons is that they have an app where you can search on icons by category and name.  When you find one you like you can customize the color, size and border.  They also go really well with a metro application.

-twb

Last Mile Tip #5 – Be Realistic

Ok, folks, this is ALWAYS they one the gets me when building a new application (or for that matter doing chores around the house).  A couple years ago, I started a weekend project to remodel our bathroom.  Originally I was disappointed that one of the fixtures I wanted to instimageall wasn’t available for a week, well it turned out I wasn’t ready for that fixture for about two months.  The project was much bigger than I had though of, I only pictured the rough work that needed to be done and didn’t think about any of the detail work or for that matter anything going wrong. 

You may have a great idea for an app you want to right, but be realistic.  If you have your unity license and setout to create the next Halo or Call of Duty app, well I would ask you to think twice.  Does that mean you shouldn’t sit down at your computer, open VS.NET and and start hacking away at something like that?  Maybe not, there are a lot of projects I work on that I  enter into with the knowledge that I’m not going to ship the app.  There are two primary reasons I do this.  First off is programming and solving problems is fun, second off and more importantly I consider this type of work “practice”.  When I commit to do something for a client that I’m going to get paid for, I don’t expect them to pay me to do “research” I want them to pay me to do “development”.  Just as with anything the more you practice the better you get, I just don’t like practicing on software that will go into production, so I try to keep my goals on software I ship realistic while I shoot for the moon on my fun stuff.

-twb

Sunday, May 4, 2014

Last Mile Quick Tips #4 – Keep Your Code Clean

As your creating your masterpiece take care to ensure that you keep your code clean.  One ByteMaster’s golden rules of software development imageis the only code that is guaranteed to not cause you problems in the long run is code that doesn’t exists.  What exactly does this mean?  use some basic principles, like DRY, Do not Repeat Yourself, refactor your code often, put some thought into your naming conventions, rather than commenting out unused code, just remove it.  If you do need to comment it out for some reason, add some comments as to why it’s commented out.  Although a personal preference, I try to keep my methods under about 20 lines, sometimes as little as 3-5 line.  Pick a standard naming coding convention and keep it consistent across your application.  One of my pet-peeves – if you are helping someone on an application, and they use a different naming convention, a you just know that yours is superior *cough* *cough*, swallow your pride and just following the app’s naming convention. 

Of course these are just touching on some of the basics, but there is a tendency when creating apps to think of them as something you can just hack together and publish, rather than something you need to put some thought into and engineer them properly.  Once you get to the final phase of your project if you don’t keep your code clean, you’ll be spending more time then you want just fighting with stupid stuff, tracking down edge cases and generally not having much fun.

-twb