Week 16
Interface and Application Programming
In this week, the task is to make an application that interfaces with an input and/or output device that i made.
I decided to make the application which interfaces with the input device which i made on input week.
As i designed and got the output for this device in the input week,So I need to make the application in MIT app inventor and then i have to interface my board with the application,thereby controlling my device with the application using the bluetooth.
In my board i used an IR transmitter receiver module available in Kuwait FabLab.
Items required for interfacing:
1- Board which is needed to interface.
2-Mobile application created in MIT App inventor.
3-Android Mobile phone.
4-Bluetooth module.
Bluetooth:
This wireless technology enables communication between Bluetooth-compatible devices. It is used for short-range connections between desktop and laptop computers, PDAs (like the Palm Pilot or Handspring Visor), digital cameras, scanners, cellular phones, and printers.
Bluetooth Technology is based on radio waves, there can be objects or even walls placed between the communicating devices and the connection won't be disrupted. Also, Bluetooth uses a standard 2.4 GHz frequency so that all Bluetooth-enabled devices will be compatible with each other.
I used HC-06 bluetooth module for interfacing.
The main Pins which we have to connect to our board are
1-VCC(is indicated in the range of 3.6V6V. The module worked for me both with 3.3V
and 5V)
2-GND-(This pin needed to connect to the GND of serial pin in the board)
3-TXD-(serial output of the module, to be connected to RX of the microcontroller. Note
that this signal is using 3.3V logic level)
4-RXD-(serial input of the module, to be connected to the TX of the microcontroller.
Note that this signal is using 3.3V logic levels)
The data sheet of HC-06 module is here: Datasheet
I connected the corresponding pins of VCC,GND,TXD,and RXD in the serial pin of board respectively.
Board
The board i used is shown below. You can read more about this board and its making procedures in input week here
Board
IR module
Creating the application in MIT app inventor for interfacing:
Since i am new in App inventor, I went through tutorials from MIT itself and other sources.
I opened the App inventor website and created new project
I named my project as test and there are many tools to create the application.There is design and blocks.
In the designer section i used label,Button,Bluetooth client and a clock.
So in block side i inserted required blocks using different logic and other blocks for picking the bluetooth. After picking the bluetooth,connecting the required module and finally transmission of data between the application and the module.
Connecting the Application with android device
After completing the blocks section, i have to connect my application with the Android phone. For that AI companion option in connect menu.Then we will get a QR code.
So after scanning the QR code i saw the design windows screen in the mobile and i clicked on the Bluetooth button .Available bluetooth devices are shown and then i choosed HC-06 module and connected.
Output
I connected the IR module to the board and i got the output and the value of IR sensor changes as i am trying to create obstacles.
I saved my application as apk file using save as apk option in build menu.
You can find the Video of my final output here :
File:
apk file is apk file.