Bluetooth Based IOT through Arduino

Similar documents
Lesson 3: Arduino. Goals

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Share My Design Space Project to Facebook or Pinterest?

InfoSphere goes Android Angry Blob

Lab 2: Blinkie Lab. Objectives. Materials. Theory

FABO ACADEMY X ELECTRONIC DESIGN

BEGINNER APP INVENTOR

Managing images with NewZapp

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

Series and Parallel Circuits

1Getting Started SIK BINDER //3

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

METRO TILES (SHAREPOINT ADD-IN)

EE 210 Lab Exercise #3 Introduction to PSPICE

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

AI BOX 1. ASSEMBLY. A1 : Desk frame B1 : 2 holes for installing 2 M5x16 screws

expertmeter High Performance Analyzer PM180 Fault Locator Application Note BB0165 Rev. A2

Series SPPM2 Graphical User Interface Panel Meter. Specifications - Installation and Operating Instructions MINI USB PORT

Workshop 9: First steps in electronics

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Digital Projection Entry Instructions

far- Play Developers Manual

Instructions for using The George Institute s Data Collection App Version 1.2

uiulearn TUTORIAL INTEGRATIONS> HOW TO USE PANOPTO (STUDENT)

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

Welcome to Weebly. Setting up Your Website. Write your username here:

THE INPUTS ON THE ARDUINO READ VOLTAGE. ALL INPUTS NEED TO BE THOUGHT OF IN TERMS OF VOLTAGE DIFFERENTIALS.

Welcome to Progress Lighting s Virtual Lighting CD

1. (2 point deduction for failure to complete this problem!)

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Consultation PTM (Parent s Guide) Consultation Mobile Apps (Parent s guide) Empower People. One Solution

IME-100 ECE. Lab 1. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

GetTutorialized Workshops Brochure-2017

TWEAK THE ARDUINO LOGO

Reviewing Your Tax Return In Your Portal

Workshops Elisava Introduction to programming and electronics (Scratch & Arduino)

Connecting Mains Electrical Power

JAM 2015 Screenshots of filling Online Application Form

KODAK DIGITAL ROC Professional Plug-In 2.1

RC Circuit Activity. Retrieve a power cord and a voltage sensor from the wire rack hanging on the wall in the lab room.

TABLE OF CONTENTS. Logging into the Website Homepage and Tab Navigation Setting up Users on the Website Help and Support...

Introduction to Turtle Art

Series and Parallel Circuits

Overview... 3 Starting the Software... 3 Adding Your Profile... 3 Updating your Profile... 4

2. Creating and using tiles in Cyberboard

Lab 2.4 Arduinos, Resistors, and Circuits

Ansoft Designer Tutorial ECE 584 October, 2004

Instructions for the W0NE Remote HF Rig, IC-7300

Create a CaFE Account (for those who do not have one) In order to submit entries for the FWS Annual Exhibition and/or the Online Show, you need to:

RPG CREATOR QUICKSTART

Let There Be Light. Opening Files. Deleting National Technology and Science Press

INA169 Breakout Board Hookup Guide

2D Floor-Mapping Car

Engineering 3821 Fall Pspice TUTORIAL 1. Prepared by: J. Tobin (Class of 2005) B. Jeyasurya E. Gill

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Aimetis Outdoor Object Tracker. 2.0 User Guide

Two Hour Robot. Lets build a Robot.

Create a CaFE Account (for those who do not have one) In order to submit entries for the FWS Annual Exhibition and/or the Online Show, you need to:

App Inventor meets NXT

NCSS Statistical Software

Advanced Computer Systems Fall CC1350 BLE Multimeter

Operation Manual [Version 3.09]

WHITE PAPER DOCUSIGN INTEGRATION

EC-3: Capacitors and RC-Decay

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

Program - Project Management

OHM S LAW. Ohm s Law The relationship between potential difference (V) across a resistor of resistance (R) and the current (I) passing through it is

Geometer s Sketchpad Version 4

SGD 70-A 7 PanelPilotACE Compatible Display

How to do Geo-fencing with the FM200

OzE Field Modules. OzE School. Quick reference pages OzE Main Opening Screen OzE Process Data OzE Order Entry OzE Preview School Promotion Checklist

DocuSign Workflow for Springer Licensing Contracts. Customer Manual

1. Setup Output mode. 2. Using a Fixed tile size

On the front of the board there are a number of components that are pretty visible right off the bat!

Understanding the Arduino to LabVIEW Interface

Practical Assignment 1: Arduino interface with Simulink

LT Spice Getting Started Very Quickly. First Get the Latest Software!

EPSON GT Scanner Parts. Scanner Specifications. Maximum document size

Getting Started in Eagle Professional Schematic Software. Tyler Borysiak Team 9 Manager

SGD 70-A 7 PanelPilotACE Compatible Display

Using the Desktop Recorder

Milli Developer Kit Reference Application Published on Silver Spring Networks STAGE (

EECS 312: Digital Integrated Circuits Lab Project 1 Introduction to Schematic Capture and Analog Circuit Simulation

What You ll Build. What You ll Learn. CHAPTER 5 Ladybug Chase

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

EM Arduino 4-20mA Shield Documentation. Version 1.5.0

Photoshop Backgrounds: Turn Any Photo Into A Background

Arduino Lesson 1. Blink. Created by Simon Monk

QUICKSTART

Rodni What will yours be?

MiR Robot Interface 2.0

Part 1. Using LabVIEW to Measure Current

Google Photos Online Basics

This guide provides information on installing, signing, and sending documents for signature with

Servomotor Control with Arduino Integrated Development Environment. Application Notes. Bingyang Wu Mar 27, Introduction

GIMP WEB 2.0 ICONS. Web 2.0 Icons: Paperclip Completed Project

Hyperion System 9 Financial Data Quality Management. Quick Reference Guide

[DOING AN ODA: STEP-BY-STEP INSTRUCTIONS]

Transcription:

1 Bluetooth Based IOT through Arduino G V V Sharma Fig. 1: Breadboard 1 Measuring the resistance Problem 1. Connect the 5V pin of the Arduino to an extreme pin of the Breadboard shown in Fig. 1. Let this pin be V cc. Problem 2. Connect the GND pin of the Arduino to the opposite extreme pin of the Breadboard. Problem 3. Let R 1 be the known resistor and R 2 be the unknown resistor. Connect R 1 and R 2 in series such that R 1 is connected to GND and R 2 is connected to V cc. Refer to Fig. 3 Problem 4. Connect the junction between the two resistors to the A0 pin on the Arduino. Problem 5. Connect the arduino to the computer so that it is powered. Problem 6. Open the Arduino IDE and type the following code. Open the serial monitor to view the output. // D e c l a r a t i o n s i n t V out q=0; // V out q i s t h e q u a n t i z e d v o l t a g e f l o a t V in = 5, V out ; // V in = V cc f l o a t R1=220,R2 ; // R1 i s known r e s i s t a n c e // R2 i s unknown r e s i s t a n c e *The author is with the Department of Electrical Engineering, Indian Institute of Technology, Hyderabad 502285 India e-mail: gadepall@iith.ac.in. Fig. 3: Voltage Divider void s e t u p ( ) { // Get t h e r e s u l t onto t h e s e r i a l m o n i t o r S e r i a l. b e g i n ( 9 6 0 0 ) ; } void loop ( ) { //V 0ut q i s an i n t e g e r between 0 t o 1023 V out q=analogread ( 0 ) ;// r e a d i n g from A0 // V out i s t h e a c t u a l v o l t a g e a t t h e j u n c t i o n o f R1 and R2 V out = V in V out q/1024; R2 = R1 ((V in )/ ( V out ) 1.0) ; d e l a y ( 3 0 0 0 ) ; S e r i a l. p r i n t l n ( R2 ) ; }

2 2 Development of Android Application to Display the Measured Resistance via Bluetooth In the following, we make an android application using MIT App Inventor or Android studio (here we are using MIT App Inventor) to display the measured resistance. Problem 7. Click on link http://appinventor.mit.edu/ for using MIT App Inventor. Problem 8. Click on Create apps! tag to get started. Problem 9. Log in to App Inventor with a gmail user name and password. Problem 10. Start a new project. Type in the project name (underscores are allowed, spaces are not) and click OK Problem 11. You are now in the Designer editor, where you lay out the user interface of your app layout effective. Go to the properties of this HorizontalArrangement. Change the Height property to 10 percent and Width to Fill parent. You can change the properties according to your requirement Problem 13. Drag another HorizontalArrangement component onto the Viewer and change the Width property to Fill parent. From the User Interface component group, select and drag the ListPicker component onto the 2nd HorizontalArrangement on Viewer. The ListPicker component provide similar function as Button that function like menu options, where you can click on one of the selection to get to the specified option. Remove the text from the Text property of ListPicker and change the Align- Horizontal property of HorizontalArrangement to Center. Download a.png bluetooth icon from the net. Upload this image in the Image property of ListPicker for the symbol of bluetooth. After uploading, change the Width and Height property of the ListPicker to 70 pixels. You won t see any bluetooth icon now. Wait. Problem 12. Click on Layout in the palette section. Then, click and hold on HorizontalArrangement and drag your mouse over to the Viewer. Drop the HorizontalArrangement and a new HorizontalArrangement will appear on the Viewer. This HorizontalArrangement is just to leave some blank space before placing something else for making the Problem 14. Drag another HorizontalArrangement component onto the Viewer and change the Width property to Fill parent. From the User Interface component group, select and drag the Label component onto the 3rd HorizontalArrangement on Viewer. Change the Text property of Label to Not Connected. Change the AlignHorizontal property of HorizontalArrangement to Center.

3 Problem 15. Again drag a HorizontalArrangement component onto the Viewer. Change the Width property to Fill parent and Height to 8 percent. This 4th HorizontalArrangement is also to leave some blank space before placing something else. Problem 16. Drag 5th HorizontalArrangement component onto the Viewer.Change the Height property to 15 percent and Width to Fill parent. From the User Interface component group, select and drag the 2nd Label component onto the 5th HorizontalArrangement on Viewer. Change the AlignHorizontal and AlignVertical property of HorizontalArrangement to Center. Remove the text from the Text property of Label and change the Width property to Fill parent. Change the Text alignment property of Label to Center and Height to 5 percent. Problem 20. From the Screen1\ListPicker1 component group, select and add the when ListPicker1.BeforePicking and set ListPicker1.Elements components. From the Screen1\BluetooothClient1 component group, select and add the BluetoothClient1.AddressAndNames component to the Viewer section. Assemble the blocks to get the following image. Problem 17. From the Connectivity component group in the Palette section, select and drag the BluetoothClient component to the Viewer. Since the BluetoothClient component does not have user interface, it is a non-visible component and not shown on the Viewer. Problem 18. Next, from the Sensors component group in the Palette section, select and drag the Clock component onto the Viewer. The Clock component is a non-visible component and does not shows up on the app screen. This is the user interface layout of the app. Problem 19. Next, with all of the required layout components in place, click on the Blocks button to switch to the Block editor to add programming logic. The above group of components provide the function to retrieve the list Bluetooth devices paired with the Android device. Problem 21. Continue and add the when ListPicker1.AfterPicking component from the Screen1\ListPicker1 component group to the Viewer section. The ListPicker1.AfterPicking component is an event handler after an item is selected. From the Built-in \Control group, select and add the If then component, a conditional handler, to the Viewer section. Next, select and add the call BluetoothClient1.Connect address (from the Screen1\BluetooothClient1 component group). and ListPicker1.Selection (from the Screen1\ListPicker1 component group) components and link to the if condition. Again, from the Built-in\Control group, select and add the If then component and link to the then condition. To extend the block with as many else and else if branches click the blue icon. Do this to get the

4 following image. Problem 22. Next, select and add the BluetoothClient1.IsConnected (from the Screen1\BluetooothClient1 component group) and link to the second if condition. Select set Label1.Text (from the Screen1\Label1 component group) components and link to the then condition and from the Built-in\Text, click on the blank text entry component and enter the word Connected. Select set Label1.TextColor (from the Screen1\Label1 component group) components and link just below the Label1.Text and from the Built-in\Colors, click on the green color. Problem 23. Again, select set Label1.Text (from the Screen1\Label1 component group) components and link to the else condition and from the Builtin\Text, click on the blank text entry component and enter the word Not Connected. Select set Label1.TextColor (from the Screen1\Label1 component group) components and link just below the set Label1.Text and from the Built-in \Colors, click on the red color. Make sure that you get the following image. Problem 24. Continue and add the when Clock1.Timer component from the Screen1\Clock1 component group to the Viewer section. From the Built-in \Control group, select and add the If then component. Next, select and add the BluetoothClient1.IsConnected (from the Screen1\BluetooothClient1 component group) and link to the if condition and select set Label2.Text (from the Screen1\Label2 component group) component and link to the then condition. Select and add the call BluetoothClient1.ReceiveTextnumberOfBytes and call BluetoothClient1.BytesAvailabelToReceive (from the Screen1\BluetooothClient1 component group) components. Link them to get the following image. The above group of function block provide the program logic to display the measured resistance value, via the BluetoothClient1 connection to the connected Bluetooth device. The group of components, highlighted within the red rectangular frame, is part of an event handler to change the status that either Bluetooth device is connected or not. Problem 25. At this point, we have all of the intended function for the app. Before testing the app, we need to establish connectivity to a device or an emulator. To use a real device, you need to install the MIT AI2 Companion app from the App Store. Install and launch the app on the target device. After the MIT AI2 Companion app is launched, you have the option to enter a six digit code or use the scan QR code option to connect to App Inventor

5 Problem 26. From the App Inventor s Connect menu, click on AI Companion to bring up the following screen and wait. Make sure that your computer and mobile device are connected to the same WiFi network. Problem 27. From the target device, you can enter the six digit code, or scan the QR code to establish connectivity to the App Inventor. Once connected, the app will display on the device, as shown below. Note that this does not install the app on your device.

6 app, as shown below Problem 30. After scanning the QR code using MIT AI2 Companion, the following screen is shown on the device, asking for permission to install the app Problem 28. From the App Inventor Build menu, click on App(provide QR code for.apk) to build the app. App Inventor shows the following progress as it builds the app Problem 29. After the build is done, a QR code is provided for the MIT AI2 Companion to install the Now install and launch the app on the device.

7 3 Displaying Measured Resistance on Android App via Bluetooth Power off the Arduino. Problem 31. Connect the TX pin of the Arduino to R 2. Problem 32. Connect the other end of R 2 to R 1 Problem 33. Connect the other end of R 1 to GND. Problem 34. Connect A0 to RX pin of the Bluetooth module. Problem 35. Connect TX of Bluetooth to RX of Arduino. Problem 36. Make the V c c and GND connections for the Bluetooth module. The final connection digram is available below. 3) V out represents the divided voltage that falls across the unknown resistor. 4) The Ohm meter in this manual works on the principle of the voltage divider shown in Fig. 3. R 1 V out = V in (37.1) R 1 ( + R 2 ) Vin R 2 = R 1 1 (37.2) V out In the above, V in = 5V, R 1 = 220Ω. Problem 37. Power up the Arduino and get the code in Section I running. Connect to the the bluetooth module and you should be able to see the resistance value on the app developed using the app inventor. 4 Explanation 1) We create a variable called analogpin and assign it to 0. This is because the voltage value we are going to read is connected to analogpin A0. 2) The 10-bit ADC can differentiate 1024 discrete voltage levels, 5 volt is applied to 2 resistors and the voltage sample is taken in between the resistors. The value which we get from analogpin can be between 0 and 1023. 0 would represent 0 volts falls across the unknown resistor. A value of 1023 would mean that practically all 5 volts falls across the unknown resistor.