SlideShare a Scribd company logo
1 of 46
Download to read offline
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

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Brewing ALE with Pi