User:Makerportal/sandbox

BLExAR is an integrated app that uses Bluetooth Low Energy to convert your Arduino Uno board into an iOS-compatible device. BLExAR allows the iOS user to control all digital and analog pins on an ATmega328 Arduino-based board using just a CC2541 (HM-10) Bluetooth board.

Some features include: Real-time control of all Arduino pins, data plotting in real-time, and raw communication using a terminal window.

The BLExAR app is intended for makers, students, and engineers interested in controlling their Arduino app whether for hobby or professional purposes. The app allows the user to interact with their Arduino board, but also receive data from sensors and so much more!

Bluetooth Peripheral Scan
Below are the minimal components needed to communicate and send strings between Arduino and an iOS device.
 * 1) Arduino Uno board
 * 2) HM-10 Bluetooth module
 * 3) iOS Device (iPhone or iPad)

In order for the Arduino board to cleanly communicate with the HM-10 Bluetooth module, we must upload the “Bare Minimum” sketch to ensure that the serial pins are not being used. The images below show the “Bare Minimum” sketch, which should be located under “File -> Examples” in the Arduino IDE.

After uploading the bare minimum sketch, follow the methods below for testing and wiring the HM-10 Bluetooth module.

The communication is conducted using the BLExAR iOS app and its Console window, which allows communication via UTF-8 String encoding.

Arduino Control
In this tutorial, I introduced the idea of RGB LEDs and how to control them using an iOS device and the BLExAR app. RGB LEDs are 4-pin LEDs that can produce over 16.7 million different colors by varying the voltage sent to each of its three individual color pins (red, green, blue). The BLExAR app allows the iOS user to send a series of commands to a Bluetooth-enabled Arduino board that allows the user to control its pins via digital on and off values and even pulse width modulation (PWM) values.

The PWM methods afforded by the BLExAR app demonstrate the effects of fading an LED and how, through changing the effective voltage sent to an LED, we can create a 24-bit color LED. This type of 24-bit color combination is the basis for most liquid crystal displays (LCD) that are used in modern displays like computer screens, TVs, and smartphones.

Data Acquisition
Once the BLExAR device is selected and the iOS device has connected with the peripheral, the tab bar window will appear with an image of an Arduino Uno board. For this tutorial, we will select the “Data” tab on the bottom of the screen. Data should already be arriving in real-time once the Data window is selected. You should start seeing a plot similar to that in Figure 5.

From here, there are multiple options. The user can elect to “Start Acquisition” which will collect data as it comes in. Then, when the user wants to stop acquiring the data, select “Stop Acquiring” and a window will appear with instructions to email the data to an email address. This allows the user to access the data with a timestamp in a .csv format from an email address of their choosing.