Can I use any digital pin to provide signal for the Neopixel
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- icicic
- Posts: 17
- Joined: Sun Aug 30, 2015 9:38 pm
Can I use any digital pin to provide signal for the Neopixel
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.
- michaelmeissner
- Posts: 1823
- Joined: Wed Aug 29, 2012 12:40 am
Re: Can I use any digital pin to provide signal for the Neop
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.
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.
- icicic
- Posts: 17
- Joined: Sun Aug 30, 2015 9:38 pm
Re: Can I use any digital pin to provide signal for the Neop
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.
- 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
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. :)I supply voltage to my Mega via a 9V battery source.
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.
- michaelmeissner
- Posts: 1823
- Joined: Wed Aug 29, 2012 12:40 am
Re: Can I use any digital pin to provide signal for the Neop
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:
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).
- icicic
- Posts: 17
- Joined: Sun Aug 30, 2015 9:38 pm
Re: Can I use any digital pin to provide signal for the Neop
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?
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?
- 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
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.
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.
What do you plan to do with it? Those are all 3.3v processors.There are a couple of small processors. which one do you recommend? Gemma, Flora or Feather?
- icicic
- Posts: 17
- Joined: Sun Aug 30, 2015 9:38 pm
Re: Can I use any digital pin to provide signal for the Neop
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.
I plan to buy a micro-controller just for driving Neopixel. For the time being, four NeoPixel rings. Maybe later also strip.
- 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
Yes. Only the RGBW maximum current requirements are about 1/3 higher (~80mA/pixel).Of the discussions we have, do they also apply for those new RGBW?
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.I plan to buy a micro-controller just for driving Neopixel. For the time being, four NeoPixel rings. Maybe later also strip.
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.
- michaelmeissner
- Posts: 1823
- Joined: Wed Aug 29, 2012 12:40 am
Re: Can I use any digital pin to provide signal for the Neop
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):
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):
- Low cost prop shield, with a mono amp hooked up to the DAT (digital-analog converter, which can be used for sound), 8 megabytes of flash memory, and 2 pins (11/13) shifted from 3.3v to 5v suitable for either neopixels or dotstarts (http://www.pjrc.com/store/prop_shield_lowcost.html).
- Full prop shield that includes every from the low cost prop shield and adds full motion sensors (http://www.pjrc.com/store/prop_shield.html)
- michaelmeissner
- Posts: 1823
- Joined: Wed Aug 29, 2012 12:40 am
Re: Can I use any digital pin to provide signal for the Neop
Just a FYI, Adafruit is now shipping the prop shields:
- Basic prop shield: https://www.adafruit.com/product/3086;
- Prop shield with motion sensors: https://www.adafruit.com/product/3085.
Please be positive and constructive with your questions and comments.