Upload
gowtham-raj
View
216
Download
0
Embed Size (px)
Citation preview
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
1/28
I
APPLICATION FOR DISABLED TO CONTROL
A MULTICOLOURED LAMP USING ARDUINO
AND ANDROID
Submitted By:
1. Aluri Yasaswy (CB.EN.U4CSE11303)2. Gowtham Raj.P (CB.EN.U4CSE11317)3. Hiran.S.H (CB.EN.U4CSE11318)4. Nirmal.G (CB.EN.U4CSE11332)5. Sachin.P.C (CB.EN.U4CSE11343)
Amrita Vishwa Vidyapeetham
Dept. of English
1st April 2012
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
2/28
II
DECLARATION
I hereby declare that the project work entitled Controlling a Multi Coloured
Lamp using Amarino, Android and Arduino. Submitted to the dept. of English,
Amrita School of Engineering is a record of the original work done by our team.
This project has not been performed as the basis for any degree or diploma or
associate ship or fellowship and similar project if any.
GOWTHAM RAJ.P
ALURI YASASWY
HIRAN.S.H
NIRMAL.G
SACHIN.P.C
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
3/28
III
ACKNOWLEDGEMENT
First of all, we would like to thank everyone who let us use or modify their codeor Arduino libraries to create the projects and who gave technical assistance oradvice. Thanks to Rhio Labs for providing us with parts and for letting us usetheir images. Thanks also to the Arduino core team without whom the fantasticArduino and its community would not even exist. Finally, thanks to all thosepeople on the Arduino Forum, Arduino IRC channel, and Twitter for your help,advice, and encouragement.If we have missed anyone, my apologies and thanks to you, too.
PLACE : Ettimadai, Coimbatore.DATE : 31st March 2012.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
4/28
IV
CONTENTS
S.No TITLE OF THE CHAPTER
PAGE
NO
1 Abstract 1
2 Chapter 1
Introduction 23 Chapter 2
Definition of Various Terms 44 Chapter 3
Configuration of the Project 155 Chapter 4
Conclusion 24
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
5/28
1
ABSTRACT
Normally Smartphone events are tightly coupled to your phone device
itself. When your cell phone is ringing, your phone speaker plays a ringtone.
When you get a new text message, your phone displays it on its screen. Wouldn't it
be thrilling to make those phone events visible somewhere else, on your wearable,
in your living room, on your robot, in your office or where ever you want it to
occur? Or would you like to use your Smartphone sensors, like the accelerometer,
light sensor, compass or your touch screen to control other devices? 'Android
meets Arduino' is a toolkit, basically consisting of an Android application and an
Arduino library which will help you to interface with your phone in a new
dimension. Your Android phone can even be made to sense external factors like
temperature, light intensity remotely. Deadly disease like Polio and old age make
many people disabled and make it difficult for them even to walk. So it makesthem dependent on others for all the works they desire to do. For example, they
must be dependent on others even to Switch on and off, a light. As budding
engineers it is our responsibility to find a solution for this problem. So we
have developed an Android app to remotely control ordinary electrical lights by
using an open source board known as Arduino and a software interface known as
Amarino( for Android platform). Our project also addresses the problem of power
consumption as we can control the intensity of the light source. Usually our home
lights (LED or tube lights) have only two states, i.e. ON and OFF state and has
no provision to change its intensity of light as required. This can result in
constant usage of power even when it is not required. Our project handles this
problem also as we can control the intensity of light. Basically Arduino is an openSource (both in terms of software and hardware) board which comes with an
Integrated Development Kit (IDE) which is used to write user defined programs
for Arduino. Arduino can be used as a controller or as a sensor. Arduino can
receive external inputs from Android mobile by using a Blue Tooth module known
as BlueSmirf. Our project is shown in the figure. Here as a prototype, we are
showing how to control 3 different colored LEDs as per the input from ourAndroid phone. The communication takes place via Bluetooth. Control signals are
sent to the BlueSmirf and based on it, Arduino varies the power to the LEDs and
hence the intensity of the light varies.
Key words: Arduino, Amarino, Android, Blue smrif gold adapter, Baud rate.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
6/28
2
CHAPTER 1
INTRODUCTION
The capabilities of smart phones are increasing day by day with loads of newfeatures. But all such features are limited within the small box. Only a very fewinnovative techniques are available for smart phones to gain access and controlexternal interfaces like hardware devices.
Even the most powerful smart phones, with access to worldwide information
network, still focus attention on a single box
- Mark Weiser
When we were looking for ways to connect temperature sensors to our PC so wecould make a Cloud Detector we found Arduino. We wanted to try out a clouddetection concept wed read about on a weather forum, and as it was
experimental, we didnt want to spend a lot of money on it in case it failed. There
were many solutions on the market, but the Arduino appealed to us the most. Notonly did it seem to be an easy and cheap way to connect the sensors we requiredbut it could be used for other cool things. Thousands of projects in blogs, videosites, and forums showed the cool things people were doing with their Arduino.There seemed to be a huge sense of community with everyone trying to help eachother.
For the smart phones to control a hardware device or to act as a heat or lightsensor we need an external circuitry that communicates between the phone andthe client device (like LEDs in our prototype). There are 3 frequently used i/o
boards for this purpose. They are
Arduino Netudino Beagle board
And also we need a software interface that can bridge the board and our android
mobile. AMARINO serves this purpose; it has many pre defined libraries in itwhich can be used to control the board with little coding knowledge.
Since the Arduino Project started back in 2005, over 150,000 boards have beensold worldwide to date. The number of unofficial clone boards sold no doubtoutweighs the official boards, thus its likely that over half a million Arduino
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
7/28
3
boards and its variants are out in the wild. Its popularity is ever increasing as moreand more people realize the amazing potential of this incredible open sourceproject to create cool projects quickly and easily with a relatively shallow learning
curve
The biggest advantage of the Arduino over other microcontroller developmentplatforms is its ease of use; non-techie people can pick up the basics and becreating their own projects in a relatively short amount of time.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
8/28
4
CHAPTER 2
1. DEFINITION OF VARIOUS TOOLS
1.1 WHAT EXACTLY IS ARDUINO?
Arduino
Wikipedia states An Arduino is a single-board microcontroller and a software
suite for programming it. The hardware consists of a simple open hardware
design for the controller with an Atmel AVR processor and on-board I/O support.
The software consists of a standard programming language and the boot loader
that runs on the board.
Arduino is an open-source physical computing platform based on a simple input /output board and a development environment that implements the Processing /Wiring language. Arduino can be used to develop stand-alone interactive objectsor can be connected to software on your computer or even operated wireless byBluetooth controlled by an Android mobile. The Arduino can be used to developstand-alone interactive objects or it can be connected to a computer, a network, oreven the Internet to retrieve and send data to and from the Arduino and then act
on that data. In other words, it can send a set of data received from some sensorsto a website, which can then be displayed in the form of a graph.
To be precise, its a physical Input / Output board (I/O) with a programmable
Integrated Circuit (IC). It also has anIntegrated Development Environment(IDE)
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
9/28
5
for programming. Basically, the programming language of Arduino is based on C
language but is largely modeled upon the Application Processing Language (API)
created by www.processing.organd its well documented for beginners to learnand there is a large community supporting it.
The Arduino can be connected to LEDs, dot matrix displays, buttons, switches,motors, temperature sensors, pressure sensors, distance sensors, GPS receivers,Ethernet modules, or just about anything that outputs data or can be controlled. Alook around the Internet will bring up a wealth of projects where an Arduino hasbeen used to read data from or control an amazing array of devices.
This is the Arduino IDE
Arduino is open-source both in terms of software and hardware. Its basic modelcosts about $35 (~ Rs. 1700). It can communicate with a computer via serialconnection over USB or by a Bluetooth. It can be powered from USB orstandalone DC power. It can run standalone from a computer (programmable IC)and it has memory (32 kb flash memory). Separate Arduino IDE is available forWindows, MAC and Linux. It also has a built in Resistor to control the voltagevariation that can occur during its working.
http://www.processing.org/http://www.processing.org/http://www.processing.org/8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
10/28
6
A dot matrix display controlled by an Arduino
The Arduino board is made up of an Atmel AVR Microprocessor, a crystal oroscillator (a crude clock that sends time pulses at a specified frequency to enableit to operate at the correct speed), and a 5-volt linear regulator. Depending onwhat type of Arduino you have, it may also have a USB socket to connect to a PCor Mac for uploading or retrieving data. The board exposes the microcontrollers
I/O (input/output) pins so that you can connect those pins to other circuits or tosensors. The latest Arduino board, the Uno, differs from the previous versions ofthe Arduino in that it does not use the FTDI USB-to-serial driver chip. Instead, ituses an Atmega8U2 programmed as a USB-to serial converter. This gives theboard several advantages over its predecessor, the Duemilanove. First, theAtmega chip is a lot cheaper than the FTDI chip, bringing the prices of the boardsdown. Secondly, and most importantly, it enables the USB chip to have itsfirmware reflashed to make the Arduino show up on your PC as another device,such as a mouse or game controller. This opens up a whole array of new uses forthe Arduino. Unfortunately, moving over to this new USB chip has made it a lotmore difficult for clone manufacturers to make Arduino Uno clones.
1.1.1 What is Arduino used for?
Arduino can prove to be very useful when you want to move beyond thetraditional Mouse, Keyboard and Monitor to develop novel and custominteractions in your project work. It mainly proves handy in
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
11/28
7
Physical Computing projects / research Interactive Installations Rapid prototyping
1.1.2 What it can act as?
Sensors ( to sense stuff ) Push buttons touch pads, tilt switches. Variable resistors (e.g. volume knob / sliders) Photo resistors (sensing light levels) Thermistors (temperature) Ultrasound (proximity range finder)
Actuators ( to control stuff ) Lights, LEDs Motors Speakers Displays (LCD)
Anthros art installation by Richard V. Gilbank controlled using an Arduino
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
12/28
8
1.1.3 GETTING STARTED
Windows 7 & Vista Installation
Once you have downloaded the latest IDE, unzip the file and double-click theunzipped folder to open it. You will see the Arduino files and sub-folders inside.Next, plug in your Arduino using the USB cable and ensure that the green powerLED (labeled PWR) turns on. Windows will attempt to automatically install thedrivers for the Arduino Uno and it will fail. This is normal, so dont worry.
Click the Windows Start button and then click Control Panel. Now click Systemand Security, then click System, and then click Device Manager from the list onthe left hand side. The Arduino will appear in the list as a device with a yellowexclamation mark icon over it to show that it has not been installed properly.Right click on the Arduino Uno and choose Update Driver Software.
Next, choose Browse my computer for driver software and on the next windowclick the Browse button. Navigate to the Drivers folder of the Arduino folder youunzipped earlier and then click OK and then Next. Windows will attempt to installthe driver. A Windows Security box will open up and will state that Windows
cant verify the publisher of this driver software. Click Install this driver
software anyway. The Installing Driver Software window will now do itsbusiness. If all goes well, you will have another window saying Windows hassuccessfully updated your driver software. Finally click Close. To open the IDEdouble-click the Arduino icon in its folder.
1.2WHAT IS AMARINO?Amarino is a toolkit that connects Android-driven mobile devices with Arduinomicrocontrollers, making it easy to control objects in the environment with aphone.
What Arduino does
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
13/28
9
Smart phone boxes engross and isolate us with their power to capture our
attention. This may lead to negative social and physical consequences. Ambient(based on surroundings) and tangible (touchable) interfaces can solve many of
these problemsthey can leverage a wide range of our existing physical skills
and can convey information without demanding all of our visual and cognitive
attention. Amarino is the cheapest solution for this problem.
But, while tangibles have many advantages, they arent as common as
traditional GUI systems in part because they are difficult to design and construct.
Ambient interfaces to smart phones are especially rare, perhaps because they are
particularly challenging to build.
1.2.1 Goal of Amarino:
Amarino aims to facilitate the development of tangible interfaces to smart
phones by eliminating several of the developments steps that are required to build
them.
In particular, Amarino allows Android-based mobile phones to communicate
seamlessly with Arduino-based microcontrollers. It also allows tangible
developers who would like to employ phone-based sensing in their projects to do
so without engaging in any mobile device programming.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
14/28
10
1.2.2 Present Research in Arduino:
1. WeWrite
WeWrite which employs mobile phones and the LilyPad Arduino [enables
users to send text messages or some visual information to a T- shirt that then
displays them on a built-in LED display. Presently IDC is working on this kind of
project.
Man working with LilyPad
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
15/28
11
2. United-Pulse
Another wearable-based project, called united-pulse, uses electronic rings, heart
rate monitors and smart phones to communicate heart rate across distance. The
rings communicate with the phone and monitors to enable two people to feel each
others pulses remotely. Currently MobileHCL is working on this project.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
16/28
12
1.2.3 AMARINO - Android Interface
Each of the four quadrants shown in the figure corresponds to one of Amarino's
core functionalities.
The Bluetooth Manager is used to connect the wireless Bluetooth
module (Bluesmirf Gold) with our android phones Bluetooth. For security purpose
we can also set authentication password to establish a safe connection and then
pair the devices together.
The Monitoring part keeps a record or log of all the recent activities that have
been performed in the Amarino.
The Event Manager contains a set ofpre-defined events that can be used for our
project. This simplifies our work as we need not waste time in coding separately
for these events.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
17/28
13
In the Settings tab, we can change the name of the new event and assign a new
Bluetooth address to it for the BlueSmirf to communicate with our phone.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
18/28
14
CHAPTER-3
1 Multi Coloured Lamp using Arduino and Amarino:In this part of the paper we will explain in detail, the complete installation
of Amarino and Arduino IDE and coupling them to an Android mobile to
wirelessly control a Multi Coloured lamp using a Bluetooth device.
To start the project we need the following things (Both Hardware and
Software)
Android Smart Phone. Windows 7 Operating system. Arduino Duemilanova ATmega 328 Eclipse IDE for Java EE Developers Android sdk Amarino Toolkit Bluetooth ModemBluesmirf Gold Three LEDs- Colours: RED, BLUE and GREEN.
1.1 Installation
Before starting the project make sure that you have installed the followingsoftwares in your mobile or P.C
a. AmarinoAndroid Application- to be installed on phone.
b. Amarino Plug-in Bundle- to be installed on phone.
C. Amarino Library- To be kept in computer- needed while installing theapplication on phone using Eclipse.
Download the MeetAndroid Library and place it into the libraries FolderArduino.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
19/28
15
After placing the folder into the libraries folder, you should be able toaccess all the Amarino files through the Arduino programming environment asshown in the figure.
1.2 Setting up Bluesmirf gold adapter
Connect the BlueSmirf gold Bluetooth adapter with the Arduino in the followingway:
CST1 to RTS0
VCC3.3V
GNDGND
TXRX (digital pin 0 of Arduino)
RXTX (digital pin 1 of Arduino)
Now, we must set the baud rate of the Bluetooth module to 57600 (else it wontwork properly). Baud rate is the rate at which the device determines the speed,
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
20/28
16
code transfer level of the incoming data. It allows accepting data from a variety ofdevices operating at different speeds.
To change this, first you must add the BlueSmirf as a device from ControlPanel>Hardware and Sound>Add a Device. Then enter the device paring code forsecurity purposes. Then go to Bluetooth settings and change the baud rate.
1.3 CONFIGURING ECLIPSE:
Eclipse is a multi-language software development environmentcomprising an integrated development environment (IDE) and an extensible plug-
in system. It is written mostly in Java and can be used to develop applications in
Java and, by means of various plug-INS, other programming languages. You need
to install Android Development Tool (ADT) for Eclipse.
Android Development Tools (ADT) is a plug-in for the Eclipse IDE that isdesigned to give you a powerful, integrated environment in which to buildAndroid applications.ADT extends the capabilities of Eclipse to let you quickly
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
21/28
17
set up new Android projects, create an application UI, add components based onthe Android Framework API, debug your applications using the Android SDK
tools, and even export signed (or unsigned) .apk files in order to distribute your
application. Here are the steps to configure eclipse with Android developmentTool
1. Start eclipse, then select Help > Install New Software
2. ClickAdd, in the top-right corner.
3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name
and the following URL for theLocation:
https://dl-ssl.google.com/android/eclipse/
4. Click OK, and select the Developers Tool and click NEXT and accept thelicence agreement.
5. Click Finish and restart eclipse.
Download the Multi Coloured Lamp Tutorial available in Amarino website
which provides the necessary templates for interaction with the board and theArduino IDE and our android mobile. This package saves lot of time because weneed not program individual components in HDL to interact with the board.
1.4 Developing our App in Eclipse:
Go to Eclipse and right click your project panel, and select new android
project. At the bottom panel select the required android version as per your phones
specification.
Select create from existing source. Use the browse button to find your Multicolor Lamp folder that you just
downloaded.
Select android 2.1 OR any other versions as the targeted device from the list. Itdepends upon the phone you use.
Click Finish.
https://dl-ssl.google.com/android/eclipse/https://dl-ssl.google.com/android/eclipse/https://dl-ssl.google.com/android/eclipse/8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
22/28
18
Ignore any yellow warnings you get. If you are not successful and you get a Red
Coloured critical warning then you may have to download
AmarinoLibrary_v0_55.jar.
To include the file, right click on your Multicolor Lamp folder and click build
path > configure build path > libraries > add external jar > and browse for the
AmarinoLibrary_v0_55.jar file. > Ok.
Open the MultiColorLamp.java file in Eclipse and place your BlueSmirf
device number inside this line of code (private static final String
DEVICE_ADDRESS = YOUR BLUE TOOTH DEVICE NUMBER;)
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
23/28
19
Changing AndroidManifest.xml file. Go to Application and set Debug gable as
True.
1.5 Phone Side Installation:
Your phone should already be connected via usb to your computer, inyour phone settings, developer debug mode, and install from unknown sourceschecked. In my phone, it was in settings>applications>USB debugging.
Next, right click on your Multicolor Lamp folder and > Run as Android Application.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
24/28
20
When the dialog box of the AVD manager launches select your phone as the
targeted device. It will be the one that does not say emulator and probably have some
device number to it. Launch This will install the Multicolor Lamp app to your phone
and run it.
If your application is not installed on phone, then there is a possibility
that your phones device driver is not installed on computer. Go to Device
manager and install the driver for your phone. If you have internet
connection, it searches itself for the driver.
1.6 Arduino Side
You can get Arduino code file on one of the folders of MultiColorLamp. Set thebaud rate to 57600 and write it to your chip.
While uploading the sketch to Arduino, remove the RX and TX connections ofBluetooth module.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
25/28
21
The Arduino set up is very easy. You just need to connect 3 LEDs across DIG 9- GND,
DIG 10- GND and DIG 11-GND
1.7 Future Work:
Arduino board can also be made to act as a sensor by doing the reverse of
our project. So this increases the scope of using Arduino in various fields. It is
also capable of recognizing human voices and responds according to it (e.g. LED
can be made to glow when a person says Light). Some of our concepts are
1) To develop a light sensor by using Arduino board that can be implemented in
cricket stadiums. The sensors can sense the amount of light in the stadium and
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
26/28
22
send report to the Umpires mobile to switch on the focus light when needed and
to abandon the match if the light goes beyond the threshold level.
2) To develop a temperature sensor using Arduino and Android which is capable
of sending SMS to the owners mobile phone or activate the mobiles vibration
motor when the temperature increases beyond a limit. This can be used as a
temperature sensor in industries. It can be placed near hazardous machines and
can be coupled to a GSM that can send an emergency SMS to the concerned
person during some fire accident.
3) Arduino can be implemented in burglar alarm system. It can be connected to an
invisible laser source with external power. When some burglar enters the store
illegally, the laser is disturbed and the Arduino can be programmed to report this
to police or to the owner of the store.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
27/28
23
CHAPTER 4
CONCLUSION:
Open source electronics and Android are some of the notable field in
recent developments. There are still many unexplored areas in these fields. These
fields provide a very good platform for those who want to make something more
than a smart phone and control almost everything using their mobiles.
8/2/2019 Application for Disabled to Control a Multi Coloured Lamp Using Arduino and Android
28/28
Works Cited:
[1] The complete online reference for the Arduino
http://www.arduino.cc/en/Main/hardware
[2] Developers online guide for Application Programming Interface (API) of
Amarinohttp://www.amarinotoolkit.net/index.php/amarino-api.html
[3] IDE programming documentation.http://www.processing.org/reference/
[4] Online Android Developers forum http://developer.android.com/sdk/eclipse-
adt.html#installing
[5]Michael McRoberts,"Arduino" in Beginning Arduino,MichelleLowman,Eds.,New York : Apress, 2010 .
[6] Simon Monk, "Arduino" in 30 Arduino Projects for Evil Genius, New York
:The McGraw-Hill Companies,2010 .
http://www.arduino.cc/en/Main/hardwarehttp://www.arduino.cc/en/Main/hardwarehttp://www.amarinotoolkit.net/index.php/amarino-api.htmlhttp://www.amarinotoolkit.net/index.php/amarino-api.htmlhttp://www.amarinotoolkit.net/index.php/amarino-api.htmlhttp://www.processing.org/reference/http://www.processing.org/reference/http://www.processing.org/reference/http://developer.android.com/sdk/eclipse-adt.html#installinghttp://developer.android.com/sdk/eclipse-adt.html#installinghttp://developer.android.com/sdk/eclipse-adt.html#installinghttp://developer.android.com/sdk/eclipse-adt.html#installinghttp://developer.android.com/sdk/eclipse-adt.html#installinghttp://www.processing.org/reference/http://www.amarinotoolkit.net/index.php/amarino-api.htmlhttp://www.arduino.cc/en/Main/hardware