2013.10.05 GDG Hyderabad DevFest
May 12, 2015
2013.10.05 GDG Hyderabad DevFest
Using Chrome Serial API with Arduino
(Integrating Chrome with Embedded Systems)
2
Syed Anwaarullah
Agenda
• Introduction
• Demo
• Implementation
• Q&A
3
My two cents…
4
How many side does a coin have?
Software Hardware+ = ∞
What is…IoT?
5
•The Internet of Things is a computing concept where everyday physical objects will be connected to the Internet
•They will also be able to identify themselves to other devices
• IoT describes a world where just about everything can be connected and communicate in an intelligent fashion
What is…
No. Slide
IoT…
No. Slide
Where does Chrome Stop?
7
Chrome Browser is…
• _______________
• _______________
• _______________
Is that all? Should we stop here?
FastestSecureMost popular
Chrome Extensions“Small Software programs that can modify and enhance the functionality of the Chrome browser”http://developer.chrome.com/extensions/index.html
• Little or No User Interface
• Essentially web pages and can use all APIs provided by browser to web pages
• User downloads and installs them
• chrome.* APIs
• Extension has:A manifest file, one or more HTML and JS files
8
Chrome Packaged Apps
9
“Packaged Apps deliver an experience as capable as a native app. http://developer.chrome.com/apps/about_apps.html
• Written in HTML5, JavaScript, CSS
• Looks and behaves like a standalone web app outside the browser
• Have access to Chrome APIs and services not available to web traditional web apps like interaction with Network and Hardware devices, media tools etc
• chrome.serial API, chrome.bluetooth, chrome.usb
What is Arduino?
10
“Open-source electronic prototyping platform allowing to create interactive electronic objects
• USB-Serial Interface for communicating with PC (uploading code as well)
• Arduino code based on C/C++• Thousands of libraries available
Lets build an IOT device using Chrome Serial API and Arduino
11
The UML aka Circuit Diagram
Demo…
12
Demo
chrome.serial API
13
Use this API to read from and write to a device connected to a serial port
chrome.serial API methods
• getPorts• open• read• write• close
Dissecting the Chrome App
14
Tells Chrome about the app, what it is, how to launch and permissions required
Create the event page responsible for managing app cycle
Contains UI elements; sliders, labels etc
Contains action listeners for the UI elements. Sends Serial data to Arduino using API
How to launch this app in Chrome…
Dissecting the Arduino Code
15
setup() Initialization
loop() Super loop, no exit
Serial Serial Communication Library
Q&A
16
17
“Using Chrome Serial API with Arduino”
Thank you!
Source Code:
Syed AnwaarullahBlog: http://anwaarullah.com
Email: [email protected]: 0990-88-777-64
About Me:
• Java, GWT, MS CRM; 3+ yrs• Open Source H/W S/W
advocate• Electronics Engineer -
Education• Hardware – Software
Integrator• Android, LeapMotion,
Raspberry Pi, Robotics, AI, 3D Printing, Embedded Electronics, IoT etc…