You are here

How to Make an iOS App to Control a Robot Using Bluetooth Low Energy (BLE) | Cypress Semiconductor

How to Make an iOS App to Control a Robot Using Bluetooth Low Energy (BLE)

Learn how to make an iOS App using Xcode and Swift to control a robot using Bluetooth Low Energy (BLE) by watching our PSoC 4 BLE iOS App video series.

In this video training series you will learn how to connect and control an embedded system using an iPhone App with Bluetooth Smart.  The videos provide step-by-step instructions on how to create ARM® Cortex®-M0  PSoC 4 BLE-based embedded system design projects and the iOS App project using Xcode and Swift.

This video series is designed for iOS App developers who want to learn how to control hardware devices using Bluetooth Smart and embedded systems developers who want to learn how to make their first iOS App to control their hardware or IoT device.  The completed iOS App and Bluetooth Low Energy projects are available for download.

Video Length: 
02:46

This lesson introduces the course objectives and explains the hardware and software required to write and test an iOS App to communicate with an ARM Cortex-M0 PSoC 4 BLE. project.

Transcripts: 
Video Length: 
04:41

This lesson shows you how to create a PSoC Creator project, draw the schematic, and configure the CapSense component. The iOS app created in later lessons will communicate with this project to remotely turn an LED on/off and to read the finger position on the CapSense slider.

Transcripts: 
Video Length: 
10:30

This lesson goes through the steps to configure the BLE component for a custom LED and CapSense service.

Transcripts: 
Video Length: 
14:05

This lesson discusses the firmware required for the PSoC Creator project.

Transcripts: 
Video Length: 
08:02

This lesson demonstrates how to test and debug the firmware using the PC and iOS versions of CySmart. The CySmart program allows you to discover services and characteristics, and allows you to read/write characteristic values.

Transcripts: 
Video Length: 
06:21

This lesson introduces the iOS app used to control the PSoC Creator BLE project that was created in the prior lessons. The overall architectural model is discussed and the app is demonstrated.

Transcripts: 
Video Length: 
21:36

This lesson provides a detailed step by step walk through of the code behind the app that was introduced in the prior lesson.

Transcripts: 
Video Length: 
03:08

This lesson introduces the BLE robot hardware and demonstrates what the completed app looks like.

Transcripts: 
Video Length: 
14:55

This lesson covers the PSoC Creator project for the BLE robot. It discusses the details of the schematic, pin selection, and firmware.

Transcripts: 
Video Length: 
08:42

This lesson walks through the iOS app used to control the robot.

Transcripts: 

NOTES:

The projects in the videos were made using PSoC Creator 3.2 but the attached projects have been updated to PSoC Creator 3.3 CP1. If you use PSoC Creator 3.3 or later, you will notice some differences in screens such as the “new project creation window.” That said, the projects will still work in the same way.

The projects in the videos were made using Xcode 6 and Swift 1 but the attached projects have been updated to Xcode 7 and Swift 2.

The car videos show a 6 battery holder while the BOM lists a 4 battery holder. Either will work fine except that the motors will run slower with 4 batteries.

The standoff shown in the videos has been replaced on the BOM with a ball caster due to availability.

The connection order for the cable attached to the bottom row of the H bridge header is reversed when connected to the PSoC. That is, the pin connected to the right side of the H bridge header bottom row goes to the left side of the PSoC header.

The following power/ground connections are required for the car: Ground from the battery holder must connect to the PSoC (there is a hole on the board next to the USB connector labeled GND) and to the GND terminal on J4 of the H bridge. Power from the battery holder must connect to one terminal of the toggle switch. The other terminal of the toggle switch must connect to the PSoC Vin (there is a hole on the board next to the USB connector labeled VIN) and to the V1 terminal on J4 of the H bridge.

For more information on Cypress’s PSoC BLE Products, visit:

http://www.cypress.com/products/bluetooth-low-energy-ble

For an introductory Cypress PSoC BLE video tutorial series visit:

http://www.cypress.com/psoc4ble101

For more information on iOS application development visit:

http://www.apple.com/developer

https://itunes.apple.com/us/course/developing-ios-8-apps-swift/id961180099

http://web.stanford.edu/class/cs193p/cgi-bin/drupal/

CY8CKIT-042BLE Projects

psoc-4-ble_pioneer_kit

The Bluetooth® Low Energy Pioneer Kit enables customers to evaluate and develop Bluetooth Low Energy applications using the PSoC® 4 BLE and PRoC™ BLE devices.

Red LED P2.6
Blue LED P3.7
CapSense sensors

P2.1/P2.2/P2.3/
P2.4/P2.5

CapSense CMod P4.0
Control P2.7
DIRLEFT P3.1
DIRRIGHT P1.5
GNDLEFT P3.4
GNDRIGHT P1.3
M1 P3.0
M2 P1.4
POWERLEFT P3.5
POWERRIGHT P1.2
qd1a P3.2
qd1b P3.3
qd2a P1.6
qd2b P2.6

 

Robot BOM:

To add the parts for the robot to a DigiKey shopping cart, click one of the buttons below:

Robot Parts
including CY8CKIT-042-BLE

Robot Parts
excluding CY8CKIT-042-BLE