Connect a multicolor LED strip to your smartphone to make a touch-controlled light show! You can attach the color-changing LEDs to the underside of a coffee table, your bike, or anything else you think needs a bit more color.

There are many ways to connect your smartphone to an embedded microcontroller. In this project you’ll use an Android phone in USB host mode. This way, the Android phone both powers and communicates with the Arduino! Even though the Arduino is connected via USB, the communication happens via serial, just like when an Arduino is connected to your computer.

Once you’re able to make your phone talk to an Arduino, a whole world of new projects opens up!


Download the code

CAUTION: Build this project at your own risk. We fried a phone during our test build. Not all Android phones are compatible with USB Host Mode. Use only compatible phones, with the proper Android operating system and USB Host Mode drivers. To learn more, visit How can I determine if my device has USB host mode (OTG) support?


Step #1: Build the circuit.

Android-Arduino LED Strip LightsAndroid-Arduino LED Strip LightsAndroid-Arduino LED Strip LightsAndroid-Arduino LED Strip Lights
  • RGB LED strips usually have 4 wires: one for power, and one each for red, green, and blue control. When the strip is powered, pulling any of the control lines to ground will cause that color LED to light up at full brightness. Using pulse-width modulation (PWM) on those control lines allows you to modulate the brightness of the lights.
  • A strip 1m long can draw nearly 1A when the red, green, and blue LEDs are on full brightness. An Arduino’s output pins can only supply around 40mA each, so you’ll have to help it out with a driver circuit to boost the power. This circuit takes 3 PWM signals from the Arduino and uses them to drive 3 transistors supplying power to the red, green, and blue LEDs — giving you full control over the brightness of each color, so you can mix them to create any color in the spectrum.
  • NOTE: Want to power 1 or 2 LEDs instead of a whole strip? Ignore the transistors and connect the LEDs directly to the Arduino’s output pins.
  • The driver circuit (1st photo) is a basic transistor amplifier repeated 3 times. A 5V, low-current PWM signal comes from the Arduino to the transistor’s base (B) via a 1K resistor. This signal switches the transistor, allowing it to conduct higher current at 12V across the collector (C) and emitter (E) through the LEDs. The transistor can switch fast enough so that the LED power is PWM’ing just like the input signal, resulting in the desired brightness control.
  • NOTE: Take care to keep straight which transistor will control which LED color, and connect the transistors the right way around, according to the pinout of the TIP31 transistor (2nd photo). And don’t forget to connect the Arduino’s ground pin to the 12V power supply’s ground!
  • Your completed circuit should look like the 3rd photo. The outputs of the circuit go to a 4-pin header on the right, ready to accept an RGB LED strip.

Step #2: Hack a cable (optional).

Android-Arduino LED Strip Lights

Many Android phones are USB On-The-Go (OTG) devices, which means they can act as the USB host (providing power) or slave (receiving power). In order for your phone to host a USB device such as an Arduino, you need a USB OTG cable. You can buy these for a few bucks online, but if you have old USB cables around it’s more fun to make one Follow the instructions here .

Step #3: Install the Android app.

Android-Arduino LED Strip Lights
  • By adding a few lines of code to an Android app, you can send any kind of data to the Arduino via your USB OTG cable. In this case, you’ll send brightness values between 0 and 255 for the red, green, and blue LEDs. The critical piece of the puzzle here comes from Mike Wakerly. He wrote a fantastic driver for the USB-to-serial chips used in Arduino boards, called usb-serial-for-android. Sending data to an Arduino from your phone is as simple as calling device.write() within your Android app!
  • One great example of this is Katie Dektar’s open-source app called Color Namer ( For this project, I simplified Color Namer into a version called Arduino Color. Download the app and installer at You can also grab the complete source code at

Step #4: Code your own app (optional).

Android-Arduino LED Strip Lights
  • If you’re developing your own app, download Wakerly’s driver from and copy the usb-serial-for-android JAR file into the [your_app_root]/libs directory. This is a pre-compiled library that includes all the necessary functions to open, close, write to, and read from a Serial device from your Android app.
  • Next, copy the device_filter.xml file into the [your_app_root]/res/xml directory. This file acts as a lookup table for USB devices connected to your phone. When you connect an Arduino, its device ID (set by the manufacturer of the USB-to-serial chip) is sent to the phone. If this device ID appears in your app’s device_filter.xml file, then your app will automatically open. (The Arduino’s ID is already in Wakerly’s device_filter.xml file, so you shouldn’t need to make any changes to that file.)
  • Finally, make your app aware that it should be looking for USB devices in the first place. Open your app’s AndroidManifest.xml file and add the appropriate information within your tags: example code 1.
  • To integrate Wakerly’s library, you first have to write code that opens the serial device when the app begins and closes the device when the app stops. Here is some code from Arduino Color as an example: example code 2.
  • Then, you can send data to the opened serial device using the write() function. For example, the Arduino Color app will send color data via serial when the user touches the color picker: example code 3.

Step #5: Upload the Arduino firmware.

Android-Arduino LED Strip Lights
  • The Arduino code for this project is fairly simple; download it at, then open it in the Arduino development environment (IDE) and upload it to your Arduino board.
  • The code uses the Serial library, which is provided with the Arduino IDE and makes it easy to read data sent via serial to the microcontroller. The code endlessly loops while querying the number of available bytes on the serial port. When there are at least 3 bytes available, the bytes are read and stored in an array as red, green, and blue brightnesses. Those brightness levels are then used to set the PWM outputs accordingly.
  • Notice that there are constants called max_red, max_green, and max_blue. You may find that your LED strip is not well color-balanced. In theory, if you turn on the red, green, and blue LEDs at max brightness, the resulting light should be white. In practice it may have a slight color cast (generally green or blue). You can compensate for this by tweaking the max value constants that are called by the map function. See example code 4.

Step #6: Connect it all together.

Android-Arduino LED Strip LightsAndroid-Arduino LED Strip LightsAndroid-Arduino LED Strip LightsAndroid-Arduino LED Strip Lights
  • You’re ready to begin your light show! Connect the Arduino to your phone and you should see a notification pop up asking if you’d like to open the Arduino Color app. Yes, please!
  • Connect the LED strip to your driver circuit, and turn on the 12V power supply. Using the Android Color app on your phone, you should now be able to adjust the color of your light strip in real time.
  • Attach the light strip to the underside of a coffee table, bring it to a nighttime party, or stick it on your bike!


Other Explorations

Now that you understand how to talk to an Arduino with an Android app, you can take this project further in all kinds of ways:

  • Go wireless: add a Bluetooth or Wi-Fi module to your Arduino and get rid of the cable.
  • Make lights that change color based on the orientation of your phone.
  • Use the GPS in your phone as well as some fancy sensors connected to the Arduino to make a location-aware data logger.
  • Use an individually addressable LED strip and adjust the code for more control over the light show.

To learn more about getting started with Arduino, check out our best-selling book Getting Started with Arduinoand our Arduino projects and tutorials, from beginner to advanced.


  • Very nice! One question that isn’t directly Arduino related – how did you make the frosted ‘Make’ lettering? Is it perspex, paper or something else? And was it cost effective?

    • Aa

      It looks like (some kind of a support system inside first of all), laser cut panels of frosted acrylic, and then the grey edges might be whats known as illustration board (a kind of thick paper) glued to the edges.

  • Danniel Murcia Suarez

    what program do you use for the application in Android Eclipse, NetBeans or Which one ?

  • pippo

    very nice work.
    Do You know if arduino 2009 is supported or not?



  • Alex

    I liked it better if it were possible to change color by bluetooth. Already I was looking and I tested several none worked. If anyone knows what to say.

    • Omar

      You probably need to add a Bluetooth shield to your Arduino so it can receive the signal

  • Omar

    Hi Trevor,

    Can you please elaborate why you chose a TIP31 transistor and 1KΩ resistor?

    How much base current is needed to switch the 1.2A 1-meter LED strip?

    Also, with the 1KΩ resistor means the Arduino is only outputing about 5mA current or less, right?

    Sorry, just trying to better understand the transistor-resistor relationship.



  • Roby
  • Ash

    hey guys, I’m new to this, so take it easy on me when i ask : are u guys using the Arduino Uno or something other Arduino board ?

    • Chico Demmenie

      No this is the arduino Uno i believe

      • Ash

        Thanx :)

  • Chico Demmenie

    Hey im having trouble making this project work my Android device doe not seem to be communicating with the arduino and at first the led strip went white but would not change color When i opened the app but now the led strip does not work at all

    • ieee488

      Not many smartphones have support for USB Host Mode. The two I had didn’t. My Nobis 7″ tablet did. If you want to find out if your smartphone can run this app, install USB Host Diagnostics app and it will tell you.

  • Aidan Platkin

    How is this being powered?

    • Danny Novak

      12 volts dc

      • _Chris33

        Sorry for replying to the VERY old comment, but i can’t find this anywhere. How do I connect a 12v power supply to the breadboard?

  • Su

    Hi Trevor,

    Just wondering: If I plan to add a bluetooth connection to this, what are the codes I should include in this existing one?

  • Sachin

    i am really scared that iu i might fire up my phone . So is it possible to use bluestacks app player and install the app on laptop and provide the value of colours to the aurdino board ?

  • Lucas G

    Hi! Could you please tell us why you use transistors instead of MOSFETs?

    • Goku Son

      can…..i try it before…
      it successfully run and we win exibition

  • Goku Son

    assalamualaikum, I AM network student,this arduino coding can apply on the intel galileo board??THANkS Trevor

  • Karel Lohmeier

    Hello Trevor for a test i used only 3 leds and instead of tip 31 2n2222 it worked good for me. Thank you for the project.

  • Pawel Choinski

    Will tip31 work when I have 6m long LED? Cous it is 3A and I will need 6A – Which transistor shuld I use? Or can I simply cut LED 2x3m and put 2 of them?
    Thx for help

  • Lucas Mordini

    Hola Trevor, ¿cómo pordría hacer para controlar las tiras de led rgb a travez de la notebook con un emulador de adndroid?

    Agradecería una pronta respuesta.

  • Samaa

    I really like this project and I’m thinking of choosing it as my project in one of the courses I’m studying currently.
    My question is : is it possible to control the LED strip via PC instead of an Android device?

  • Stephen Frederick

    Could I up the voltage for more powerful lights, say 120v and 50 watts?

  • jbergamin

    Awesome project! This inspired me to make a Led strip that can be controlled over WiFi with a Android app I wrote. You can see it here: The circuit diagram you provided was very helpful.

  • Ayush Jain

    controlling brightness and colors of led with sound (beats, frequencies etc)