Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monsters, brievenbussen en andere onzin @ Amsterdam University of Applied Sciences

Monsters, brievenbussen en andere onzin @ Amsterdam University of Applied Sciences

Monsters, mailboxes and other non-sense. A talk about about combining sensors, switches and displays with different technologies to solve problems that don't really exist and more importantly just to have fun with IoT and make geeky stuff. This talk contains monsters, and lots of them.

Niels Leenheer

April 11, 2017
Tweet

More Decks by Niels Leenheer

Other Decks in Technology

Transcript

  1. monsters,
    brievenbussen
    en andere onzin

    View Slide

  2. View Slide

  3. View Slide

  4. een nieuw huis

    View Slide

  5. View Slide

  6. View Slide

  7. 10 meter

    View Slide

  8. het huis 

    van de toekomst

    View Slide

  9. View Slide

  10. IoT is zo ongelofelijk saai

    View Slide

  11. 433MHz

    View Slide

  12. View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. mesh networking

    View Slide

  17. afstand mesh rechtstreeks 2-weg standaard
    ̣ ✔ ✔ ✔
    ̣̣ ✱ ✔ ✔ ✔
    433 MHz ̣̣̣ ✱
    ̣̣̣̣ ✔ ✔ ✱
    ̣̣̣̣ ✔ ✔ ✔

    View Slide

  18. raspberry pi met domoticz

    View Slide

  19. View Slide

  20. View Slide

  21. kippenverwarming

    View Slide

  22. brrrr!

    View Slide

  23. kippenwaterdrinkbak

    View Slide

  24. kippenwaterdrinkbakverwarmingselement

    View Slide

  25. kippenwaterdrinkbakverwarmingselementschakelaar

    View Slide

  26. kippenwaterdrinkbakverwarmingselementschakelaarthermometer

    View Slide

  27. View Slide

  28. rfxcom

    View Slide

  29. elke 30 seconden een “ping” met de temperatuur

    View Slide

  30. temperatuur onder nul, zet de verwarming aan

    View Slide

  31. zet klikaanklikuit schakelaar aan

    View Slide

  32. View Slide

  33. The “S” in IoT stands for security

    View Slide

  34. View Slide

  35. de vurige 

    heksenpot

    View Slide

  36. Doe-het-zelf IoT

    View Slide

  37. brains
    (oftewel microcontrollers)

    View Slide

  38. Arduino Uno

    ATmega238

    16 Mhz

    2 KB RAM

    32 KB Flash

    View Slide

  39. ESP-01

    ESP 8266 

    80 Mhz

    128 KB RAM

    512 KB Flash


    View Slide

  40. NodeMCU

    ESP 8266

    80 Mhz

    128 KB RAM

    4 MB Flash


    View Slide

  41. NodeMCU

    View Slide

  42. Neopixel

    24 serieel 

    geschakelde 

    WS2812 RGB 

    LEDs

    View Slide

  43. #include
    #define PIN D1
    #define PIXELS 24
    Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800);
    void setup(void) {
    strip.begin();
    strip.setBrightness(255);
    strip.setPixelColor(0, strip.Color(0, 0, 255));
    strip.show();
    }
    void loop(void) {
    }

    View Slide

  44. int i = 0;
    void setup(void) {
    strip.begin();
    strip.setBrightness(255);
    }
    void loop(void) {
    i = (i + 1) % PIXELS;
    strip.setPixelColor(i % PIXELS, strip.Color(0, 0, 0));
    strip.setPixelColor((i + 1) % PIXELS, strip.Color(0, 0, 63));
    strip.setPixelColor((i + 2) % PIXELS, strip.Color(0, 0, 127));
    strip.setPixelColor((i + 3) % PIXELS, strip.Color(0, 0, 195));
    strip.setPixelColor((i + 4) % PIXELS, strip.Color(0, 0, 255));
    strip.show();
    delay(8);
    }

    View Slide

  45. ?!
    JavaScript? En C?

    Zo'n beetje hetzelfde. Ongeveer.

    Niet helemaal. Nee.

    View Slide

  46. IKEA
    SOMMAR 2017
    theelichthouder

    View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. WiFi is vast heel moeilijk…

    View Slide

  52. const char* ssid = "........";
    const char* password = "........";
    ESP8266WebServer server(80);
    void setup(void) {
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) delay(500);
    server.on("/on", [](){ server.send(200, "text/plain", "on"); });
    server.on("/off", [](){ server.send(200, "text/plain", "off"); });
    server.begin();
    }
    void loop(void) {
    server.handleClient();
    }

    View Slide

  53. http:/
    /sparkle.local/api?command=power&status

    command=power&on

    command=power&off
    command=brightness&status

    command=brightness&set=50
    command=color&status

    command=color&set=f34d0d

    View Slide

  54. homebridge
    homebridge-better-http-rgb

    View Slide

  55. siri

    View Slide

  56. pixel monsters

    View Slide

  57. Prolight
    12W plafondlamp

    View Slide

  58. View Slide

  59. Neopixel

    64 serieel 

    geschakelde 

    WS2812 RGB 

    LEDs

    View Slide

  60. View Slide

  61. SD card
    Opslag van
    monsters
    Buzzer
    Piepjes voor
    een notificatie
    Lichtgevoelige
    weerstand
    Nachtstand

    View Slide

  62. View Slide

  63. View Slide

  64. View Slide

  65. View Slide

  66. progressive

    web app

    View Slide

  67. http:/
    /pixel.local

    View Slide

  68. http:/
    /pixel.local

    View Slide

  69. View Slide

  70. editor.addEventListener('touchstart', handleTouch);
    editor.addEventListener('touchmove', handleTouch);
    function handleTouch(e) {
    for (var i = 0; i < e.changedTouches.length; i++) {
    let elem = document.elementFromPoint(
    e.changedTouches[i].pageX,
    e.changedTouches[i].pageY
    );
    if (elem.tagName && elem.tagName == 'TD' && 

    editor.contains(elem)) 

    {
    drawPixel(elem);
    }
    }
    e.preventDefault();
    }

    View Slide

  71. editor.addEventListener('touchstart', handleTouch);
    editor.addEventListener('touchmove', handleTouch);
    function handleTouch(e) {
    for (var i = 0; i < e.changedTouches.length; i++) {
    let elem = document.elementFromPoint(
    e.changedTouches[i].pageX,
    e.changedTouches[i].pageY
    );
    if (elem.tagName && elem.tagName == 'TD' && 

    editor.contains(elem)) 

    {
    drawPixel(elem);
    }
    }
    e.preventDefault();
    }

    View Slide

  72. let socket = new WebSocket(
    "ws://" + window.location.host + "/ws"
    );
    function drawPixel(elem) {
    if (elem.dataset.color != currentColor) {
    elem.dataset.color = currentColor;
    elem.style.backgroundColor = '#' + currentColor;
    socket.send(JSON.stringify({
    command: "draw",
    x: elem.dataset.x,
    y: elem.dataset.y,
    color: currentColor
    }));
    }
    }

    View Slide

  73. let socket = new WebSocket(
    "ws://" + window.location.host + "/ws"
    );
    function drawPixel(elem) {
    if (elem.dataset.color != currentColor) {
    elem.dataset.color = currentColor;
    elem.style.backgroundColor = '#' + currentColor;
    socket.send(JSON.stringify({
    command: "draw",
    x: elem.dataset.x,
    y: elem.dataset.y,
    color: currentColor
    }));
    }
    }

    View Slide

  74. {

    "command": "draw",

    "x": 5,

    "y": 5,

    "color": "ffffff"

    }

    View Slide

  75. {

    "command": "draw",

    "x": 5,

    "y": 5,

    "color": "ffffff"

    }

    View Slide

  76. View Slide

  77. View Slide

  78. socket.onmessage = function(msg) {
    let data = JSON.parse(msg.data);
    if (data.command == "draw")
    {
    let elem = document.querySelector(
    'td[data-x=' + data.x + ']' + 

    '[data-y=' + data.y + ']'
    );
    elem.dataset.color = data.color;
    elem.style.backgroundColor = '#' + data.color };
    }
    }

    View Slide

  79. socket.onmessage = function(msg) {
    let data = JSON.parse(msg.data);
    if (data.command == "draw")
    {
    let elem = document.querySelector(
    'td[data-x=' + data.x + ']' + 

    '[data-y=' + data.y + ']'
    );
    elem.dataset.color = data.color;
    elem.style.backgroundColor = '#' + data.color };
    }
    }

    View Slide

  80. demo

    View Slide

  81. het mysterie 

    van de 

    spookbrievenbus

    View Slide

  82. brieven bus

    View Slide

  83. magneetcontact

    View Slide

  84. bij openen van de deksel een signaal

    View Slide

  85. http:/
    /pixel.local/api?command=notify&icon=mailbox

    View Slide

  86. View Slide

  87. View Slide

  88. View Slide

  89. oplossing #1
    magneetcontact

    combineren met een 

    bewegingsdetector?

    View Slide

  90. oplossing #2
    magneetcontact

    uitzetten bij 

    harde westenwind?

    View Slide

  91. oplossing #3

    View Slide

  92. de wispelturige

    wasmachine

    View Slide

  93. View Slide

  94. View Slide

  95. Standby verbruik

    4,6 watt
    Wasmachine uit

    0,3 watt
    Begin programma

    24,9 watt

    View Slide

  96. View Slide

  97. De was is klaar!

    View Slide

  98. De was is klaar!
    De was is klaar!
    De was is klaar!
    De was is klaar!

    View Slide

  99. View Slide

  100. 2000 watt

    View Slide

  101. 20 - 200 watt

    View Slide

  102. 2 - 5 watt

    View Slide

  103. De was is klaar!
    De was is klaar!
    De was is klaar!
    De was is klaar!

    View Slide

  104. View Slide

  105. commandArray = {}
    if (uservariables['WasmachineBezig'] == 2) then
    s = uservariables_lastupdate['WasmachineBezig']
    lastUpdate = os.time{
    year=string.sub(s, 1, 4), month=string.sub(s, 6, 7), day=string.sub(s, 9, 10),
    hour=string.sub(s, 12, 13), min=string.sub(s, 15, 16), sec=string.sub(s, 18, 19)
    }
    difference = os.difftime (os.time(), lastUpdate)
    if (difference > 300) then
    commandArray['Variable:WasmachineBezig'] = '0'
    commandArray['OpenURL'] = 'pixel.local/api?command=notify&icon=shirt'
    end
    end
    return commandArray

    View Slide

  106. De was is klaar!

    View Slide

  107. View Slide

  108. View Slide

  109. vragen?

    View Slide