kevin hoyt, "on the verge of genius: smart cities workshop"
TRANSCRIPT
On the Verge of GeniusExploring smart cities, agriculture, and health care.
Crowdsourcing
CSSISAWESOME
BIAS
Overconfidence BiasOverconfidence Bias
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NONO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NONO
NO
NO
NO
NO
NO
NO
NO
Confirmation BiasConfirmation Bias
Loss-Aversion BiasLoss-Aversion Bias
Input BiasInput Bias
Default BiasDefault Bias
Smart CitiesSmart Cities
<geek>
● ATmega328 (16MHz)● Input voltage 7-15V● 14 digital IO pins● 6 pulse width modulation (PWM)● 6 analog inputs● 32k flash memory
long count = 0;
void setup() {
Serial.begin( 9600 );
}
void loop() {
count = count + 1;
Serial.println( count );
delay( 1000 );
}
Node.jsGet serial data from Arduino.
var serialport = require( 'serialport' );
var SerialPort = serialport.SerialPort;
var arduino = new SerialPort( '/dev/cu.usbserial-DA01L7G3', {
baudrate: 9600,
parser: serialport.parsers.readline( '\n' )
} );
arduino.on( 'data', function( data ) {
console.log( 'Count: ' + data );
} );
Watson IoTSend data to Watson IoT for distribution.
● Pioneered at IBM (1999)● ISO standard● OASIS specification● Publish-subscribe pattern● On top of TCP/IP● Broad adoption
○ Facebook Messenger○ Amazon Web Services○ Microsoft Azure○ IBM Bluemix (Waton IoT)
Publisher Publisher Publisher
Broker
Subscriber Subscriber Subscriber
// Node libraries
var jsonfile = require( 'jsonfile' );
var mqtt = require( 'mqtt' );
var serialport = require( 'serialport' );
var SerialPort = serialport.SerialPort;
// Watson IoT connection properties
var config = jsonfile.readFileSync( 'config.json' );
// Connect to Watson IoT broker
var client = mqtt.connect( config.host, {
clientId: config.client + Math.round( Math.random() * 1000 ),
password: config.password,
port: config.port,
username: config.user
} );
// Connect to Arduino
var arduino = new SerialPort( '/dev/cu.usbserial-DA01L7G3', {
baudrate: 9600,
parser: serialport.parsers.readline( '\n' )
} );
// Listen for data from the Arduino
// Send JSON-formatted data to Watson IoT
arduino.on( 'data', function( data ) {
console.log( 'Count: ' + data );
client.publish( config.topic, JSON.stringify( {
count: parseInt( data )
} ) );
} );
Browser (Client)Get Watson IoT data in a web page.
// Instantiate client
try {
client = new Paho.MQTT.Client(
IOT_HOST,
IOT_PORT,
IOT_CLIENT + Math.round( Math.random() * 1000 )
);
// Handle incoming messages
client.onMessageArrived = doCountArrived;
} catch( error ) {
console.log( 'Error: ' + error );
}
// Connect to Watson IoT
client.connect( {
userName: IOT_USER,
password: IOT_PASSWORD,
onSuccess: doClientConnect,
onFailure: doClientFailure
} );
// Subscribe for data once connected
function doClientConnect( context ) {
console.log( 'Connected.' );
client.subscribe( IOT_TOPIC );
}
// Unable to connect
function doClientFailure( context, code, message ) {
console.log( 'Connection fail.' );
}
// Message arrived
function doCountArrived( message ) {
var data = null;
var element = null;
// Parse JSON-formatted string
data = JSON.parse( message.payloadString );
console.log( data );
// Place on screen
element = document.querySelector( '.count' );
element.innerHTML = data.count;
}
● Humidity● Temperature● Barometric Pressure● Light levels● Wind speed● Wind direction● Rainfall
● 56 channel● 1-10Hz update rate● 29 second cold start● TTL connection (serial)
● Fix taken at 12:35:19 UTC● Latitude 48 deg 07.038' N● Longitude 11 deg 31.000' E● Fix quality: 1 = GPS fix● 8 satellites being tracked● 0.9 horizontal dilution of position● 545.4,M altitude in meters above mean sea level● 46.9,M height of mean sea level● (empty field) time in seconds since last update● (empty field) station ID number● *47 checksum data
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
● OBD-II version 2.1● Bluetooth connection (serial)● No batteries required● 5-10m range
atz // OBD protocol > ELM327 v1.3a
atrv // Vehicle voltage > 12.5V
atsp0 // Protocol level > OK
0100 // Current data > 41 00 BF 9F A8 93
010c // Engine RPM > 41 0C 0E 96
</geek>
9.6 billion people by 2050Food production must increase by
70% to meet demand.
9.6 billion people by 205070% of the world’s freshwater
supply is consumed by agriculture.
● Precision livestock farming
● GPS location of animal● Body temperature● Animal activity● Tissue resistivity● SMS when ready for
reproduction
● Linear mapping of 10km^2● Uses a parachute to land● 12 megapixel camera
(stabilized)● Fertilize only those areas
that need it
● The field is the new office● Data is the new fertilizer● From 900 acres to 5,000 acres● Two minutes for recommendations
<geek>
V+
V-
Time
On
Off Time
// Serial reporting
void setup() {
Serial.begin( 9600 );
}
void loop() {
int value = analogRead( A0 );
Serial.println( value );
// Wait a second
delay( 1000 );
}
On
Off Time
● Particulate matter level (PM)● Low Pulse Occupancy time (LPO)● 1um or larger● 5V input voltage● Grove compatible interface● Pulse Width Modulation (PWM)● 10k Ohm resistor for sensitivity
● Based on DB18B20● 3.3-5V input voltage● -55C to 125C range● +/-0.5C from -10C to 85C● 1 Wire interface● Waterproof● Requires 4.7k Ohm pull-down
● 0-14 pH range● 1 second response time● Laboratory grade
</geek>
SELF DIAGNOSIS WITH WEBMD.COM
Ailments before signing on Ailments after signing on
Slight cough and fever
Meningitis
Inflamed gallbladder
Oh no - Multiple myeloma
Aids - maybe?
Helicobacter pylori - I think
Complications from pollution include heart disease, stroke, and asthma.
<geek>
● Electromyography (EMG)● Muscle electrical activity● Wearable design● LED indicators● Two output modes
○ EMG envelope○ Raw EMG
● Heart rate monitor armband● Support for Garmin ANT+● Support for Bluetooth Smart● Submersible up to 1m● 8 hour rechargeable battery
</geek>