SlideShare a Scribd company logo
Brewing ALE with Pi
Kristian Kristensen
@kkristensen
Get $5 to start:!
http://bit.ly/
VenmoKristian
Agenda
•

Beer Brewing

•

Raspberry Pi

•

Erlang/ALE

•

Monitoring temperatures
Raspberry Pi
•

ARM 700 MHz CPU

•

512 MB RAM

•

10/100 Ethernet

•

HDMI, Comp. Video, Audio.

•

$40!
Interface Real World (I)
•

GPIO

•

I2C

•

SPI

•

<Others>
Interface Real World (II)
•

Memory Mapped
•

/dev/mem
•

•

Kernel modules
•

•

Fast, needs root, dangerous!

Slow, doesn’t need root, easier, safer

Can Erlang help us?
Erlang/ALE
•

Actor

•

Library for

•

Embedded

https://github.com/esl/erlang_ale
Erlang (hearts) Embedded
•

Soft real time

•

Concurrency and Parallelism

•

Fault tolerant & Robust

•

Hot-code loading
•

(http://www.erlang-embedded.com/2013/10/minimal-downtime-in-flight-drone-firmware-upgrade-in-erlang/)
Architecture
•

Fix the mess
we saw earlier

•

Familiar
abstractions

•

Clean model
What works
•

GPIO and GPIO interrupts

•

Basic I2C and SPI

•

Erlang Solutions actively working on it
GPIO
A

{init, 17, output}

GPIO

pin 17
GPIO
A

B

{state, 17, high}

GPIO

{state, 17, low}

pin 17
{state, 17, high}

C
GPIO Supervisor
•

Replaces locks
•

•

Access Control, Mutual Exclusion

Safety constraints
•

Toggling, sequence detection, direction
control, etc.
Blink some LEDs
{ok, _} = gpio:start_link(?LED_PIN, output),
!

blink() ->

gpio:write(?LED_PIN, 1),

!

timer:sleep(1000),
!

gpio:write(?LED_PIN, 0),
!

timer:sleep(1000).
Blink some LEDs

•

http://bit.ly/18KP8xF
Interrupts
{ok, _} = gpio:start_link(?IN_PIN, input),
!

ok

= gpio:set_int(?IN_PIN, rising),

!

handle_info({gpio_interrupt, _Pin,
_Condition}, State) ->
blink().
1-wire
•

Creates a network of sensors all communicating
using 1 single wire

•

Great digital thermometer sensor available
•

DS18B20
Raspberry Pi & 1-wire
•

Kernel module
•

•

/sys/bus/w1/devices/28-0000044719d7/w1slave

=>
•

4b 01 4b 46 7f ff 0e 10 d8 : crc=d8 YES

4b 01 4b 46 7f ff 0e 10 d8 t=26125
Read temperature
•

read(<<A1:16,_,A2:16,_,A3:16,_,A4:16
,_,A5:16,_,A6:16,_,A7:16,_,A8:16,_,C
RC:16,_,$:,_,”crc=",CRC:
16,_,"YES",Rest0/binary>>

•

read(<<A1:16,_,A2:16,_,A3:16,_,A4:16
,_,A5:16,_,A6:16,_,A7:16,_,A8:16,_,C
RC:16," t=",Rest/binary>>

•

http://bit.ly/1cst0ah
Projects
•

Kegerator control

•

Boil Wort

•

Strike water, Hot Liquor Tank

•

Mash temperature

•

Fermentation Chamber
Control
Thank you
Links
•

https://github.com/esl/erlang_ale

•

http://www.erlang-embedded.com/

•

Blink LEDs: http://bit.ly/18KP8xF

•

Read Temperature: http://bit.ly/1cst0ah

More Related Content

What's hot

HPC Performance & Development Tuning tools for scientists to go parallel fast...
HPC Performance & Development Tuning tools for scientists to go parallel fast...HPC Performance & Development Tuning tools for scientists to go parallel fast...
HPC Performance & Development Tuning tools for scientists to go parallel fast...
Intel IT Center
 

What's hot (9)

Raspberry pi 2 demo
Raspberry pi 2 demoRaspberry pi 2 demo
Raspberry pi 2 demo
 
What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015What is NetDevOps? How? Leslie Carr PuppetConf 2015
What is NetDevOps? How? Leslie Carr PuppetConf 2015
 
NFC and iOS11
NFC and iOS11NFC and iOS11
NFC and iOS11
 
Grid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium gridGrid Router – scalable and fault tolerant solution for Selenium grid
Grid Router – scalable and fault tolerant solution for Selenium grid
 
Glitch nix
Glitch nixGlitch nix
Glitch nix
 
HPC Performance & Development Tuning tools for scientists to go parallel fast...
HPC Performance & Development Tuning tools for scientists to go parallel fast...HPC Performance & Development Tuning tools for scientists to go parallel fast...
HPC Performance & Development Tuning tools for scientists to go parallel fast...
 
Selenium-Grid-Extras
Selenium-Grid-ExtrasSelenium-Grid-Extras
Selenium-Grid-Extras
 
Amazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKAAmazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKA
 
Amazon Aurora の活用
Amazon Aurora の活用Amazon Aurora の活用
Amazon Aurora の活用
 

Similar to Brewing ALE with Pi

Similar to Brewing ALE with Pi (20)

Building an Open Source VoIP Hardware Phone
Building an Open Source VoIP Hardware PhoneBuilding an Open Source VoIP Hardware Phone
Building an Open Source VoIP Hardware Phone
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Windows 10 IoT Core for Raspberry Pi 2
Windows 10 IoT Core for Raspberry Pi 2Windows 10 IoT Core for Raspberry Pi 2
Windows 10 IoT Core for Raspberry Pi 2
 
Raspberrypi best ppt
Raspberrypi best ppt Raspberrypi best ppt
Raspberrypi best ppt
 
Maker printouts
Maker printoutsMaker printouts
Maker printouts
 
Raspberry Pi Introduction
Raspberry Pi IntroductionRaspberry Pi Introduction
Raspberry Pi Introduction
 
Functions on Kubernetes
Functions on KubernetesFunctions on Kubernetes
Functions on Kubernetes
 
Exploring the ABC's of Raspberry Pi with Python
Exploring the ABC's of Raspberry Pi with PythonExploring the ABC's of Raspberry Pi with Python
Exploring the ABC's of Raspberry Pi with Python
 
Building an Open Source VoIP Hardware Phone
Building an Open Source VoIP Hardware PhoneBuilding an Open Source VoIP Hardware Phone
Building an Open Source VoIP Hardware Phone
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBots
 
Raspberry Pi Gaming Rig
Raspberry Pi Gaming RigRaspberry Pi Gaming Rig
Raspberry Pi Gaming Rig
 
Unit 6 - PART2.pptx
Unit 6 - PART2.pptxUnit 6 - PART2.pptx
Unit 6 - PART2.pptx
 
Nerves Project Intro to ErlangDC
Nerves Project Intro to ErlangDCNerves Project Intro to ErlangDC
Nerves Project Intro to ErlangDC
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Using Telegram to interact with an LED Matrix
Using Telegram to interact with an LED MatrixUsing Telegram to interact with an LED Matrix
Using Telegram to interact with an LED Matrix
 
Raspbeery Pi : An Introduction
Raspbeery Pi : An IntroductionRaspbeery Pi : An Introduction
Raspbeery Pi : An Introduction
 
Embedded Objective-C
Embedded Objective-CEmbedded Objective-C
Embedded Objective-C
 
R0boCamp2016 Гліб Вінніков Home automation by ESP8266
R0boCamp2016  Гліб Вінніков  Home automation by ESP8266R0boCamp2016  Гліб Вінніков  Home automation by ESP8266
R0boCamp2016 Гліб Вінніков Home automation by ESP8266
 
Krupesh_Resume
Krupesh_ResumeKrupesh_Resume
Krupesh_Resume
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
UiPath New York Community Day in-person event
UiPath New York Community Day in-person eventUiPath New York Community Day in-person event
UiPath New York Community Day in-person event
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

Brewing ALE with Pi