SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
22 Aug 2015
Android Control Hardware and Arduino IoT
By Soft Power Group http://softpowergroup.net/
Android Communication Hardware
➤ USB
➤ Bluetooth
➤ Wi-Fi
➤ NFC
➤ Telephone ( Voice or DTMF )
➤ SMS
Android Hardware
➤ TFT/OLED Display
➤ Touch Screen
➤ Camera
➤ Sensor
➤ Speaker
➤ Micro phone
➤ GPS
Android Hardware Workshop
➤ Android Device Info
Android Communication Hardware
➤ USB
➤ Bluetooth
➤ Wi-Fi
➤ NFC
20 Aug 2014
Arduino เชื่อมต่อกับ Android ทาง USB
Arduino เชื่อมต่อกับ Android ทาง USB
http://androidcontrol.blogspot.com/2014/06/arduino-usb-servo-motor-control.html
Arduino เชื่อมต่อกับ Android ทาง USB
Arduino Firmata Library
http://arduino.cc/en/Reference/Firmata
Download Firmata Test Program
www.firmata.org
Upload Firmata Sketch
Test Program
USB Workshop
- Arduino Firmata Library
- Program Test on PC
- Android USB OTG
- Android Example Code
- Android USB Control Relay Output
Arduino IDE Download
https://www.arduino.cc/en/Main/Software
Arduino เชื่อมต่อกับ Android ทาง USB
https://play.google.com/store/apps/details?id=arduino.control.servo
Arduino เชื่อมต่อกับ Android ทาง USB
Bluetooth Module
Bluetooth
➤ เปิดการใช้งานบลูทูธ
➤ ค้นหาอุปกรณ์ จับคู่
➤ เชื่อมต่ออุปกรณ์ Connect
➤ รับ - ส่งข้อมูล
Bluetooth API
Bluetooth Adapter - ค้นหาอุปกรณ์ จับคู่
Bluetooth Class - รายละเอียดหาอุปกรณ์บลูทูธ
Bluetooth Device - ทางานเชื่อมต่ออุปกรณ์
Bluetooth Socket - จัดการ รับส่งข้อมูล
Bluetooth ServerSocket - เปิดช่องสัญญานเพื่อ
ตรวจจับอุปกรณ์บลูทูธอื่นๆ
Arduino เชื่อมต่อกับ Android ทาง Bluetooth
http://androidcontrol.blogspot.com/2014/06/arduino-control-rgb-leds-via-bluetooth.html
Arduino เชื่อมต่อกับ Android ทาง Bluetooth
http://androidcontrol.blogspot.com/2014/06/arduino-control-rgb-leds-via-bluetooth.html
Bluetooth Workshop
- Bluetooth Control Output
- Bluetooth Control RGB LEDs
- Bluetooth Control Servo
Arduino เชื่อมต่อกับ Android ทาง Bluetooth
https://play.google.com/store/apps/details?id=arduino.bluetooth.rgbleds
Arduino เชื่อมต่อกับ Android ทาง Bluetooth
Ethernet & Wi-Fi Module
Arduino WebServer
การใช้งาน Http Connection ( Android )
HttpURLConnection conn = null;
try {
conn = (HttpURLConnection)new URL("http://someurl").openConnection();
conn.setRequestMethod("GET");
conn.setInstanceFollowRedirects(true);
conn.setUseCaches(false);
int resCode = conn.getResponseCode();
if (resCode == HttpURLConnection.HTTP_OK) {
InputStream is = conn.getInputStream();
ByteArrayOutputStream bos =
new ByteArrayOutputStream();
int read = 0;
while ((read = is.read()) != -1) {
bos.write(read);
}
byte[] result = bos.toByteArray();
bos.close();
}
( code ต่อหน้า 2 )
else {
// do something
}
conn.disconnect();
}
catch (Exception e) {
// do something
}
Web Server Control
JSON and XML
ในการติดต่อสื่อสารข ้อมูลต่างๆ ระหว่าง Client – Server นั้น
จาเป็นจะต ้องมีภาษากลางที่ใช ้สาหรับพูดคุยหรือส่งหากัน
XML eXtensible Markup Language
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to> Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
JSON
ในการติดต่อสื่อสารข ้อมูลต่างๆ ระหว่าง Client – Server นั้น
จาเป็นจะต ้องมีภาษากลางที่ใช ้สาหรับพูดคุยหรือส่งหากัน ซึ่งในปัจจุบัน
นั้นภาษากลางดังกล่าวที่ได ้รับความนิยมสูงมากคือ JSON
โดย tag ของ JSON นั้นมีลักษณะดังนี้
{"NAME1" : "VALUE1", … , "NAMEn" : "VALUEn"}
{"NAME" : {"NAME1" : "VALUE1", … , "NAMEn" : "VALUEn"} }
{"NAME" : ["VALUE1", … , "VALUEn"]}
{"NAME" : [{"NAME1" : "VALUE1", … , "NAMEn" : "VALUEn"},
. . .
,{"NAME1" : "VALUE1", … , "NAMEn" : "VALUEn"}] }
Wi-Fi Workshop
- HTTP JSON http://openweathermap.org/api
- Wi-Fi Connection
- Arduino Ethernet Web Server
- Arduino Wi-Fi ESP8266 Web Server
Arduino Smart Home Automation
http://androidcontrol.blogspot.com/2014/08/arduino-smart-home-automation.html
Arduino WiFi Control with ESP8266 Module
http://androidcontrol.blogspot.com/2015/05/arduino-wifi-control-with-esp8266-module.html
Android Hardware อื่นๆ
➤ Telephone โทรเข้า โทรออก
➤ SMS
➤ Camera กล้องหน้า กล้องหลัง
➤ Sensors ตรวจจับความสว่าง,อุณหภูมิ, ความเอียง
➤ GPS พิกัด ตาแหน่ง
➤ NFC
➤ Sound & Vibration
Internet of Things Protocol
Internet of Things Protocol
➤ HTTP Hyper Text Transfer Protocol
➤ MQTT Message Queue Telemetry Transport
➤ CoAP Constrained Application Protocol
➤ XMPP Extensible Messaging and Presence Protocol. Cisco
➤ AMQP Advanced Message Queuing Protocol
➤ DDS Data Distribution Service
➤ Continua – Home Health Device
➤ UPnP
➤ ETSI SmartM2M
Internet of Things Protocol
➤ HTTP
➤ MQTT
HTTP Protocol
Server Client
Device
(server )
System
(client )
HTTP GET /< resource >
HTTP 200 OK (< resource >)
(long)
polling
HTTP Protocol
• Client / Server
• ASCII based ( Content-Type based on MIME )
• REST API ( POST,GET,PUT,DELETE )
• TCP Transmission Control Protocol
MQTT Protocol
MQTT Protocol
MQTT Protocol
Device Broker
PUBLISH /$TEL/ group_id /device_id /< resource >
acknowledgement (based on QoS )
PUBLISH /$TEL/ group_id /device_id /< resource >
acknowledgement (based on QoS )
PUBLISH /$TEL/ group_id /device_id /< resource >
acknowledgement (based on QoS )
* $TEL as base for topics not needed
MQTT Client
http://www.eclipse.org/paho/
Mosquitto
An Open Source MQTT v3.1/v3.1.1 Broker
http://mosquitto.org/
MQTT Protocol
• Publish / Subscribe
• Topics based
• M2M
IoT Protocol
IoT Cloud Service
➤ CloudMQTT http://www.cloudmqtt.com/
➤ ThingSpeak https://thingspeak.com/
➤ IBM BlueMix http://www.ibm.com/cloud-computing/bluemix/
➤ PubNub http://www.pubnub.com/
CloudMQTT http://www.cloudmqtt.com/
ThingSpeak https://thingspeak.com/
IBM Bluemix http://www.ibm.com/cloud-computing/bluemix/
PubNub http://www.pubnub.com/
IoTCloud Service Workshop
- CloudMQTT
- ThingSpeak
- IBM Bluemix
- PubNub
ESP8266 Wi-Fi Module
ESP8266 Wi-Fi Module
• 802.11 b/g/n protocol (2.4GHz / 5GHz);
• Wi-Fi Direct (P2P), Soft-AP
• Integrated TCP/IP protocol stack
• UART serial connection
• 3.3V power supply
• +19.5dBm output power
ESP8266 Development
• ESP8266 Firmware Update
• ESP8266 Development Board
ESP8266 Development
• Arduino IDE ( C/C++ )
• AT Command Mode
• SoC Mode
IoT ESP8266 Workshop
- CloudMQTT
- ThingSpeak Sensor Monitor
- ThingSpeak Control Devices
- Smart Config
Android IoT ThingSpeak Sensor Data Monitor
http://androidcontrol.blogspot.com/2015/06/android-iot-thingspeak-data-monitor.html
Android Arduino IoT Control Devices with ThingSpeak.com
http://androidcontrol.blogspot.com/2015/06/android-iot-control-thingspeak.html
Thank You
Q&A
Website : http://SoftPowerGroup.net
Blog : http://androidcontrol.blogspot.com/

Weitere ähnliche Inhalte

Andere mochten auch

Arduino Based Home Automation (2003) (1003018)
Arduino Based Home Automation (2003) (1003018)Arduino Based Home Automation (2003) (1003018)
Arduino Based Home Automation (2003) (1003018)Rappy Saha
 
Home automation using IoT
Home automation using IoTHome automation using IoT
Home automation using IoTAthira_1993
 
Wearable Device (Bluetooth Low Energy BLE ) connect with Android
Wearable Device (Bluetooth Low Energy BLE ) connect with  AndroidWearable Device (Bluetooth Low Energy BLE ) connect with  Android
Wearable Device (Bluetooth Low Energy BLE ) connect with AndroidAdun Nanthakaew
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoEoin Brazil
 
Introduction to iot and arduino uno r3
Introduction to iot and arduino uno r3Introduction to iot and arduino uno r3
Introduction to iot and arduino uno r3Saurav Chaudhary
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobilesDurairaja
 
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-gInternet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-gMohan Kumar G
 
IoT - IT 423 ppt
IoT - IT 423 pptIoT - IT 423 ppt
IoT - IT 423 pptMhae Lyn
 
Arduino Presentation
Arduino PresentationArduino Presentation
Arduino PresentationDavide Gomba
 
Arduino based Home Automation System with Android
Arduino based Home Automation System with AndroidArduino based Home Automation System with Android
Arduino based Home Automation System with AndroidSayan Seth
 
Internet of things for Smart Home
Internet of things for Smart Home Internet of things for Smart Home
Internet of things for Smart Home Khwaja Aamer
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOEklavya Sharma
 
Internet of Things and its applications
Internet of Things and its applicationsInternet of Things and its applications
Internet of Things and its applicationsPasquale Puzio
 
Smart farm SME Chiangmai Maker Club
Smart farm SME Chiangmai Maker ClubSmart farm SME Chiangmai Maker Club
Smart farm SME Chiangmai Maker ClubAdun Nanthakaew
 
Arduino Based Home Automation System with Android and
Arduino Based Home Automation System with Android andArduino Based Home Automation System with Android and
Arduino Based Home Automation System with Android andAnish Basu
 
Home Automation by ESP8266
Home Automation by ESP8266Home Automation by ESP8266
Home Automation by ESP8266Gleb Vinnikov
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with AndroidA. Hernandez
 

Andere mochten auch (20)

Wearables 101
Wearables 101Wearables 101
Wearables 101
 
Arduino Based Home Automation (2003) (1003018)
Arduino Based Home Automation (2003) (1003018)Arduino Based Home Automation (2003) (1003018)
Arduino Based Home Automation (2003) (1003018)
 
Home automation using IoT
Home automation using IoTHome automation using IoT
Home automation using IoT
 
Wearable Device (Bluetooth Low Energy BLE ) connect with Android
Wearable Device (Bluetooth Low Energy BLE ) connect with  AndroidWearable Device (Bluetooth Low Energy BLE ) connect with  Android
Wearable Device (Bluetooth Low Energy BLE ) connect with Android
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Introduction to iot and arduino uno r3
Introduction to iot and arduino uno r3Introduction to iot and arduino uno r3
Introduction to iot and arduino uno r3
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobiles
 
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-gInternet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
 
IoT - IT 423 ppt
IoT - IT 423 pptIoT - IT 423 ppt
IoT - IT 423 ppt
 
Arduino Presentation
Arduino PresentationArduino Presentation
Arduino Presentation
 
Arduino based Home Automation System with Android
Arduino based Home Automation System with AndroidArduino based Home Automation System with Android
Arduino based Home Automation System with Android
 
Internet of things for Smart Home
Internet of things for Smart Home Internet of things for Smart Home
Internet of things for Smart Home
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINO
 
Internet of Things and its applications
Internet of Things and its applicationsInternet of Things and its applications
Internet of Things and its applications
 
home automation
home automationhome automation
home automation
 
Smart farm SME Chiangmai Maker Club
Smart farm SME Chiangmai Maker ClubSmart farm SME Chiangmai Maker Club
Smart farm SME Chiangmai Maker Club
 
Arduino Based Home Automation System with Android and
Arduino Based Home Automation System with Android andArduino Based Home Automation System with Android and
Arduino Based Home Automation System with Android and
 
Home Automation by ESP8266
Home Automation by ESP8266Home Automation by ESP8266
Home Automation by ESP8266
 
Controlling an Arduino with Android
Controlling an Arduino with AndroidControlling an Arduino with Android
Controlling an Arduino with Android
 
Node MCU Fun
Node MCU FunNode MCU Fun
Node MCU Fun
 

Ähnlich wie Android Control Hardware and Arduino IoT ( 22 Aug 15 ) (20)

e-Publishing
e-Publishinge-Publishing
e-Publishing
 
โปรโตคอล
โปรโตคอลโปรโตคอล
โปรโตคอล
 
Slide 9 april_2011_pdf
Slide 9 april_2011_pdfSlide 9 april_2011_pdf
Slide 9 april_2011_pdf
 
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
การพัฒนาเอกสารออนไลน์ขั้นสูง Lect 05
 
Red5 streaming
Red5 streamingRed5 streaming
Red5 streaming
 
Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2Basic configuration fortigate v4.0 mr2
Basic configuration fortigate v4.0 mr2
 
4
44
4
 
4
44
4
 
Red5 streaming template
Red5 streaming templateRed5 streaming template
Red5 streaming template
 
Red5 workshop
Red5 workshopRed5 workshop
Red5 workshop
 
Tcp
TcpTcp
Tcp
 
Centralized Log Server Thai version
Centralized Log Server Thai versionCentralized Log Server Thai version
Centralized Log Server Thai version
 
Joomla CMS
Joomla CMSJoomla CMS
Joomla CMS
 
Proxy fc4 web
Proxy fc4 webProxy fc4 web
Proxy fc4 web
 
Basic Kong API Gateway
Basic Kong API GatewayBasic Kong API Gateway
Basic Kong API Gateway
 
Python Programming for Lecturer_RUS_Nonthaburi 17may2019
Python Programming for Lecturer_RUS_Nonthaburi 17may2019Python Programming for Lecturer_RUS_Nonthaburi 17may2019
Python Programming for Lecturer_RUS_Nonthaburi 17may2019
 
นุ๊ก
นุ๊กนุ๊ก
นุ๊ก
 
โบ
โบโบ
โบ
 
Best
BestBest
Best
 
หมวย
หมวยหมวย
หมวย
 

Android Control Hardware and Arduino IoT ( 22 Aug 15 )