brewing eisbock with raspberry pi and windows 10 iot

41

Upload: gunnar-peipman

Post on 11-Feb-2017

19.045 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Brewing Eisbock with Raspberry PI and Windows 10 IoT
Page 2: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Brewing Eisbockwith Raspberry PI, Windows 10 IoT and

Microsoft Azure

Page 3: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Gunnar PeipmanCommunity guy and speaker from Estonia

Page 4: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Agenda• What is eisbock?• Freezing beer• Bringing in IoT• Reading sensors• Azure IoT Hub• Stream Analytics• Data visualization: Power BI, Excel, UWA

Page 5: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Support materials

http://bit.ly/beeriot

Page 6: Brewing Eisbock with Raspberry PI and Windows 10 IoT

What is eisbock?

Page 7: Brewing Eisbock with Raspberry PI and Windows 10 IoT

The Legend of Eisbock

n a wintery day, a brewery lad had been instructed by the brewmaster to r oll the casks of fi nished Bockbier fr om the brewery yard back into the cellar and then close shop. But after a long day of toil in fr ont of the mash tun the lad was just too tir ed in the evening to car ry out his master 's orders. I nstead,

he fi gured that there would be no har m in leaving them outside unti l morning. That night, however , turned out to be bitter cold, and the beer inside the casks fr oze solid.

The irate brewmaster , bent on meting out severe punishment, ordered the hapless lad to crack open the icy casks and dr ink the awful brownish stuff. The fr ightened lad, of course, did as he was told, taking mere tentative sips at fi rst, but then imbibing with ever increasing gusto. I n the center of each cask-size lump of ice was the most delicious, malty -sweet, and heavy beer imaginable. P unishment, indeed! The lad was the fi rst human ever to taste...Eisbock; and being a kind and generous sor t, he let the others shar e in his "punishment.„

H appened in R eichelbräu brew yard in the city of K ulmbach, at around 1890.

O

Page 8: Brewing Eisbock with Raspberry PI and Windows 10 IoT

BeerKulmbacher

EisbockAventinus Weizen-Eisbock

Holzfass-gereifter Eisbock

Mauritius Eisbock

Edition 2014Alc. vol. 9.2% 12% 12% 10.9%Ratebeer 98/100 99/100 91/100 85/100

Page 9: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Freezing beer

Page 10: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Newton’s Law of CoolingThe rate of change of the temperature of an object is proportional to the difference

between its own temperature and the ambient temperature

Page 11: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Newton’s Law of CoolingAfter some math:

𝑇 (𝑡 )=𝑇 𝑎+(𝑇 0−𝑇 𝑎 )𝑒−𝑘𝑡where Ta – ambient temperature T0 – initial beer temperature k- cooling rate t - time

Page 12: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Newton’s Law of Cooling• Finding k – measure temperature after 30

minutes again and solve equation for k (you know t and T(30) both) • Finding t – solve equation for t using k

Page 13: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Newton’s Law of Cooling• The lower the

ambient temperature the faster is cooling

• The lower the ambient temperature the faster is cooling

Page 14: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Cooling chart

-10

-5

0

5

10

15

20

BeerTemp AmbientTemp

Page 15: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Problems• 20l of beer cools down slowly• I don’t want to open the bucket to avoid

contamination of beer• I don’t want to check temperature after

every 30 minutes• I want to have data about cooling• I want to get notified when beer is

turning to sleet

Page 16: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Solution

Page 17: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Bringing in IoT

Page 18: Brewing Eisbock with Raspberry PI and Windows 10 IoT

What we need?Raspberry Pi DS18B20

DS2482-100 MS-DIP/SO10 4.7 kΩ resistor

Page 19: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Connecting parts together

Credits: Tomáš Greňo

Page 20: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Windows 10 IoT background task

Read temperatures

Find cooling rate

Find theoretical temperature

Find freezing estimate

Send data to Azure IoT Hub

Page 21: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Reading sensors• Use Rinsen.OneWire library• Use built-in support for DS18B20• It takes ~1s to read one sensor• Minimum reading interval: number of

sensors + 2 seconds

Page 22: Brewing Eisbock with Raspberry PI and Windows 10 IoT

DemoReading sensors

Page 23: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Azure IoT Hub

Page 24: Brewing Eisbock with Raspberry PI and Windows 10 IoT

IoT Hub vs Event HubArea Iot Hub Event Hubs

Communication patterns device-to-cloud and cloud-to-device messaging

Only enables event ingress

Device protocol support AMQP,AMQP over WebSockets, MQTT, HTTP/1Azure IoT Protocol Gateway

AMQPAMQP over WebSockets, HTTP/1

Scale Is optimized to support millions of simultaneously connected devices.

Up to 5,000 AMQP connections, as per Azure Service Bus quotas.

Page 25: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Messaging• device-to-cloud

messages sent to Azure IoT Hub by devices • cloud-to-device

message sent to device(s) by some service or process, delivery feedback is supported

Page 26: Brewing Eisbock with Raspberry PI and Windows 10 IoT

PoliciesDefines set of permissions for connections that use given policy

Policy Permissions

iothubowner registry write, service connect, device connect

service service connect, device connext

device device connect

registryRead registry read

registryReadWrite registry write

Page 27: Brewing Eisbock with Raspberry PI and Windows 10 IoT

PackagesFree S1 Standard S2 Standard

8k messages/unit/day 400k messages/unit/day 6M messages/unit/day

Device to cloud Device to cloud Device to cloud

Cloud to device Cloud to device Cloud to device

1 unit 200 units maximum 200 units maximum

FREE 50$ 500$

Page 28: Brewing Eisbock with Raspberry PI and Windows 10 IoT

DemoSending and receiving messages from Azure IoT Hub

Page 29: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Stream AnalyticsInput

sources Query Output sources

Component Purpose

Input Event Hub, IoT Hub, Blob Storage,

Query Transforms input to out during given time window

Output SQL database, Blob Storage, Event Hub, Power BI, Table Storage, Service Bus Queue, Service Bus Topic, Document DB

Page 30: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Stream Analytics

Page 31: Brewing Eisbock with Raspberry PI and Windows 10 IoT

DemoStream analytics in action

Page 32: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Power BI• Online service for

visualizing enterprise data• Free accounts available• Push-data supported by

Stream Analytics • Build impressive BI

dashboards and reports• Clients: web, desktop,

mobile

Page 33: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Demo5 min data visualization

Page 34: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Excel• Familiar to many people• Works with remote data• Easy to build „live“ sheets• Powerful data analysis• Powerful data visualization• Poor man’s Power BI

Page 35: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Excel

Page 36: Brewing Eisbock with Raspberry PI and Windows 10 IoT

DemoExcel: 5 minute dashboard for sensors data

Page 37: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Universal Windows Application• Target Windows 10 devices• Use Universal Windows

Platform (UWP)• Use same code for• mobile• desktop• IoT (screen solutions)

• Cooling process in your pocket

Page 38: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Technical side• Visual Studio: Universal Windows App• Communications:• AMQPNetLite, AzureSbLite• Web API and Web API client

• Visual• WinRTXamlToolkit Chart• VisualStateManager

• Reading data• Background timer processes

Page 39: Brewing Eisbock with Raspberry PI and Windows 10 IoT

DemoVisualizing sensors data using UWA

Page 40: Brewing Eisbock with Raspberry PI and Windows 10 IoT

On-going work• Build better support system for

measurements• Adding new temperature measurements• Solving abv/abw measurements problems• Find a way to move to SaaS model

Page 41: Brewing Eisbock with Raspberry PI and Windows 10 IoT

Thank you!