Smart Farmers

Last week I held a presentation on urban evolution and the digitalization of our cities at the Swedish TechDays it was a conversation on the drivers behind the smartness or our cities. On how internet of things was enabling this.


If internet of things can digitalize our famers. Our cities can’t be far behind. The above image is from my technology vision talk, I shared this in the smart cities talk because I believe that what is happening here is important. We are not seeing robotic cows, but we are seeing the blur of the physical and digital worlds.

When a farmer painlessly can put a chip into cow and let it transmit data. Correlate that with data on milk quality, weather, food and all other data possible to capture. The farmer will embark on a journey that makes his business digital.


Similarly to what I discussed in my post about smart vending machines the farmer can draw insights and get a better understanding of his business. He can use these insights to optimize his farm and ensure the best quality of milk.

But this digitalization opens up for other business models as well. What if this farmer sold his insights to other farms? He could be rewarded for the effective way he runs his farm in more then one way. He could create new revenue streams. For a non-digitalized farmer this would be unthinkable.

For a digitalized farmer, this is just the art of the possible realized.

MicroControllers are fun

I am preparing for my participation in TeliaSonera M2M symposium and the Swedish TechDays. Since my focus is internet of things I am playing around with the Arduino and Microsoft Intelligent System Service. This took me way back to school and the old Motorola 6X000 controllers. Back then everything had to be burned onto a PROM. Today it is more or less a computer.

This post will serve as guide for anyone that want to replicate some of the stuff I am showing at the mentioned events. It wont dive into the details on the electronics nor will it discuss the underlying architecture and design.

The Ardunio is quite simple to get running. All you need is the Arduino Sketch Editor or the Visual Studio Plugin: Visual Micro. A little bit of C++ knowledge and a lot of cool electronics and you can get going. For me it was about getting three things running:

  • Temperature readings
  • Motor control
  • Bar code scanning (this i ended up faking)

The temperature reading took a while to get running. But there are a huge amount of libraries that you can reuse. For temperature I used the OneWire and DallasTemperature and after a few calculations on resistors I got it to run and reading the sensor data is easy:


For this scenario all the data was relayed through the surface serving as the vendor machine screen. To do this I added the CmdMessenger library which made it easy to send events back and forth. Basically you add handlers and send evens through a bus that manages all the communication required:


The C# Code uses a similar pattern:


A very simple and straight forward model that will make it easy to send events from Arduino to C# and back. In the end the board was up and running and the vendor machine UI successfully sent and received events all the way back to Azure.


And as stated in the title. MicroControllers are fun. I just got accepted into the Windows For Devices preview and will replicate this on the Galileo board. When I do, I will write a series of posts with all the required details to build your own smart vending machine.

A smart vending machine

The second week of November I will be at TeliaSonera M2M symposium and the Swedish TechDays. I will be bringing some of Avanade’s thinking in the retail space. I will be bringing what we call the smart vending machine.

imageI won’t be bringing an actual vending machine unfortunately. But a concept that we built together with our customers.

Our showcase solution utilizes a Microsoft Surface as the touch point, an Audrino as microcontroller and Microsoft Intelligent System Service as a backend.

It sends all events to the ISS and store them in Azure. In it’s essence this is an IoT solution with all the bells and whistles. The tech is really cool from a geek stand point and I am looking forward to prepare it for the events.

But where is the real value here? The tech is cool. But what would make a business pay for it? I will focus on two technologies Microsoft have been talking about:

Both these solutions is about turning events and data into insights. It is these insights that gives our vending machine the potential of being smart.

Getting insight in event streams

A machine sharing it’s temperature over and over and over again are usually not useful. I want to know when the temperature is below a certain threshold. With stream insight I can query the stream of temperature readings for an abnormality and can react when there is an issue instead of monitoring the actual temperature.

There are other things a vending machine could query for; abnormal transactions that could be fraud, unusual amount of transactions that could disrupt the logistics. And so on.

Predicting the future

By storing all the events about sales, environment, clients, transactions; Machine learning can draw insights about the data and try to predict the future. This is extremely useful when predicting refill. The image below shows how the vending machines inventory levels would look like in a months time based on past sales.  image 

The new smart is based on insights like this. This is where the true value of internet of things and BigData come into play; When you can convert it to value. The new services in Azure will make this happen.

When the services this solution is based upon are made publicly available I will try to post a few examples on how to realize what I’ve discussed here.