Author Topic: How should I wire up a neopixel ring?  (Read 22098 times)

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
How should I wire up a neopixel ring?
« on: November 29, 2013, 12:03:59 pm »
I shorted out one of my sparks when I tried to put an Adafruit neopixel ring (http://www.adafruit.com/products/1463) on a digispark.  I would like to know what to do in the future, so I don't slag my remaining digisparks.

The sketch I'm running just runs through the colors, turning all 16 pins out at a time, with the brightness level of 10.

I wired the neopixel ground pin to the spark ground pin, the neopixel power pin to the spark 5v pin, and the neopixel data input to the spark p4 pin, and connected the spark to a powered USB hub that is connected to my laptop.  I presume the neopixel drew more power than the spark could handle, and shorted it out.  I no longer see the power LED light up, and when I connect it to the computer, I don't see any traffic on the system log that usually happens when a spark is connected.

When I hook up the neopixel ring on my Teensy 3.0 that is powered through USB, I hook up the power to the VIN pin.  When I hook it up to a raw ATtiny85, I connect it to the 5v line that is the power feed (currently the 5v is from the Uno proto-shield, as I am using the Uno as a programmer).  Since I was powering the spark via USB, and not through a separate power supply, I didn't have the option to connect the ring to the power source by-passing the spark.  Would using the VIN pin on the spark have been better, or would I need to use external wiring like I do with a raw ATtiny85.

Thanks in advance.

Lets see, I've ruined 3 different devices in 3 days (2 via soldering mistakes, that I'm trying to correct, and the third being the spark).  Maybe it is time to take up knitting  :o
« Last Edit: November 29, 2013, 12:08:33 pm by MichaelMeissner »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: How should I wire up a neopixel ring?
« Reply #1 on: November 29, 2013, 11:58:10 pm »
I'm guessing you killed the sensative reverse voltage diode - your hook-up would probably work (and the same Digispark would work) if you put 5v on the 5v pin directly (bypassing the diode) instead of feeding it through the USB connector (limited to 500ma)

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Re: How should I wire up a neopixel ring?
« Reply #2 on: November 30, 2013, 07:09:19 am »
Ok.  I had picked the spark with its USB plug and female headers as the simplest portable ring tester.  I was about to solder up the wiring to the rings, and my soldering station is away from the computer.  Oh well, live and learn.

digitalcoleman

  • Newbie
  • *
  • Posts: 2
Re: How should I wire up a neopixel ring?
« Reply #3 on: November 30, 2013, 10:48:56 pm »
I have been using my digispark with a neopixel ring without issue on pin 0 for what it is worth. no shorts or overloads, tho i have caused the usb card in my retina MBP to short out once or twice, making the touchpad and keyboard unusable until restart...

Tommy_2Tall

  • Newbie
  • *
  • Posts: 13
Re: How should I wire up a neopixel ring?
« Reply #4 on: December 01, 2013, 11:28:16 pm »
I have almost the same experience as digitalcoleman (minus the shorts, so far...).

I've been using a 16 pixel  ring with some (salvaged) stranded headphone cables "twist-connected" to the 5V/Gnd/P0 pins  on my Digispark.
No shorts so far but I really should get a proper soldered connection to those cables, so I don't short the Digispark 5V and Gnd pins.. that's probably a very efficient way to create an instant, single use, magic-smoke emitter. :-S

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: How should I wire up a neopixel ring?
« Reply #5 on: December 02, 2013, 07:13:55 am »
Likewise, I've had success with the Digispark driving a 16 pixel NeoPixel ring.

I was using a battery-powered boost circuit with a USB connector to power the spark. I powered the NeoPixel Ring via the GND and 5V headers on the Digispark, and connected the data-in to P1. (I liked P1 for testing, because it blinks the Digispark's on-board LED as data is sent, giving me feedback in case the ring wasn't working correctly for some reason)

I assume you've already tested to be sure that the USB port on your hub/computer are still working correctly with other devices?

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Re: How should I wire up a neopixel ring?
« Reply #6 on: December 02, 2013, 07:37:42 am »
Hmmm, I tried the USB powered hub I had used, and it seems wonky now.  I know I plugged in my Uno as ISP where I had a short circuit in the wiring into that hub, so I probably fried it.  While the spark seems to be dead, it gives me hope that the normal wiring setup will work.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: How should I wire up a neopixel ring?
« Reply #7 on: December 02, 2013, 03:14:47 pm »
Seriously please stop powering neopixel rings off usb. Each of the 16 lights outputs 20ma per channel for 60ma total, combined this is about 960ma - more than twice what an arduino or digispark can provide, and also double what a regular USB port is rated to provide. It doesn't matter if you never set all of the lights as being on because sometimes when you initially power up the ring the lights are in a non-black state. You can't predict that and you can't fix it until you start sending updates, which on a digispark is probably 5 seconds after you plugged it in!

Just use some batteries if you don't have another power supply (like a 1amp phone charger). The things work fine down to about 3.5v and up to about 6v. So long as ground and data connect to the spark, and ground and vin connect to your power source, you should be fine (hopefully not creating any ground loops but that's another story)

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Re: How should I wire up a neopixel ring?
« Reply #8 on: December 02, 2013, 07:58:30 pm »
Seriously please stop powering neopixel rings off usb. Each of the 16 lights outputs 20ma per channel for 60ma total, combined this is about 960ma - more than twice what an arduino or digispark can provide, and also double what a regular USB port is rated to provide. It doesn't matter if you never set all of the lights as being on because sometimes when you initially power up the ring the lights are in a non-black state. You can't predict that and you can't fix it until you start sending updates, which on a digispark is probably 5 seconds after you plugged it in!

Just use some batteries if you don't have another power supply (like a 1amp phone charger). The things work fine down to about 3.5v and up to about 6v. So long as ground and data connect to the spark, and ground and vin connect to your power source, you should be fine (hopefully not creating any ground loops but that's another story)
The whole thing needs to be run off of a cell phone charger or similar cheap wall wart, but I was running it off of the computer USB to program it.  I was running the ring with a single color at brightness of 10 (alternating colors, but never having more than 1 color active at a time).  I figured the power to be about 12maH when the whole ring is lit, which should be well in the safety margin of the ATtiny85's max of 40maH per pin.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: How should I wire up a neopixel ring?
« Reply #9 on: December 03, 2013, 01:38:35 am »
Hello Michael,

mAh is the Unit of electric charge Q , while A or mA is the Unit of the electric current, we are speaking here.

The datasheet of the WS2812B LED tells, that each LED can consume up to 20mA, which makes 60mA for each pixel.  Measuring some of my strips (30,60,144 LEDs/m) shows values between 54 to 61 mA per LED.

So if the NeoPixel-Ring with 16 Pixels is fully on, it will be close to 1A (960mA), which kills for sure the diode on the digispark (close to Pin 0).  You can rescue the digispark by replacing this diode. 

When I play with smaller strips, i power them from 4 eneloop AA cells in a cheap holder for 4 AA sized batteries.  The eneloops have fully charged little bit over 1.2 V, which gives almost exactly 5V.  You have only to make shure, not running them on 4 Alkali 1.5V batteries!

regards

  gogol
« Last Edit: December 03, 2013, 02:32:03 am by gogol »

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: How should I wire up a neopixel ring?
« Reply #10 on: December 03, 2013, 01:55:27 am »
how much power the pin can provide is irrelevant. You shouldn't power ws2812 lights using pins on the attiny or arduino or anything else along those lines. They should be powered by connecting the gnd and vin/5v wire to those connections on the power connector on the digispark or arduino, or at least connecting ground, and supplying the lights with their own power source (like batteries)

The lights should not be draining any power from the digispark's digital pin. If they are draining more than a milliamp or two, there is probably something very wrong.

Also, if using a cell phone charger make sure you aren't powering the lights by connecting them to 5v and gnd on the digispark, then plugging the digispark in to a USB socket on the charger. This will not work, and will break the diode on the digispark. If the digispark and lights share a power supply, the digispark must be wired to the ground and vin or 5v pins, whenever you are connecting more than 8 lights. Never power the digispark via the usb port while more than 8 ws2812 lights are connected to the digispark's 5v or vin pin.

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Re: How should I wire up a neopixel ring?
« Reply #11 on: December 03, 2013, 07:35:08 am »
It would be nice if there something like the Digispark Programming Tool that had an extra power port, and a 2P3T switch instead of the 1P2T switch that allowed you to switch the USB power from the computer to a secondary device (the switch would have 3 positions, off, power from computer USB, and power from secondary port) for doing wiring like this.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: How should I wire up a neopixel ring?
« Reply #12 on: December 06, 2013, 01:09:08 pm »
The digispark will break if you try to move more than 500ma through it's usb connector to the 5v & gnd pins. If you already have a secondary power source, connect it to 5v and gnd - you can connect them while plugging in to usb even - that's what the diode is there for!

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: How should I wire up a neopixel ring?
« Reply #13 on: December 07, 2013, 08:25:32 am »
Hi problem is, that the digispark programming tool is not longer working, when the digispark is powered from external power (no matter if regulated or not).
In that case the 5V switch in the programming tool makes no sense, as the digispark is running on the external power.
In that case you need to plug and unplug the digispark, when programming, to restart the digispark.


Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: How should I wire up a neopixel ring?
« Reply #14 on: December 07, 2013, 06:18:44 pm »
Easy solution: power the digispark through usb (programming tool) and power the lights from their own power source. Connect the lights gnd and data to the digispark, and the lights gnd and 5v to their own power source. Connect the digispark as usual, and then the spark can restart freely without being powered by the lights.