SlideShare a Scribd company logo
Hardware hackers - hacking appliances with netduino + xamarin
We Power
Connected Things
Hardware development at the speed of software. www.wildernesslabs.co
Bryan Costanich
@bryancostanich
bryan@wildernesslabs.co
slideshare.net/bryancostanich
The Hardware Revolution,
10 years ago, the iPhone launched the mobile
revolution.
It spawned a new class of low-energy,
high-power hardware components.
10 years from now, nearly every new device will
be connected, and much of them will be
automated.
Consumers will demand sophisticated hardware.
June Oven, Tovala, and other.
3 types of IoT: Consumer, Commercial, and
Industrial
GE predicts $60T in Industrial IoT alone in the
next 15 years.
a career opportunity.
© 2018, Wilderness Labs, Inc.
15
31
75
2012 2014 2016 2018 2020
Number of Connected Devices (in Billions)
2024 2026 2028
0
20
40
60
80
2022
Future Tech
Connected fridge of tomorrow:
- Inventory + automated grocery ordering.
- Meal & diet plan, recipe assistant.
- User recognition, experience tailoring.
- Allergy, food expiration, etc. warnings.
- Integration with oven, microwave, etc.
Winning Commercial & Industrial IoT devices will be just as sophisticated.
© 2018, Wilderness Labs, Inc.
Microcontrollers will make the revolution possible.
Commodity chips. $2-$10
Low-energy, high-performance.
General Purpose Input-Output (GPIO)
Digital + Analog
Built-in Protocol Support (SPI, I2C, Serial, CAN,
and others)
Analog-to-Digital (ADC) Converters
Digital-to-Analog Converters
Gateway Connectivity (BLE, WiFi, others)
Real IoT is powered by microcontrollers (MCUs).
Netduino = Arduino form factor running the .Net
MicroFramework.
STM32f4 Microcontroller 164K RAM, 1.4MB Flash
Visual Studio (Windows + Mac)
Debugging, events, etc. No generics.
Excellent prototyping/dev board.
Lots of commercial NetMF projects; it’s even in
space with NASAJPL!
Can embed for <$15.
© 2018, Wilderness Labs, Inc.
developer.wildernesslabs.co
community.wildernesslabs.co
Demo
Connected Dehydrator
Controlling household mains electricity
with a relay.
Regulating temperature with Proportional,
Integral, Derivative (PID) controllers.
Rotary encoder powered LCD menu UI.
Exposing control via a web API.
Connecting to that Web API from a
Xamarin mobile app.
Hacking Connected Appliances
Start building the hardware of tomorrow, today.
System
Enclosure
github.com/wildernesslabs/3D_Print_Designs
Netduino
Breadboard
Relay
Power Distribution
LCD + Rotary Encoder
Nugetized hardware
and peripheral
framework API
Power Control Household electricity (110V/240V) is
controlled by a relay.
Relays are electromechanical and isolate
circuits.
Controlled by a simple on/off via a digital
I/O pin.
Baseboard @ 3D_Print_Designs repo
OutputPort relay =
new OutputPort(Pins.GPIO_PIN_D2, false);
relay.Write(true);
var relay = new Relay(N.Pins.GPIO_PIN_D1);
relay.IsOn = true;
Netduino.Foundation:
TextDisplayMenu
JSON-powered
Use with any LCD via Netduino.Foundation (GPIO,
I2C, Serial, SPI)
Navigate with IRotaryEncoder, or IButtons.
Editable Items.
Using
TextDisplayMenu
protected void InitializeMenu()
{
// initialize menu
_menu = new Menu(_display, _encoder,
Resources.GetBytes(Resources.BinaryResources.menu),
true);
_menu.ValueChanged += HandleMenuValueChange;
_menu.Selected += HandleMenuSelected;
_menu.Exited += (s, e) => {
this._inMenu = false;
this.DisplayInfoScreen();
};
_menu.UpdateItemValue("power", "Turn on");
}
protected void HandleMenuSelected(object sender,
MenuSelectedEventArgs e)
{
switch (e.Command)
{
case "power":
Debug.Print("menu power");
TogglePower();
break;
case "Exit":
this.DisplayInfoScreen();
break;
}
}
protected void HandleMenuValueChange(object sender,
ValueChangedEventArgs e)
{
switch (e.ItemID) {
case "temperature":
_targetTemp = (float)(double)e.Value; //smh
_dehydrator.TargetTemperature = _targetTemp;
break;
case "timer":
_runTime = (TimeSpan)e.Value;
break;
}
}
PID
Proportional, Integral, Derivative
StandardPIDController
IdealPIDController
Netduino.Foundation
PID Guide
Dehydrator App Solution Architecture - Controllers
Main() launches App.
App instantiates peripherals
Features managed by
controllers.
PID in Action - Controller ctor
public DehydratorController (AnalogTemperature tempSensor, SoftPwm heater, Relay fan,
ITextDisplay display)
{
_tempSensor = tempSensor;
_heaterRelayPwm = heater;
_fanRelay = fan;
_display = display;
_pidController = new StandardPidController();
_pidController.ProportionalComponent = .5f; // proportional
_pidController.IntegralComponent = .55f; // integral time minutes
_pidController.DerivativeComponent = 0f; // derivative time in minutes
_pidController.OutputMin = 0.0f; // 0% power minimum
_pidController.OutputMax = 1.0f; // 100% power max
_pidController.OutputTuningInformation = false;
}
PID in Action - Temperature Thread
protected void StartRegulatingTemperatureThread()
{
_tempControlThread = new Thread(() => {
while (this._running) {
_pidController.ActualInput = _tempSensor.Temperature;
_pidController.TargetInput = this.TargetTemperature;
var powerLevel = _pidController.CalculateControlOutput();
this._heaterRelayPwm.DutyCycle = powerLevel;
// sleep for a while.
Thread.Sleep(_powerUpdateInterval);
}
});
_tempControlThread.Start();
}
PID Tuning
Web Server
Purpose-built for Netduino.
Modern, RESTful Web API/
Built-in JSON Support.
Maple Web Server Host
public delegate void TurnOnHandler(int targetTemp);
public event TurnOnHandler TurnOn = delegate { };
public void postTurnOn() {
try {
int targetTemp = 0;
var prm = "targetTemp";
if (this.Body[prm] == null && this.Form[prm] == null && this.QueryString[prm] == null) {
StatusResponse(ContentTypes.Application_Text, 400, prm + " is required");
return;
}
try {
var temp = this.Body[prm] ?? this.Form[prm] ?? this.QueryString[prm];
targetTemp = int.Parse(temp.ToString());
} catch(Exception ex) {
StatusResponse(ContentTypes.Application_Text, 400, "Invalid " + prm + " value");
}
TurnOn(targetTemp);
StatusResponse(200);
} catch (Exception ex) {
StatusResponse(ContentTypes.Application_Text, 500, ex.Message);
}
}
get:/Status
post:/TurnOn
post:/TurnOff
One-Line UDP.
_server.Start("dehydrator3000", Initializer.CurrentNetworkInterface.IPAddress.ToString());
Name IP
Xamarin Mobile App
Xamarin.Forms + HttpClient
async private Task<bool> PowerCommand(string command) {
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://" + _hostAddress + "/" + _apiBase);
var response = await client.PostAsync(command, null);
if (response.IsSuccessStatusCode) {
if (command == "turnon") {
App.ApplianceStatus = ApplianceStatus.On;
} else {
App.ApplianceStatus = ApplianceStatus.Off;
}
}
return response.IsSuccessStatusCode;
}
What future tech will you build?
Vancouver, BC - June 20th
Mountain View - June 25th
San Francisco - June 26th
Portland (PADNUG) - July 3rd
More dates coming!
Upcoming Events
Roadshow
Netduino Contest
Device Deadline - July 2nd
Project Deadline - July 31st
Thanks.
www.wildernesslabs.co
Code here
newsletter: bit.ly/2rBfP4Y
slideshare.net/bryancostanich
Github.com/WildernessLabs/Netduino_Samples/Netduino.Foundation/
Dehydrator blog instructs here.
blog.wildernesslabs.co
Full .NET Standard Apps
Manage via the cloud (deploy, monitor, update).
Secure from hardware up.
Advanced IO support (display, camera, CAN,
etc.)
meadow
© 2018, Wilderness Labs, Inc.
MCUs vs. CPUs/SOCs
Price: $5 vs. $25+ (CPUs require additional
components).
Energy: Battery vs. Dedicated Power
OS: Micro RealTime OS (RTOS) vs. Full Linux
API: Limited GUI vs. Full GUI Framework*
*Latest generation of MCUs have 2D gfx acceleration.

More Related Content

Similar to Hardware hackers - hacking appliances with netduino + xamarin (20)

PDF
Android Lollipop internals and inferiority complex droidcon.hr 2015
Aleksander Piotrowski
 
PDF
Android 5.0 internals and inferiority complex droidcon.de 2015
Aleksander Piotrowski
 
PDF
Reactive & Realtime Web Applications with TurboGears2
Alessandro Molina
 
PPTX
Uvais
Rao Uvais Khan
 
PDF
Bending the IoT to your will with JavaScript
All Things Open
 
PDF
IRJET- Smart Power Optimization with IoT
IRJET Journal
 
PDF
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Codemotion
 
PDF
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Codemotion
 
PDF
Android Things, from mobile apps to physical world
Stefano Sanna
 
PPTX
Controlling the world with Arduino & JavaScript
Magnus Green
 
PPTX
Introduction to Things board (An Open Source IoT Cloud Platform)
Amarjeetsingh Thakur
 
PDF
How To Electrocute Yourself using the Internet
Alexander Roche
 
PPT
Iot intro 2017
Hoopeer Hoopeer
 
PDF
Industrial IoT bootcamp
Lothar Schubert
 
PPTX
IoT Based Home Automation System Presantation
Farhan Ahmed Rahee
 
PDF
iot1presentation-191219142803.pdf
BharathReddy615859
 
PDF
IoT Workshop in Macao
Shigeru Kobayashi
 
PDF
IoT Workshop in Macao
Shigeru Kobayashi
 
PPTX
Controlling the World with Arduino,JavaScript & Azure
Magnus Green
 
PPTX
A Globally controlled Embedded Switch node for Electrical Devices at Home by...
siddubathini
 
Android Lollipop internals and inferiority complex droidcon.hr 2015
Aleksander Piotrowski
 
Android 5.0 internals and inferiority complex droidcon.de 2015
Aleksander Piotrowski
 
Reactive & Realtime Web Applications with TurboGears2
Alessandro Molina
 
Bending the IoT to your will with JavaScript
All Things Open
 
IRJET- Smart Power Optimization with IoT
IRJET Journal
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Codemotion
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Codemotion
 
Android Things, from mobile apps to physical world
Stefano Sanna
 
Controlling the world with Arduino & JavaScript
Magnus Green
 
Introduction to Things board (An Open Source IoT Cloud Platform)
Amarjeetsingh Thakur
 
How To Electrocute Yourself using the Internet
Alexander Roche
 
Iot intro 2017
Hoopeer Hoopeer
 
Industrial IoT bootcamp
Lothar Schubert
 
IoT Based Home Automation System Presantation
Farhan Ahmed Rahee
 
iot1presentation-191219142803.pdf
BharathReddy615859
 
IoT Workshop in Macao
Shigeru Kobayashi
 
IoT Workshop in Macao
Shigeru Kobayashi
 
Controlling the World with Arduino,JavaScript & Azure
Magnus Green
 
A Globally controlled Embedded Switch node for Electrical Devices at Home by...
siddubathini
 

More from bryan costanich (8)

PPTX
Hacking your coffee maker; building a connected appliance with Netduino and X...
bryan costanich
 
PPTX
Futures in Computing
bryan costanich
 
PPT
Advanced android app lifecycle + Patterns
bryan costanich
 
PPT
C# rocks
bryan costanich
 
PPT
Cross Platform Mobile Development with Xamarin
bryan costanich
 
KEY
Going mobile - A Technical Job Prep for Vassar Students
bryan costanich
 
PPT
Cross-Platform Mobile Development in Visual Studio
bryan costanich
 
KEY
Cross Platform Development with Xamarin
bryan costanich
 
Hacking your coffee maker; building a connected appliance with Netduino and X...
bryan costanich
 
Futures in Computing
bryan costanich
 
Advanced android app lifecycle + Patterns
bryan costanich
 
C# rocks
bryan costanich
 
Cross Platform Mobile Development with Xamarin
bryan costanich
 
Going mobile - A Technical Job Prep for Vassar Students
bryan costanich
 
Cross-Platform Mobile Development in Visual Studio
bryan costanich
 
Cross Platform Development with Xamarin
bryan costanich
 

Recently uploaded (20)

PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 

Hardware hackers - hacking appliances with netduino + xamarin

  • 2. We Power Connected Things Hardware development at the speed of software. www.wildernesslabs.co Bryan Costanich @bryancostanich [email protected] slideshare.net/bryancostanich
  • 3. The Hardware Revolution, 10 years ago, the iPhone launched the mobile revolution. It spawned a new class of low-energy, high-power hardware components. 10 years from now, nearly every new device will be connected, and much of them will be automated. Consumers will demand sophisticated hardware. June Oven, Tovala, and other. 3 types of IoT: Consumer, Commercial, and Industrial GE predicts $60T in Industrial IoT alone in the next 15 years. a career opportunity. © 2018, Wilderness Labs, Inc. 15 31 75 2012 2014 2016 2018 2020 Number of Connected Devices (in Billions) 2024 2026 2028 0 20 40 60 80 2022
  • 4. Future Tech Connected fridge of tomorrow: - Inventory + automated grocery ordering. - Meal & diet plan, recipe assistant. - User recognition, experience tailoring. - Allergy, food expiration, etc. warnings. - Integration with oven, microwave, etc. Winning Commercial & Industrial IoT devices will be just as sophisticated. © 2018, Wilderness Labs, Inc.
  • 5. Microcontrollers will make the revolution possible. Commodity chips. $2-$10 Low-energy, high-performance. General Purpose Input-Output (GPIO) Digital + Analog Built-in Protocol Support (SPI, I2C, Serial, CAN, and others) Analog-to-Digital (ADC) Converters Digital-to-Analog Converters Gateway Connectivity (BLE, WiFi, others) Real IoT is powered by microcontrollers (MCUs).
  • 6. Netduino = Arduino form factor running the .Net MicroFramework. STM32f4 Microcontroller 164K RAM, 1.4MB Flash Visual Studio (Windows + Mac) Debugging, events, etc. No generics. Excellent prototyping/dev board. Lots of commercial NetMF projects; it’s even in space with NASAJPL! Can embed for <$15. © 2018, Wilderness Labs, Inc.
  • 9. Controlling household mains electricity with a relay. Regulating temperature with Proportional, Integral, Derivative (PID) controllers. Rotary encoder powered LCD menu UI. Exposing control via a web API. Connecting to that Web API from a Xamarin mobile app. Hacking Connected Appliances Start building the hardware of tomorrow, today.
  • 13. Power Control Household electricity (110V/240V) is controlled by a relay. Relays are electromechanical and isolate circuits. Controlled by a simple on/off via a digital I/O pin. Baseboard @ 3D_Print_Designs repo OutputPort relay = new OutputPort(Pins.GPIO_PIN_D2, false); relay.Write(true); var relay = new Relay(N.Pins.GPIO_PIN_D1); relay.IsOn = true; Netduino.Foundation:
  • 15. JSON-powered Use with any LCD via Netduino.Foundation (GPIO, I2C, Serial, SPI) Navigate with IRotaryEncoder, or IButtons. Editable Items. Using TextDisplayMenu protected void InitializeMenu() { // initialize menu _menu = new Menu(_display, _encoder, Resources.GetBytes(Resources.BinaryResources.menu), true); _menu.ValueChanged += HandleMenuValueChange; _menu.Selected += HandleMenuSelected; _menu.Exited += (s, e) => { this._inMenu = false; this.DisplayInfoScreen(); }; _menu.UpdateItemValue("power", "Turn on"); } protected void HandleMenuSelected(object sender, MenuSelectedEventArgs e) { switch (e.Command) { case "power": Debug.Print("menu power"); TogglePower(); break; case "Exit": this.DisplayInfoScreen(); break; } } protected void HandleMenuValueChange(object sender, ValueChangedEventArgs e) { switch (e.ItemID) { case "temperature": _targetTemp = (float)(double)e.Value; //smh _dehydrator.TargetTemperature = _targetTemp; break; case "timer": _runTime = (TimeSpan)e.Value; break; } }
  • 18. Dehydrator App Solution Architecture - Controllers Main() launches App. App instantiates peripherals Features managed by controllers.
  • 19. PID in Action - Controller ctor public DehydratorController (AnalogTemperature tempSensor, SoftPwm heater, Relay fan, ITextDisplay display) { _tempSensor = tempSensor; _heaterRelayPwm = heater; _fanRelay = fan; _display = display; _pidController = new StandardPidController(); _pidController.ProportionalComponent = .5f; // proportional _pidController.IntegralComponent = .55f; // integral time minutes _pidController.DerivativeComponent = 0f; // derivative time in minutes _pidController.OutputMin = 0.0f; // 0% power minimum _pidController.OutputMax = 1.0f; // 100% power max _pidController.OutputTuningInformation = false; }
  • 20. PID in Action - Temperature Thread protected void StartRegulatingTemperatureThread() { _tempControlThread = new Thread(() => { while (this._running) { _pidController.ActualInput = _tempSensor.Temperature; _pidController.TargetInput = this.TargetTemperature; var powerLevel = _pidController.CalculateControlOutput(); this._heaterRelayPwm.DutyCycle = powerLevel; // sleep for a while. Thread.Sleep(_powerUpdateInterval); } }); _tempControlThread.Start(); }
  • 22. Web Server Purpose-built for Netduino. Modern, RESTful Web API/ Built-in JSON Support.
  • 23. Maple Web Server Host public delegate void TurnOnHandler(int targetTemp); public event TurnOnHandler TurnOn = delegate { }; public void postTurnOn() { try { int targetTemp = 0; var prm = "targetTemp"; if (this.Body[prm] == null && this.Form[prm] == null && this.QueryString[prm] == null) { StatusResponse(ContentTypes.Application_Text, 400, prm + " is required"); return; } try { var temp = this.Body[prm] ?? this.Form[prm] ?? this.QueryString[prm]; targetTemp = int.Parse(temp.ToString()); } catch(Exception ex) { StatusResponse(ContentTypes.Application_Text, 400, "Invalid " + prm + " value"); } TurnOn(targetTemp); StatusResponse(200); } catch (Exception ex) { StatusResponse(ContentTypes.Application_Text, 500, ex.Message); } } get:/Status post:/TurnOn post:/TurnOff
  • 25. Xamarin Mobile App Xamarin.Forms + HttpClient async private Task<bool> PowerCommand(string command) { HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://" + _hostAddress + "/" + _apiBase); var response = await client.PostAsync(command, null); if (response.IsSuccessStatusCode) { if (command == "turnon") { App.ApplianceStatus = ApplianceStatus.On; } else { App.ApplianceStatus = ApplianceStatus.Off; } } return response.IsSuccessStatusCode; }
  • 26. What future tech will you build?
  • 27. Vancouver, BC - June 20th Mountain View - June 25th San Francisco - June 26th Portland (PADNUG) - July 3rd More dates coming! Upcoming Events Roadshow Netduino Contest Device Deadline - July 2nd Project Deadline - July 31st
  • 29. Full .NET Standard Apps Manage via the cloud (deploy, monitor, update). Secure from hardware up. Advanced IO support (display, camera, CAN, etc.) meadow © 2018, Wilderness Labs, Inc.
  • 30. MCUs vs. CPUs/SOCs Price: $5 vs. $25+ (CPUs require additional components). Energy: Battery vs. Dedicated Power OS: Micro RealTime OS (RTOS) vs. Full Linux API: Limited GUI vs. Full GUI Framework* *Latest generation of MCUs have 2D gfx acceleration.