Skip to content

16. Interface and application programming

Assignment and learning outcomes.

What is this week assignment?

Leraning outcomes

Interpret and implement design and programming protocols to create a Graphic User Interface (GUI).

Individual assignment

what is an interface

A point where two systems, subjects, organizations, etc. meet and interact is called interface.to elaburate,An interface device (IDF) is a hardware component or system of components that allows a human being to interact with a computer, a telephone system, or other electronic information system.

what i did

For this assignment I am reused in my input week assignment (ultrasonic sensor),in that week i amused a LED ,if any obstacle will be came in our setting area,infront of the sensor. This time i decided to mesure the distance between the ultrasonic sensor and obstacle.moreover,i developed a appliction for the displaying purpose.

what i am use in interface part

For the interfacing purpouse i am used bluetooth module(HC-O5).the HC-05 is 3Mbps Modulation with complete 2.4GHz radio transceiver and my indroid phone

schematic design and PCB design of my board

After desinging I generated SVG file which I converted to PNG through Gimp.

Printing the Board

I first setted the origin cordinates for my board and used the RML file .I generated to print and cut my circuit. After printing the board I soldered all the component on the board.

the device of my board are:

1. HC-SO4 sensor
2. bluetooth sensor
3. android phone
  1. connection of HC-SO4 and blutooth on my boad

Introduction

For this assignment, I decide to make an android app using MIT App Inventor to connect to my board via Bluetooth(HC-05) for sensing distance of an object.

To start project go to MIT App Inventor site, register using my Gmail account. To start a new project click on the Projects menu on the top left of the screen and select the “Start a new project” and then give the name of your project.

Designer Panel:

Select the ListPicker component from user interface. ListPicker is the button, which displays the list of available Bluetooth devices and handles the selection. You can change the text display on the listpicker to properties panel. You can also change the height, width, color using the same panel.After this, click and hold on the word “Button” in the palette, drag your mouse over to the Viewer and drop the button over the horizontal view, and give name disconnect. Add a label text (optional), as status about Bluetooth connection.Add two buttons, to make sensor ON and OFF. Also, add Bluetooth client component to establish Bluetooth connection.Add a text box to receive data from the connected device. The reception of data is implemented using a timer. Per second, the client checks to see if the data is available. If it is then it reads and displays the data. So, for this add Clock sensor component which is also a hidden component. for the project file import

I have to connect Android phone with MIT inventor app

Block Editor

The Blocks Editor is where you program the behavior of your app. There are Built-in blocks that handle things like math, logic, and text with each component you have added.Click on the list picker and select ListPicker Before Picking and set the elements of the list as available Bluetooth devices.Again click on list picker and select ListPicker After Picking to the established connection between selected device and application.And by clicking on the disconnect button, add the following blocks to disconnect the connection.Add blocks bluetooth sensor on and hc-s04 ON buttons.You can change these .You can apply a condition that the function will occur only when the Bluetooth is connected and to make ultrasonice sensor on and off using a single button.Add code to receive data from connected device.

After importing my project file

From Youtube


Last update: June 9, 2022