Home Automation Using RPI

21
Bülent ÖZHORASAN Ankara, 22 May 2014

description

Home Automation Using Raspberry PI

Transcript of Home Automation Using RPI

Page 1: Home Automation Using  RPI

Bülent ÖZHORASAN

Ankara, 22 May 2014

Page 2: Home Automation Using  RPI

Caution : Be Careful in Handling Mains Voltage!

Page 3: Home Automation Using  RPI

Welcome

Open Source Hardware Projects Rpi, Arduino

Raspberry Pi Features

Possible Areas of Use

Remote Connecting to Raspberry Pi

Java and Raspberry Pi: Open JDK, Oracle JDK

Page 4: Home Automation Using  RPI

Installing Tomcat

Installing no-ip.org Client and Internet Access

Prime Faces Application Deployed in Tomcat in Raspberry Pi

Source Code Walkthrough

Remote Deploying war file

Hardware interfacing Digital Out

Hardware interfacing Analog In

Fritzing Tool

Demo

Page 5: Home Automation Using  RPI

Beagle Bone (Texas Instruments)

Korean Firm, former game platform

SOC: Sytem on a Chip

Page 6: Home Automation Using  RPI

Single Board Computer Broadcom BCM2835 system on a

chip (SoC) ARM1176JZF-S 700 Mhz processor VideoCore IV GPU 512 MB RAM SD card for booting and persistent

storage. Linux Operating system Low Cost Low Power Python is the native programming

language C,Java,Perl available

Page 7: Home Automation Using  RPI

Hobbies

Educational Purposes

Low Cost File/Media Server

Low Cost Web Server for small applications

Fast Prototyping (In Development Stage)

Even build a home brew supercomputer!

Check

Kickstarter.com

Make: Magazine

Maker faires

Page 8: Home Automation Using  RPI

SSH

Putty and WinSCP

Without router: NO NEED for a cross-over cable. RPi LAN chip is smart enough to reconfigure itself for direct network connections.

Routerless Connection: dhcpsrv2.4

Mobile Connection: Juice SSH Android

Page 9: Home Automation Using  RPI

Open JDK,Oracle JDK

Oracle JVM with ARM processor support is available

Comes in Raspberry Pi already installed

Pi4J Lib

Page 10: Home Automation Using  RPI

Installing tomcat Download tomcat package and unzip it to /usr/lib/apache-tomcat-7.0.47

tar xzf apache-tomcat-7.0.28.tar.gz cd apache-tomcat-7.0.28/conf vim tomcat-users.xml

Add a user to the authorization file Tomcat-users.xml file directly below <tomcat-users> add <user username="pi" password="raspberry" roles="manager-gui"/>

Start Tomcat sudo sh startup.sh

Page 11: Home Automation Using  RPI

Free Dynamic IP Adress Download no-ip client wget http://www.no-ip.com/client/linux/noip-duc-

linux.tar.gz

Run client sudo /usr/local/bin/noip2

Automatic startup Create script in /etc/init.d

Page 12: Home Automation Using  RPI

Can be used from Mobile Clients,too

Page 13: Home Automation Using  RPI

IoC ◦ GPIOControllerFactory

Testability ◦ Apache Commons PropertiesConfiguration

◦ Parameters.properties

◦ MockGpioController and MockGpioPinDigitalOutput

Page 14: Home Automation Using  RPI

Script using SSH command line tools AutoDeploy.bat: "d:\programs\putty\pscp" -batch -pw raspberry

C:\Users\Root\Desktop\Prime01.war [email protected]:/home/pi "d:\programs\putty\plink" -batch -ssh -2 -l pi -pw raspberry -m "deploy.cmd"

192.168.1.2

Deploy.cmd: echo Shutting down... sudo /usr/lib/apache-tomcat-7.0.47/bin/shutdown.sh echo Shut down... sudo rm -r /usr/lib/apache-tomcat-7.0.47/webapps/Prime01 sudo cp Prime01.war /usr/lib/apache-tomcat-7.0.47/webapps echo Starting ... sudo /usr/lib/apache-tomcat-7.0.47/bin/startup.sh echo Started...

Page 15: Home Automation Using  RPI

Digital Outputs & Relay Driving

Draw no more than 3mA from GPIO ports

A small relay will draw between 50-100mA from 5V power line.

Page 16: Home Automation Using  RPI

Analog Input & Ambient Temperature Sampling

MCP3208 8-Channel 12-Bit A/D Converters

LM35 Precision Centigrade Temperature Sensor

Bit banged SPI (Serial Peripheral Interface) interface of the A/D converter chip programmatically

Rpi, LM35 and MCP3208 Connections

Page 17: Home Automation Using  RPI
Page 18: Home Automation Using  RPI

Testing other app servers namely Nginx

Scalable i2c and SPI interfaces

IoT namely Dweet.IO

SQLite

Page 19: Home Automation Using  RPI
Page 20: Home Automation Using  RPI

http://www.raspberrypi.org

http://www.arduino.cc/

http://www.dhcpserver.de/

http://learn.adafruit.com/reading-a-analog-in-and-controlling-audiovolume-with-the-raspberry-pi

http://pi4j.com/

http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/

Raspberry Pi Measurement Electronics: hardware and software [Kindle Edition]

http://www.zdnet.com/build-your-own-supercomputer-out-of-raspberry-pi-boards-7000015831/

http://fritzing.org/home/

http://www.adafruit.com

Page 21: Home Automation Using  RPI

Thank you for your attention