Digistump Forums

The Digispark => Digispark (Original) Support => Topic started by: MichaelMeissner on November 29, 2013, 12:03:59 pm

Title: How should I wire up a neopixel ring?
Post by: MichaelMeissner 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 (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
Title: Re: How should I wire up a neopixel ring?
Post by: digistump 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)
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner 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.
Title: Re: How should I wire up a neopixel ring?
Post by: digitalcoleman 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...
Title: Re: How should I wire up a neopixel ring?
Post by: Tommy_2Tall 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
Title: Re: How should I wire up a neopixel ring?
Post by: dougal 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?
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner 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.
Title: Re: How should I wire up a neopixel ring?
Post by: Bluebie 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)
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner 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.
Title: Re: How should I wire up a neopixel ring?
Post by: gogol 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
Title: Re: How should I wire up a neopixel ring?
Post by: Bluebie 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.
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner 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.
Title: Re: How should I wire up a neopixel ring?
Post by: Bluebie 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!
Title: Re: How should I wire up a neopixel ring?
Post by: gogol 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.

Title: Re: How should I wire up a neopixel ring?
Post by: Bluebie 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.
Title: Re: How should I wire up a neopixel ring?
Post by: gogol on December 08, 2013, 03:06:32 am
yep, thats right!
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner on December 08, 2013, 11:56:22 am
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.
The problem is where I want to use 2 rings (in steampunk goggles, where I need to hide the microprocessor/battery somewhere in the hat band or in the goggles), adding the requirement of separate power means another board that I have to incorporate somewhere.  I don't want to use digispark shields, because the height of the risers makes it harder to conceal the microprocessor, so likely I have to have a small board that has either a USB power plug or lipo connector + step-up voltage converter, and the wiring to split off the power before it gets to the micro processor (or use the Adafruit perma proto that fits in a mini Altoids tin).  If I have to wire up a board, it becomes the same amount of work to use a raw ATtiny85 chip, instead of a digispark.

Sure, it isn't rocket science, but it is annoying to have to wire it up this way.  Experience has shown that the less interconnects I have, the less time I will spend looking for faults in the wiring, etc.  So having the battery directly connected to the microprocessor helps reduce the number of wires, etc.

The Gemma is now my processor of choice for this particular application.  The Gemma has a lipo battery plug as well as the USB socket, so I can connect the battery directly to the microprocessor.  I can wire up the rings, connecting the ring power to Vout, the lights connected to PB1, and the ground to the ground wire.  I had originally hoped to use a spark plugged directly into a USB plug connected to AA/AAA/lipo batteries.
Title: Re: How should I wire up a neopixel ring?
Post by: Mark on December 09, 2013, 11:31:34 pm
If you've finished the programming, there's no reason you can't short out the diode, and power it via the USB Battery pack.
The diode is there to stop any external voltage being fed back into the computer/laptop.

You could also just cut a USB lead and wire it to the 5v and ground.

Mark
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner on December 10, 2013, 05:22:13 am
For most things that I do, I am never 'finished' programming.  I build something and use it for a particular application, and then it usually morphs into something new, gets new functionality, or I tear it down and make something else.  So I tend to be reluctant to make 'permanent' changes like cutting traces.  Particularly on microprocessors where I have multiple units, I would have to mark somehow the boards that have been modified.
Title: Re: How should I wire up a neopixel ring?
Post by: dougal on December 10, 2013, 06:17:17 am
You wouldn't necessarily have to have two separate power sources. You could have one 5V source powering both the Sparks and the Rings. Just tap directly into the power for the Rings, without passing through the Spark's circuitry. You'd just have to make sure you have 5V available externally, without relying on the Spark's power regulator.

This is just one of those things you'll have to deal with in many projects where external components need lots of current (LEDs, motors/servos, etc), and not only on the Digispark. If you're powering via USB, you'll often run into power supplies or supporting power regulation components limited to 500mA. You're sometimes going to have to use a separate buck/boost circuit. You might be able to get away with a 9V battery and a couple of resistors as a voltage divider for 5V.
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner on December 10, 2013, 06:42:11 am
You wouldn't necessarily have to have two separate power sources. You could have one 5V source powering both the Sparks and the Rings. Just tap directly into the power for the Rings, without passing through the Spark's circuitry. You'd just have to make sure you have 5V available externally, without relying on the Spark's power regulator.

Yep.  Though in the particular case I was wanting to solder permanent wires to the neopixel rings.  Unfortunately, my soldering station was across the room from the computer terminal, and I was trying to bring over a microprocessor with minimal components to test whether I had the 3 wires soldered correctly.  The spark with the headers mounted was the easiest to use (no breadboard, powered directly from the USB charger, and with headers, I could plug the wires directly into the headers).  Having to have the external power setup would have been more parts to move over to an already cramped setup.

This is just one of those things you'll have to deal with in many projects where external components need lots of current (LEDs, motors/servos, etc), and not only on the Digispark. If you're powering via USB, you'll often run into power supplies or supporting power regulation components limited to 500mA. You're sometimes going to have to use a separate buck/boost circuit. You might be able to get away with a 9V battery and a couple of resistors as a voltage divider for 5V.
I dislike non-rechargeable batteries, and tend to use 5v batteries with USB ports.  With the spark I don't need the cable, and for debug type stuff, I can plug the spark directly into the battery.  Wiring up 2-3 external wiring setups is on my to-do list, and I probably will tackle it during the Christmas holidays.  It is unfortunate (IMHO) that I can't get directly to the 5v power without going through the spark or providing an external setup that splits the power early.

One way to tackle the problem is to use the Programming Tool, and attach the wires where the USB is attached to the PCB to get the external power.  I ruined my previous Programming Tool PCB and I added a new PCB to my DigiX order,  just before it shipped.  So when I get some time, hopefully I can work on it.
Title: Re: How should I wire up a neopixel ring?
Post by: dougal on December 10, 2013, 01:52:18 pm
Hey Erik,

Any chance that there might be room on the Digispark Pro for some through-holes where we could solder a 2-pin header to tap directly into the USB 5V/Gnd before it goes through any other components? A power pass-through like that would be handy for this kind of thing. :)
Title: Re: How should I wire up a neopixel ring?
Post by: Mark on December 10, 2013, 10:26:34 pm
Quote
For most things that I do, I am never 'finished' programming.
I understand that.
I should have said .. when you are happy with the code, then solder a wire across the diode.

As an alternative, soldering the wires to a switch, might allow an easy way to make it 'non permanent'

The fact the Digispark only presents when repowered is the bit that makes this slightly tricky.
You could detect one of the pins state and decide to NOT turn the neopixels on, thereby allowing the programming to happen.

Mark
Title: Re: How should I wire up a neopixel ring?
Post by: digistump on December 10, 2013, 10:30:34 pm
Dougal - I'll look into that - the pro is already very cramped to get it all on the board - but I can probably squeeze out some space.

My solution - though I have to say I rarely use power at this level without just using a wings shield and hooking the external 5v up for everything - is usually just to bridge the diode and make sure if I re-program it that I do so through a cheap powered hub - protects my computer and I have yet to actually fry a hub with the diode bridged and external power on
Title: Re: How should I wire up a neopixel ring?
Post by: Bluebie on December 11, 2013, 01:55:49 pm
Remember also that despite labelling, the digispark is good down to about 3 volts (applied to gnd and 5v pins) if and only if you set the Board to Digispark 8mhz. With the ws2812 library from adafruit you can use 8mhz just fine and dandy. This will also give you slightly better battery life, though the code which calculates or loads the colours will run half as fast (delays still work properly, and the code which transmits colours to the lights is just as fast). This means you can hook up directly to a lipo/liion battery for power if you select 8mhz :)
Title: Re: How should I wire up a neopixel ring?
Post by: MichaelMeissner on December 11, 2013, 02:26:24 pm
Makes sense.  Thanks for reminding me of the 8Mhz option.  I can run a Gemma (8Mhz) well with a ring and a lipo battery, so it is good to have other options.

For the thing that I'm working on right now (Christmas ornaments), it won't matter about battery power, since I will be using a USB charging cable for power.  But I need to get the steampunk googles done shortly, and that needs to be battery powered.
Title: Re: How should I wire up a neopixel ring?
Post by: pckcomeback on May 20, 2019, 09:49:50 pm
Ok thanks
สมัครufabet (http://www.ufabet99.vip)