Control LED Light Color Via an Arduino and an IPhone Over BLE

7,982

19

7

This tutorial will show you how to control an RGB LED via an Arduino and an iOS device. It will utilize the LightShow app which lets you set a single color or create a light show with a sequence of colors.

If you want to control a Light Strip check out this tutorial instead.

Materials:

  • RGB LED
  • 3 x 220-ohm resistors
  • nRF8001 BLE board
  • Arduino Uno
  • iOS device

Supplies:

Step 1: Attach the RGB LED

Use a common cathode RGB LED and three 220-ohm resistors.

  • The longest pin of the LED is the cathode and should be connected to the common ground.
  • Connect a 220-ohm resistor between each of the LED's anodes and the Arduino.
  • Connect the Red, Green, and Blue pins to digital pins 3,5, and 6 respectively.

Step 2: Connect the Bluetooth Low Energy Board

Connect the nRF8001 Bluetooth LE breakout board to your breadboard. Connect the BLE pins to the Arduino as follows:

  • SCK - 13
  • MISO - 12
  • MOSI - 11
  • REQ - 10
  • RST - 9
  • RDY - 2

Further information on the using the nRF8001 BLE board is available here.

Step 3: Upload the Sketch to the Arduino

Clone or download the LightShow GitHub repository at https://github.com/kitefaster/LightShow.

  1. Copy and paste the Adafruit_BLE_UART folder located in the libraries directory into your Arduino/libraries/ folder.
  2. Launch the Arduino IDE and open the LightShow/LightShowArduino/LightShowArduino.ino sketch. Upload it to your Arduino board.

Step 4: Download and Install the LightShow App

Download and install the iOS LightShow app from the iTunes App Store.

Launch the app and press the Action button on the top right. Locate your bluetooth device, named "HSLight" by default, and connect to it. Go back one screen and you should be able to remotely control the color of your LED.

Share

    Recommendations

    • Woodworking Contest

      Woodworking Contest
    • Arduino Contest 2019

      Arduino Contest 2019
    • Gardening Contest

      Gardening Contest

    7 Discussions

    0
    None
    tony1812

    6 months ago

    The article is helpful to some degrees, but when it comes to download the app. iTune says it is not available in the US store. Why can't you upload the app codes to Github?

    0
    None
    Sembot

    2 years ago

    Hai,

    I use a common anode RGB LED , Is that possible , what should I change in the Arduino code please

    Kind regards

    0
    None
    ShivaganeshguptaS

    2 years ago

    Did you write something from scratch for the iOS or did you use a toolkit like that above? and is it work for HM-10 Blue tooth

    my mail id is gupta.sunkari@gmail.com

    0
    None
    filmote

    3 years ago

    Interesting - however not having the source code to the iOS app detracts from the project. How can I use the techniques you show to do something else?

    3 replies
    0
    None
    filmotekitefaster

    Reply 3 years ago

    Thanks for the reply. Did you write something from scratch for the iOS or did you use a toolkit like that above?

    0
    None
    kitefasterfilmote

    Reply 3 years ago

    I started by using the Nordic code base, getting that to work, then building my custom UI on top of it. In the end I only ended up keeping the UARTPeripheral class.