Exercise: Wireless with the RedBear BLE
Objective
Communicate between the Arduino and the RedBear BLE board, and communicate to a mobile device using bluetooth.
Through additional mobile development, one would hope to be able to use a phone as a sensor platform, providing an arduino access to the sensors (gyroscopic, compass, ambient light, microphone, etc) that mobile phones all have.
Bluetooth is a technology for wireless communication between devices. BLE stands for Bluetooth Low Energy (sometimes branded as Bluetooth Smart), a network technology designed to improve on bluetooth 'classic' in a variety of ways, including significantly lower engergy use. This has enabled Bluetooth technology to be used in passive devices, such as a fitness tracker.
We will use the RedBear BLE mini board, and a mobile app that RedBear has developed for testing purposes.
Steps and observations
- Install RedBear's RBL Library. Read about installing Arduino Libraries here and the latest RedBear library can be downloaded here.
- With a breadboard, connect the RedBear BLE Mini to the arduino.
- VIN -> 5v
- GND -> GND
- TX -> Default RX (pin 0)
- RX -> Default TX (pin 1)
The green LED on the BLE mini should light up. Take note that RX on arduino goes to TX on the module. TX is transmit, and RX is recieve.
- Install the BLE Controller app from RedBearLabs for your mobile device. Android link. iOS Link. Turn on Bluetooth for your mobile device.
- Upload the BLEController sketch from File > Examples > RBL_BLEMini. You may need to install another Arduino IDE library, available here.
- Open the BLE Controller app and select 'BLE Controller' from the side menu. Scan for the BLE mini from the app (not from the bluetooth settings), and select your BLE Mini device.
- Pin 13 is connected to an LED on the Arduino UNO. With the app, set Pin 13 to an output. Try turning on and off the LED from your phone.
- Wire a Potentiometer up to an Anologue input on the Ardiono. Connect the outer pins of the potentiometer to 5V and Ground. Use the same breadboard nodes as the bluetooth connector. Connect the middle pin to the A5 input. A5 is also pin 19. (A0 is also pin 14). With the app, select Analog for pin 19. Watch the value change as you rotate the potentiometer.
Comments
One can get the arduino to access the campus wifi by registering the device here: https://netreg.net.cmu.edu/. I wil update this with further instructions once I figure out how to get the ESP2688 to spit out it's MAC address. One could find it through a variety of external means (router login pages, rooted android phones as hotspots), but ideally we can just ask the device to tell us.
Other Files
- RBL Library v.2.0.1 as a ZIP
- Direct Download of RedBear Library from redbearlab.com