Can I use any digital pin to provide signal for the Neopixel

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
icicic
 
Posts: 17
Joined: Sun Aug 30, 2015 9:38 pm

Can I use any digital pin to provide signal for the Neopixel

Post by icicic »

Can I use any digital pin from Arduino Mega 2560 R3 to provide signal to the Neopixel ring? As for voltage, does it matter whether I use 3 or 5V from the Arduino? I plan to use four Neopixel Ring 16.

User avatar
michaelmeissner
 
Posts: 1823
Joined: Wed Aug 29, 2012 12:40 am

Re: Can I use any digital pin to provide signal for the Neop

Post by michaelmeissner »

If you have a choice, use a 5v system, powered by USB (either a USB charger battery that can deliver 5v or via an wall adapter). Otherwise, you can either run the risk of frying your system or you have to make adaptations. The neopixel uberguide covers a lot of this, but if you just want something to work, the simplest is a 5v system powered by 5v usb.

It does not matter what digital pin you use, as long as the digital pin does not have a special use that would interfere with the neopixel.

User avatar
icicic
 
Posts: 17
Joined: Sun Aug 30, 2015 9:38 pm

Re: Can I use any digital pin to provide signal for the Neop

Post by icicic »

Thanks for the warning. How come the Neopixel could fry the system if I don't use a usb charger battery that can deliver 5v or via a wall adapter? I supply voltage to my Mega via a 9V battery source. My system is a portable one so I cannot use a wall adapter or connect it to a computer all the time.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Can I use any digital pin to provide signal for the Neop

Post by adafruit_support_bill »

I supply voltage to my Mega via a 9V battery source.
That is not going to work very well for driving neopixels. A 16 pixel rng can draw quite a bit of power if you drive it hard (close to 1A). That is much more than a common 9v battery can supply. It is also much more than your Arduino 5v regulator can handle when powered from a 9v source. The good news is that the battery will probably fade away before your voltage regulator can overheat and go up in smoke. :)

You should find a good power source closer to the 5v range. 3xAA cells will give you 4.5v. 3x Eneloop rechargeable cells will give you 4.8v - both of which are close enough to 5v for the Mega.

Another option is to use a 3.7v LiPo cell and a PowerBoost 1000 C. That will put out a solid 5v.

User avatar
michaelmeissner
 
Posts: 1823
Joined: Wed Aug 29, 2012 12:40 am

Re: Can I use any digital pin to provide signal for the Neop

Post by michaelmeissner »

I was trying to be somewhat simplistic, rather than trying to go through the possibilities.

A couple of things with neopixels that will affect things:
  • Neopixels have a narrow range of power usage (3.5-5.5v). If you feed it less than 3.5v it may work, but more likely won't work (and depending on how much the voltage is under 5v, blue is likely to not be as blue). If you feed it more than 5.5v, you will likely fry the neopixel. Some of the older neopixels were a little more forgiving in lower power, but in general, you want to feed them 5v power. So, if you feed your Mega 9v, and power the neopixels with the 9v power, you will release the magic smoke.
  • Neopixels can take a lot of amps if you power each led at full power. If you take a RGB 16-LED neopixel ring and turn all LEDs on at full brightness, it will take 864mA of power plus whatever the Mega provides. Note, a lot of USB connections limit you to 500mA (even if it claims a higher wattage, it may only deliver that amount of current if it is connected to a smart phone, and the USB circuit recognizes the signature). When I do a pair of 16 LED rings, I keep the power down for each LED so the sum of R + G + B is no more than 30 -- this means the pair of rings will only draw about 75mA of power.
  • Microprocessors that have a 5v regulator to bring voltage down from 9v to 5v, have limits of how much power they allow through the regulator. If you try to power the neopixels from a 5v regulated output, you have to figure out how much power your microprocessor can supply in a safe fashion, and adapt your neopixels to be well under the limit. As a FIY, I blew out one microprocessor whose regulator could not deliver enough current. I have no idea what the limits are for the Mega.
  • Running at 3.3v presents more challenges. As I mentioned, the datasheet says 3.5-5.5v. If you power the neopixel with 5v, but you use 3.3v signaling it is likely the neopixels will not consistantly pick up the signal. So you have to do level shifting to convert 3.3v to 5v. However, the way neopixels are designed, they have a very tight timing window, and the normal level shifter meant for i2c connections, will NOT work consistantly with neopixels.
  • If you use li-poly or li-ion batteries that freshly charged deliver 4.2v and for most of their charge cycle deliver 3.7v, you can run a 3.3v processor and connect the lights to the raw 4.2-3.7v power without having to use level shifting techniques (because the voltage difference between the data signal and the power rail isn't that much). However, if you program the microprocessor with USB (5v), the lights might not work while powered on USB (when I used to use Gemmas, I had to remember to program them, and then take out the USB to test them on the battery).
  • When you get to higher number of LEDs, you need be more careful about powering the LEDs. Typically, you will provide 5v power to a group of LEDs, and connect the grounds between each group of wires. Consult the uberguide for neopixels. If you have a really high amount of LEDs, the Mega is likely to run out of horsepower, and you likely will need to go with something like a Teensy and the octows2811 shield (or possibly Fadecandy).
So, as I said, the simplest configuration is a 5v processor with a 5v power source

User avatar
icicic
 
Posts: 17
Joined: Sun Aug 30, 2015 9:38 pm

Re: Can I use any digital pin to provide signal for the Neop

Post by icicic »

Thanks All. I guess I just forget about the Mega and get an independent 5v processor.

By PowerBoost 1000 C, is it:

https://www.adafruit.com/products/2030
or
https://www.adafruit.com/products/2465

Which battery product do you recommend?

There are a couple of small processors. which one do you recommend? Gemma, Flora or Feather?

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Can I use any digital pin to provide signal for the Neop

Post by adafruit_support_bill »

This one is the 1000 C - it has a charger built in: https://www.adafruit.com/products/2465

Choosing a battery will depend on what run-time you need. With 4 rings, your average current consumption will probably be in the 2A range (depending on your programming of course) . At that rate, for each hour of run-time you will need 2Ah (2000mAh) of battery capacity.
There are a couple of small processors. which one do you recommend? Gemma, Flora or Feather?
What do you plan to do with it? Those are all 3.3v processors.

User avatar
icicic
 
Posts: 17
Joined: Sun Aug 30, 2015 9:38 pm

Re: Can I use any digital pin to provide signal for the Neop

Post by icicic »

Of the discussions we have, do they also apply for those new RGBW?

I plan to buy a micro-controller just for driving Neopixel. For the time being, four NeoPixel rings. Maybe later also strip.

User avatar
adafruit_support_bill
 
Posts: 88099
Joined: Sat Feb 07, 2009 10:11 am

Re: Can I use any digital pin to provide signal for the Neop

Post by adafruit_support_bill »

Of the discussions we have, do they also apply for those new RGBW?
Yes. Only the RGBW maximum current requirements are about 1/3 higher (~80mA/pixel).
I plan to buy a micro-controller just for driving Neopixel. For the time being, four NeoPixel rings. Maybe later also strip.
If you will be using a 3.3v microcontroller, then you should be running the pixels direct from the LiPo - not from the 5v output of the PowerBoost.

The 32U4 Feathers and the Flora all use the same processor. The Feather gives you access to more pins. The Gemma is a much smaller processor with very limited memory and pins. It can handle up to about 100 RGB pixels, or about 75 RGBW.

User avatar
michaelmeissner
 
Posts: 1823
Joined: Wed Aug 29, 2012 12:40 am

Re: Can I use any digital pin to provide signal for the Neop

Post by michaelmeissner »

In terms of microprocessors, there are many different options.

I tend to like the Teensy 3.2 and Teensy LC. The main forums for Teensys is at: https://forum.pjrc.com/forum.php. Note, you will need to install the Teensydunioinstaller overly over the standard Arduino software: http://www.pjrc.com/teensy.

If you are planning a really big setup, the Teensy 3.2 (https://www.adafruit.com/products/2756) and the Octo ws2811 (https://www.adafruit.com/products/1779) is one way to go. Using the octo ws2811 library, it can do lights in 8 parallel streams (though the addressing is completely linear) using DMA optimizations.

The previous generation Teensy (3.1) was able to light up 4,320 leds in 2014 (https://community.arm.com/groups/embedd ... faire-2014). However, such large scale layouts are probably beyond your budget, and need a lot of attention to detail in terms of power, etc.

If you don't need the full octo ws2811 board (or are going with a different 3.3v processor), this shifter is used quite a bit for one way traffic like neopixels or dotstars (https://www.adafruit.com/products/1787).

I tend to use this level shifter from Pololu for powering more modest sets of neopixels (https://www.pololu.com/product/2595).

If your neopixel dreams are at most a couple of hundred LEDs, consider the Teensy LC (https://www.adafruit.com/products/2419. It uses a slower microprocessor with smaller memory than the Teensy 3,2 and is a little cheaper. For your purposes, it has one special feature -- one of the pins (#17 or A3) has a special level shifter that is specifically made for neopixels. You would hook up the VIN power, ground, and the pin on the back that connects the level shifted output to your neopixels.

In terms of the Teensy 3.2, PJRC (the company that designs Teensy) just released a new prop shield that comes in two variants (at present, Adafruit hasn't yet started to carry it): So if you wanted to do neopixels for a costume, you might want to check out the Teensy 3.2 (or LC) and the prop shield. The low cost prop shield would allow you do do lights and sound (which is what I'm currently building). The version with the motion sensors would allow your costume prop to become more interactive. This thread at the PJRC site discussed the prop shield when it was first in beta test, and now that it has been released: https://forum.pjrc.com/threads/33328-Pr ... -Beta-Test.

User avatar
michaelmeissner
 
Posts: 1823
Joined: Wed Aug 29, 2012 12:40 am

Re: Can I use any digital pin to provide signal for the Neop

Post by michaelmeissner »

Just a FYI, Adafruit is now shipping the prop shields:

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”