Weekend Projects – Android-Arduino LED Strip Lights

Weekend Projects - Android-Arduino LED Strip Lights

Hi, this is Wayne again with a topic “Weekend Projects – Android-Arduino LED Strip Lights”.
Color changing LED lights are great but being able to control those LED lights with your Android device. Is awesome. Hi I’m going Mohammadi senior editor and make in this project by Trevor. Shannon you’ll learn how to use your Android phone or tablet, along with an Arduino, to communicate with a strip of full-color LEDs. Just imagine what you can light up with this fun and easy project. It’S not as complicated as it might sound, and by using these parts and following the instructions on the project page, you can build your own Android controlled light show in just a few hours, and all you need are a few basic tools with no soldering required to Begin, let’s take a look at the wires on one of the RGB LED strips these strips have four wires, one for power and one wire for each of the red, green and blue control signals using the Arduino to generate pulse width. Modulation signals on each of those control lines allows you to modulate the brightness of each color, so you can mix them to create any color in the spectrum.

Weekend Projects - Android-Arduino LED Strip Lights

A one meter, long LED strip can draw nearly 1 amp when the red, green and blue LEDs are all at full. Brightness and Arduino is output? Pins can only supply about 40 milliamps each so you’ll have to help it out with a driver circuit to boost the power. This circuit is composed of a very basic transistor amplifier on each control line. A 5 volt low, current pulse width. Modulation signal comes from the Arduino to the transistors base via 1 kilo, ohm resistor, the signal switches, the transistor on and off, allowing it to conduct higher currents at 12, volts across the collector and emitter and then through the LEDs. The transistor can switch fast enough so that the LED power is modulating just like the input signals resulting in the desired brightness control start by running a 12 volt power supply to the rails of your breadboard, connecting the positive power to the positive rail and the negative Power to the ground rail next insert the LED strip wires into the breadboard and run a wire from the positive rail to the positive input of the LED strip.

Weekend Projects - Android-Arduino LED Strip Lights

Now we can start wiring up the circuit start by connecting pin nine of the Arduino to an open row on the breadboard. Next use a 1 kilo, ohm resistor to jump across the gutter of the breadboard and then insert a transistor so that its base is connected to the resistor. Next connect the collector of the transistor to the red wire of the LED strip, which controls the red LEDs.

Weekend Projects - Android-Arduino LED Strip Lights

Then run a wire from the emitter of the transistor to the ground rail of the breadboard. Now all we need to do is build that same circuit, two more times repeat the steps to connect, pin 10 on the Arduino to the green control wire on the LED strip and then again to connect, pin 11 to the blue control wire. Finally, tie the whole circuit together by connecting the ground pin of the Arduino to the ground rail of the breadboard. Now that we have all the electronics sorted out, we’ll download the Android app, the link can be found on the project page. The app sends brightness values between 0 and 255 for the red, green and blue LEDs. The critical piece of the puzzle here comes from Mike Waverly. He wrote a fantastic driver called USB serial for Android. Now, sending data to the Android is as simple as calling device right within your Android app for all you coders out, there be sure to get the download link to the full source code and all the information you need to know about coding, your own app from The project page many Android devices support USB on-the-go, which means that they can act as a USB host by providing power to an external device like an Arduino. In order for your phone to host a USB device, you need a USB on-the-go cable.

You can pick one up online or you can learn how to hack an old USB cable by following the instructions found on the project page we fry to phone during this, build. If you’d like to avoid this experience, please follow these directions completely. Make sure your device supports USB host mode with the proper hardware operating system and drivers and that you have a compatible OTG cable, if you don’t know find out before you start this build, we’ve got more advice on the project page, your device should be all set And now all we have to do is upload some code to the Arduino start by downloading Trevor’s source code from the project page next open the file in the arduino development environment and upload it to your arduino board. You can learn more about how to do this.

From links on the project page, the code endlessly loops, while querying the number of available bytes on the serial port, when there are at least three bytes available, the bytes are red as red, green and blue brightness. Those brightness levels are then used to set the pulse width, modulation, outputs. Accordingly, you may find that your LED strip is not perfectly color balanced in theory. If you turn on the red, green and blue LEDs to their max brightness, the resulting light should be white. In practice.

It may have a slight color cast. You can easily compensate for this by tweaking the max value constants found in the arduino code that are called by the map function. Look for the constants called max red max green and max blue in the beginning few lines of code play around with those numbers to help balance out the color, so it matches the color you select in the app now it’s time to control the LED strip. With your phone or tablet, it’s pretty cool, but that’s just the beginning. Think about all the different things you can control with just a few changes to the code.

A whole new world of possibilities opens up we’d love to see your build, especially any modifications, hacks and apps that you have created head over to the project page and show us what you’ve got. .