Today we will be tackling the project of implementing Serially Addressable LED tape and an Arduino into your flying projects.
The Open Source movement has a caused a great stir among hobbyists worldwide. From 3D printers, to laser cutters, to immense processing power for only a few cents, the average person can create many things at home that were not obtainable in the past. This project, while not immensly challenging, utilizes a few core components from the open source movement. Lets get started.
Here are the parts we will be using:
Arduino Pro Mini 328 5V 16MHz --- https://www.sparkfun.com/products/11113
Serial Addressable LED Tape --- http://www.adafruit.com/products/306
(2) 12" Jumper Wire 6-Pin --- https://www.sparkfun.com/products/10376
Straight Header Pins --- http://www.adafruit.com/products/392
FTDI to USB Cable --- http://www.adafruit.com/products/70
Hot Glue
Soldering Station/Solder
Velcro/Hook and Loop
There are an assortment of parts (some much cheaper than those I used) that could be substituted for the above. These are simply the ones I had laying around. Hopefully from seeing how these parts are assembled, others will be able to develop their own custom setup.
Lets first get out the LED strips. These are usually able to be cut in short lengths to fit various applications. The ones I have are 2 LEDs per section. The ends will be marked to identify which side is the input and output. As you can see from the photo above, DO and CO are Data Out and Clock out. DI and CI represent Data In and Clock In.
For my Knuckle Quad, I used 2 strips of 4 LEDs each. I cut my clear tubing to be just a tad shorter than the LED tape so that the wires dont cause such a huge deformation of the tubing around the solder joints. This will be helpful when we hot glue the ends to keep out bad stuff (water, dirt, etc.).
The next thing to do was to test the strips. Since I knew that I wanted to solder the connections to the Pro Mini, it was easier to test the strips using a regular Arduino Uno with Female Headers. Once we have verified the strips are working, its time to look at the microcontroller we will be putting into the air.
For this project I am using the Arduino Pro Mini 5V from Sparkfun. Its is a very lightweight and inexpensive board and is great for anything that flies. Although it is tiny, it still has many great features that you would expect from a larger board. The most critical feature is the onboard voltage regulator. This allows us to hook up anywhere from 5V-12V to power the board. This gives us the ability to run this in any airframe that uses 2S or 3S batteries. The output voltage will always be a clean 5V which is exactly what our LED strips require.
To power the Arduino, I will be pulling power from my 3S LiPo. My Knuckle Quad uses the HobbyKing power distribution board. On this board there is a set of output pins for accessories. This is a perfect spot to pull power for the Arduino. If you aren't using a power distribution board, you can solder two wires into your harness or main power plug to achieve the same result.
To connect the Arduino to the power pins, I picked up a JST connector set at HobbyTown.
When soldering the JST connector to the Arduino, be sure that the input voltage connects to the pin labeled "raw". This is the pin that feeds the internal voltage regulator. If you hook your 3S LiPo to the pin labeled Vcc, youl will let all the smoke out. The smoke never goes back in. Trust me.
This is also a good time to solder on the header pins for the FTDI Cable.
I tested the board to make sure everything was working properly. The quickest way I know to check if my Arduinos (and the IDE) are working properly, is to upload the example script "BLINK". If this works, you are more than likely good to go.
Next is to solder the wired to each LED strip. I cut the ends off of the jumper cables and removed 2 wires. This gave me a nice 4 wire bundle for each strip.
I sealed the ends of the strips with some hot glue. This should help keep dirt, water, and grime out of my LEDs.
Next, I attached the strips to the frame of my Quad using zip ties. I tried hot glue at first, but it wasn't sticking as well as I would have hoped. The zip ties seem to hold up well.
Once both strips were installed, I soldered the wires to the Arduino. Both power lines went to Vcc, both ground lines went to the extra GND pin. The DI and CI pins for both strips go into the digital pins. The exact pin number for each D and C line can be tweaked in the code. Personally, I used digital pins 3-6.
A little bit of velcro to secure the Arduino to the KK2 case.
You can barely make out the pins where the JST connector is to be connected.
Now the mounting and wiring is complete. Time to program.
The project is complete! Enjoy programming fun patterns and colors into your Arduino. If you have any questions or comments, please dont hesitate to leave them below. Good Luck!
Log In to reply
Log In to reply
Log In to reply
I do however have to disagree with you. The Gemma (and Flora for that matter) are both quality boards, but have some serious drawbacks for these type of applications. The first is most importantly the native onboard voltage. The Pro Mini is a 5V board, where as the Gemma is 3.3V. Since most serial addressable LEDs are either 5V or 12V logic, this may be a problem for some folks. Other issues include having to do some tricky coding in the IDE to make the Gemma work as a true arduino, the limited number of pins, both (Digital and Analog), and the lower crystal clock speed. For the case of RX input, any switch can control any of the pins on the Pro Mini. You could use analogRead() and set some if statements around what the number is (0-255), or you could get fancy with a digitalRead() and scale the incoming status. Either way, the Pro Mini can handle this task on multiple pins.
Although I love the Gemma and the products Adafruit has to offer, For the case of putting a small Arduino onto an RC project, I don't think that there is a better option (currently) than the pro mini. I would love to see more projects using Arduino, so throw the Gemma on something and let us see how it works!
Log In to reply
Log In to reply
Log In to reply
https://www.youtube.com/watch?v=umteNHddno4&feature=youtube_gdata_player
Aside from that I would agree the pro mini is much better, but it costs more and it's more difficult to work with, needing ftdi and the like to program. Once I modified my Arduino ide following the instructions it works just as well as my uno.
Log In to reply
Log In to reply
Log In to reply
I was using unassignable LEDs which further complicates things as each pin is limited to 40mA. I am almost done with a prototype 12V LED driver using a Mosfet which I'm hoping to post soon. Definitely not as versatile as the Arduino, but able to handle quite a bit more LEDs.
Log In to reply
Log In to reply
Thanks for the inspiration to dive down another rabbit hole !
Log In to reply
Log In to reply
RAW supply voltage to 3-6 digital pins?
And VCC supply voltage to atmega328 chip?
Log In to reply
The VCC pin is an output. It allows you to tap into the regulated 5 volts and use that for powering external things. As mentioned in a comment above, the VCC pin is only good for a small amount of current, so be careful. It is for this reason that I have my lights "chase" instead of coming on all at once. There would be too much current draw for the regulator to handle.
Log In to reply