#Week 16 / Interface and application programming

Assignment and learning outcomes.

What is this week assignment?

Group assignment-Write an application that interfaces a user with an input and/or output device that you made. Individual assignment-Compare as many tool options as possible.

Leraning outcomes

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

Individual assignment

Introduction

For this week assignment I decide to make an android app using MIT App Inventor to connect to my board via Bluetooth(HC-05) for receiving data about consuming the power of the board. To start project go to MIT App Inventor site, register using your 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 LED 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.

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.Now, add blocks for led on and led off buttons. Here, we are sending 1 to turn on led and 0 to turn off led according to code. You can change these.You can apply a condition that the function will occur only when the Bluetooth is connected and to make led on and off using a single button.Add code to receive data from connected device.

HC-05

HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm. Hope it will simplify your overall design/development cycle.

Hardware features

  • Typical -80dBm sensitivity
  • Up to +4dBm RF transmit power
  • Low Power 1.8V Operation ,1.8 to 3.6V I/O
  • PIO control
  • UART interface with programmable baud rate
  • With integrated antenna
  • With edge connector
  • Default Baud rate: 38400, Data bits:8, Stop bit:1,Parity:No parity, Data control: has. Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
  • Given a rising pulse in PIO0, device will be disconnected.
  • Status instruction port PIO1: low-disconnected, high-connected;
  • PIO10 and PIO11 can be connected to red and blue led separately. When master and slave are paired, red and blue led blinks 1time/2s in interval, while disconnected only blue led blinks 2times/s.
  • Auto-connect to the last device on power as default.
  • Permit pairing device to connect as default.
  • Permit pairing device to connect as default.
  • Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.
  • Conclusion

    For this week assingnment I decided to MIT App Inventor to make Adroid app for my smart phone to communicat with Master (reserve data about status of charging desk). As I used MIT App Inventor I was wondering how esay to make Adrouid app using App Inventor. I have successfully connect my phone to the HC-05(and reserved data every 1 secound).

    Files

  • Android app(.apk)"App file
  • Android app(.aia)"App file