brewing eisbock with raspberry pi and windows 10 iot
TRANSCRIPT
Brewing Eisbockwith Raspberry PI, Windows 10 IoT and
Microsoft Azure
Gunnar PeipmanCommunity guy and speaker from Estonia
Agenda• What is eisbock?• Freezing beer• Bringing in IoT• Reading sensors• Azure IoT Hub• Stream Analytics• Data visualization: Power BI, Excel, UWA
What is eisbock?
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
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
Freezing beer
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
Newton’s Law of CoolingAfter some math:
𝑇 (𝑡 )=𝑇 𝑎+(𝑇 0−𝑇 𝑎 )𝑒−𝑘𝑡where Ta – ambient temperature T0 – initial beer temperature k- cooling rate t - time
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
Newton’s Law of Cooling• The lower the
ambient temperature the faster is cooling
• The lower the ambient temperature the faster is cooling
Cooling chart
-10
-5
0
5
10
15
20
BeerTemp AmbientTemp
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
Solution
Bringing in IoT
What we need?Raspberry Pi DS18B20
DS2482-100 MS-DIP/SO10 4.7 kΩ resistor
Connecting parts together
Credits: Tomáš Greňo
Windows 10 IoT background task
Read temperatures
Find cooling rate
Find theoretical temperature
Find freezing estimate
Send data to Azure IoT Hub
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
DemoReading sensors
Azure IoT Hub
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.
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
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
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$
DemoSending and receiving messages from Azure IoT Hub
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
Stream Analytics
DemoStream analytics in action
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
Demo5 min data visualization
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
Excel
DemoExcel: 5 minute dashboard for sensors data
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
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
DemoVisualizing sensors data using UWA
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
Thank you!