email 4 blackout

15
Rino Ragucci Questa opera è pubblicata sotto una Licenza Creative Commons Attribuzione 3.0 Italia (CC BY NC ND 3.0) Giffoni Open Makers Day 09/11/2013 EMAIL 4 BACK-UP

Upload: open-makers-italy

Post on 13-May-2015

69 views

Category:

Education


2 download

DESCRIPTION

Event: Giffoni Open Makers Day 2013 Speaker: Rino Ragucci Progetto Arduino. Internet of things: in caso di blackout casalingo il sistema permette di inviare una email di avviso del problema.

TRANSCRIPT

Page 1: Email 4 blackout

Rino Ragucci

Questa opera è pubblicata sottouna Licenza Creative Commons Attribuzione 3.0 Italia (CC BY NC ND 3.0)

Giffoni Open Makers Day

09/11/2013

EMAIL 4 BACK-UP

Page 2: Email 4 blackout

Intro

Come nasce l'idea? Approccio tradizionale vs making Abbassamento della soglia di difficoltà e

costo (hw in gran parte già disponibile) Incremento di know-how (tecnica R&D)

Page 3: Email 4 blackout

26/08/1991 - Linux

Page 4: Email 4 blackout

Prime tracce scritte

Page 5: Email 4 blackout

ARDUINOUNO

RELAY 5VSPDT

UPS Alimentatore 7V

SHIELDETHERNET

RJ45

Alimentatore 5.5V

NC

PIN2 Input digitale

NDCOM

S

GND

5V

+

--

+

-- --

+

PWR 220V AC soggetto a blackout

Modem ADSLLAN switch

GND

10 KOhm

100 Ohm

Architettura

Page 6: Email 4 blackout

Architettura

Page 7: Email 4 blackout

+Know how: relè

un interruttore che viene azionato da un elettromagnete

Relè 5V SPDT (Single Pole, Double Throw)

NC (Normally Connected) COM (Common) ND (Normally Disconnected)

Page 8: Email 4 blackout

Prima versione

Acquisto relay Realizzazione prima versione

sketch Funzionamento inaffidabile

Page 9: Email 4 blackout

+Know how: floating input

Problema: pin2 di input connesso a nulla quando relay passa nello stato dis-eccitato (black-out in atto)

Soluzione: pull down resistor

Page 10: Email 4 blackout

+Know how: debouncing

Page 11: Email 4 blackout

+Know how: debouncing in sw

void loop(){

int d; // read the state of the Input Pin: currentState= digitalRead(buttonPin); if (currentState != previousState){ d= debouncing(); if (d==1) changeStateHandler(); } previousState= currentState; //Serial.println(time); //6ms //delay(100);}

int debouncing(){ delay(100); previousState= currentState; currentState= digitalRead(buttonPin); if (currentState == previousState) return 1; else return 0;

}

Page 12: Email 4 blackout

+Know how: debouncing

Page 13: Email 4 blackout

+Know how: SMTP servers

Difficile oggi trovare SMTP server che accettino posta indipendentemente dal proprio provider della connessione (causa antispam)

Gmail: https

Page 14: Email 4 blackout

Possibili sviluppi futuri

reset Basetta millefori Porting su altro hw con web

server Sistema domotico multifunzione

Page 15: Email 4 blackout

Grazie per l'attenzione

Domande?

Saluti