Documente Academic
Documente Profesional
Documente Cultură
Project:
http://pi4j.com
Blog:
http://savagehomeautomation.com
#Devoxx #pi4j
@savageautomate | @pi4j
Agenda
Pi4J Overview
Pi4J Introductory Concepts
Smart Devices & IoT
DIY Smart Devices
MQTT
#Devoxx #pi4j
@savageautomate | @pi4j
What is Pi4J
Pi4J is an open-source project providing a library for Java
programmers to interact with the low-level I/O capabilities
on the Raspberry Pi platform.
www.pi4j.com!
@savageautomate | @pi4j
Data Interfaces
UART, SERIAL
SPI
IC
Analog Interfaces *
#Devoxx #pi4j
@savageautomate | @pi4j
GPIO
Input or Output
Digital States
Models
#Devoxx #pi4j
@savageautomate | @pi4j
HIGH (+3VDC)
3.3 VDC
0 VDC
GPIO
LOW (0 VDC)
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
GPIO Outputs
GPIO Outputs can be used to control things
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
12 VDC"
Power Source!
12 VDC "
Strobe"
Light!
12 VDC
Illuminated "
Switch!
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
Demo
#Devoxx #pi4j
@savageautomate | @pi4j
GPIO Inputs
GPIO Inputs can be
used to sense things
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
PULL-UP
Resistance provides a reference (bias) to
+3.3 VDC. If your circuit expects to provide
GROUND to signal the GPIO pin LOW, then
you need a PULL-UP reference.
#Devoxx #pi4j
@savageautomate | @pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
input.addListener((GpioPinListenerDigital)
(GpioPinDigitalStateChangeEvent
event)
->
{
!
});
#Devoxx #pi4j
@savageautomate | @pi4j
Demo
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
Keypad
Light / LED
Dimmable Light
LCD
Power Controller
Relay
#Devoxx #pi4j
Momentary Switch
Toggle Switch
Analog Sensor
Distance Sensor
Motion Sensor
Temperature Sensor
@savageautomate | @pi4j
//
usage
example
light.on();
(or)
light.off();
#Devoxx #pi4j
@savageautomate | @pi4j
Demo
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
#Devoxx #pi4j
@savageautomate | @pi4j
Pi4J
#Devoxx #pi4j
@savageautomate | @pi4j
Pi4J
Control
other
devices
#Devoxx #pi4j
Remotely
Monitor
@savageautomate | @pi4j
HVAC Alarm:
Pi4J
Control
other
devices
#Devoxx #pi4j
@savageautomate | @pi4j
Mail Notification:
Pi4J
Control
other
devices
Remotely
Monitor
#Devoxx #pi4j
@savageautomate | @pi4j
Driveway Alarm:
Notifications
Pi4J
Control
other
devices
Infrared Beam Sensors
#Devoxx #pi4j
@savageautomate | @pi4j
Notifications
Remotely monitor
and control
Door Sensor
#Devoxx #pi4j
Pi4J
@savageautomate | @pi4j
Sprinkler System
Sprinkler Controller
Rain Sensor
#Devoxx #pi4j
Notifications
Weather Forecasts
Pi4J
Remote Control
and Monitoring
@savageautomate | @pi4j
Security System
Notifications
Security System
Remote
Control
and
Monitoring
Pi4J
#Devoxx #pi4j
@savageautomate | @pi4j
HVAC System
Notifications
Thermostat
Remote
Control
and
Monitoring
Pi4J
#Devoxx #pi4j
@savageautomate | @pi4j
Driveway Alerts
Flood Alerts
Mailbox Notifications
HVAC System Alerts
#Devoxx #pi4j
Pi4J
@savageautomate | @pi4j
Demo
#Devoxx #pi4j
@savageautomate | @pi4j
Basement
#Devoxx #pi4j
Attic
Mailbox
Garage
@savageautomate | @pi4j
MQTT
MQTT Client
MQTT Client
MQTT
BROKER
Basement
MQTT Client
Attic
#Devoxx #pi4j
Mailbox
MQTT Client
Garage
@savageautomate | @pi4j
MQTT
MQTT Client
MQTT Client
MQTT
BROKER
Desktop
MQTT Client
Tablet
#Devoxx #pi4j
Web Server
MQTT Client
Mobile
@savageautomate | @pi4j
MQTT Overview
#Devoxx #pi4j
@savageautomate | @pi4j
MQTT Features
(topics)
@savageautomate | @pi4j
MQTT Topics
#Devoxx #pi4j
@savageautomate | @pi4j
MQTT Software
Broker (Server)
Mosquito
http://www.mosquitto.org/
!
Paho (Client)
Eclipse
http://www.eclipse.org/paho/
!
MQTT.Fx
http://mqttfx.jfx4ee.org/
by Jens Deters (@Jerady)
#Devoxx #pi4j
@savageautomate | @pi4j
Demo
#Devoxx #pi4j
@savageautomate | @pi4j
2015 Goals
Start creating
#Devoxx #pi4j
and Java.
Create a blog article for each project and publish the wiring
diagrams, source code, and materials listing.
Implement these DIY smart devices throughout my home
and create a smart home.
Aggregate the information from these connected smart
devices to start creating an intelligent and automated home
@savageautomate | @pi4j
Questions
#Devoxx #pi4j
@savageautomate | @pi4j
@savageautomate
pi4j.com
@pi4j
#Devoxx #pi4j
@savageautomate | @pi4j