Custom NeoPixel Rings From Scratch!

8,420

114

13

About: Engineer/Maker/Hobbiest I make videos documenting my personal engineering research, and related technologies. While through invention is near impossible, its always worth striving towards. Follow me if y...

NeoPixel rings, and NeoPixels in general, are among the most popular electronic components for makers of all types. For good reason too, with a single pin from any popular microcontroller Adafruit makes adding gorgeous LEDs and animations to any project extremely easy.

Unfortunately they are rather expensive, and Adafruit only sells four sizes. What many makers don't realize is NeoPixel is simply Adafruit's branding of a few identical LED chips named WS2812, WS2811 and SK6812 respectively. All Adafruit does it take the chip and put it on a circuit board, charging a hefty premium alongside. There is nothing wrong with Adafruit doing this as it makes NeoPixels accessible to everyone, but if one were to simply make the boards themselves one could make custom shapes of any size or design for around 15% of the cost of Adafruit's models (for a 24 LED ring)($3). More importantly, they cant be any size you need! Despite that, it doesn't seem like anyone has created a guide exactly for doing this.

So, when I needed a custom compound ring for my working Samus Arm Cannon project (coming soon) I figured why not document the process.

In this tutorial I'll show you exactly how I made this custom ring, and how you can make your own.

Step 1: What You'll Need:

Always Necessary Regardless of Method:

If you choose to get your board professionally manufactured that is all you need. If, however, you instead choose to manufacture your board using the toner transfer method you will also need the following components. I personally did not use the toner transfer method, however my method is outside the scope of this tutorial. I plan to post a tutorial for how exactly I make PCBs, so watch out for that!

Homemade Board(Toner Transfer Method):

.Here are all of my files, diptrace libraries, and models.

For those wondering how the price compares ill compare it to an Adafruit 24 LED ring which costs $17+shipping.
Cost per LED: Adafruit: 17/24= $0.70. HyperIon: 7/100= %0.07

Additional Costs:Adafruit: ($4) Shipping, Hyperion: $1 (copper board) + $ 0.50 (Ferric Chloride)(free shipping)

Total: Adafruit: $21, HyperIon: $3.18

As you can see it is far cheaper, 15% the cost. Even if you ignore shipping the HyperIon version comes out to only $3.18, a massive cost savings compared to $17.

Step 2: PCB Design Part One! LED Placement

The first step in creating any NeoPixel shape is the placement of the LEDs. I created a useful little excel document which you can use for any design you want to follow a radius.

Simply input the number of LEDs, percentage of the ring you want covered, and the radius and it automatically generates the position and angle coordinates you should place your LEDs at. You can then go into most popular DipTrace, ExpressPCB, or EaglePCB and insert the coordinates in your components properties. I personally used DipTrace and you can find all my components and libraries in the components section.

For this project I chose to use two rings of radius 34 and 24 millimeters. The outer radius had 20 pixels and the inner radius had 6.

*Bonus* If the CAD program you're using (like DipTrace) doesn't allow for the placement of a circle by its center point draw two lines across the diameter of your outer radius and your inner radius. Align the intersections with each other and redefined that as your origin. Now you have a perfectly concentric board!

Step 3: PCB Design Part Two! Routing and Capacitors

The next step in making your printed circuit board is making your connections between your LEDs. NeoPixels each have one data-input pad and one data-output pad. First create a long chain starting with the pixel closest to where you plan on placing your interface pins, going from one pixel's data-out pin to the next pixel's data-in pin.

After that you'll need to route power and ground. The easiest method I have come up with to do this is to use a combination of circles and semi-circles, four in total, alternating between power and ground as you move outward from the origin. This makes it easy to create a small "jumper" connection as apposed to manually wiring every since LED together, twice. The two pairs of circles/semi-circles can then be tied together whichever way is most convenient. Finally, a copper pour is added. This essentially just causes all extra space to be filled by "ground", which has multiple advantages including being easier to manufacture at home.

You will also want to install one roughly .1uf capacitor between power and ground between each set of two LEDs. The manufacture recommends one per LED however its likely one per two will do and they are time consuming to solder. These are not necessary for the functionality of the device, they simply improve the lifespan of the LEDs, so they can be ignored if needed.

Step 4: Printed Circuit Board Etching!

In order to complete this step you have two options:

Professional Manufacturing:

If you have never made a PCB and have no interest in gaining the skill to do so, this is what I would recommend. By getting your board professionally manufactured the difficulty of this project goes from high intermediate down to beginner. Your board will be guaranteed to be high quality, come with a solder mask, and may even come with a solder stencil.

Homemade PCB:

This is the option for those who really want to improve their skills and enhance their personal capabilities. It is also the option for those into high pace prototyping and who are really cutting the costs low. The ability to make my own PCBs has been one of my biggest advantages over the years and I strongly recommend it to anyone who is interested. I have developed my own method for making PCBs (see my channel for how to do that) which is a little outside the scope of this tutorial and requires equipment most beginners can't afford. Therefore, instead I recommend the toner transfer method using a product named PressN'Peel. It is fairly easy and the only equipment you'll need that not necessarily everyone will have is a cheap laser printer. Check out clacktronics-uk's tutorial for more details!

The basic process is as follows:

  1. Clean your copper cad board.
  2. Print your design onto the Peel n' Stick using a laser printer.
  3. Iron the design from the Peel n' stick onto your copper board
  4. Place the board in ferric chloride until etched.
  5. Clean off the toner

Solder Mask (Optional):

A solder mask is a covering that protects your board in all places but where solder needs to go. This makes it slightly easier to solder but more importantly dramatically improves the ascetics of the board. If you did not get your board manufactured you may want to add one, but its not strictly necessary. Personally I find this process incredibly easy and highly recommend it. Again, I'm only going to go over the basic process so you know what you're getting into. Check out cpeniche's tutorial for more details!

The process is as follows:

  1. Print your boards pad design onto a piece of transparency.
  2. Peel and stick the solder mask film onto your etched board.
  3. Iron/laminate the film until it sticks well.
  4. Align the transparency with the board and tape down.
  5. Expose the film to a UV source (nail polish dryers work)
  6. Clean off the unexposed pads
  7. Expose till cured.

Step 5: Solder Paste Stencil! (OPTIONAL)

If you have access to a laser cutter consider manufacturing yourself a solder paste stencil. They allow you to avoid the tedious effort of slowly putting a dab of solder paste on each individual pin. Simply load the pad design into your laser cutter software and cut it out of a piece of printer transparency. I have also found that a laminator sheet works just as well. This works incredibly well and produces a layer almost exactly as thick as the professional versions. In my opinion they are actually far superior as they are flexible and transparent, making them far easier to use than the stainless steel versions.

I was not the one to come up with this method but I have yet to see anyone document it online, which i find surprising.

Step 6: Board Shaping

To bring the board into its final shape you should begin by cutting off as much as you can safely with a dremel cutoff wheel. I used a dremel workstation setup horizontally with the blade above a cardboard box as a makeshift tabble saw.

You can then begin drilling out the central hole. Use the largest drill big you have for your dremel and slowly "Swiss cheese" your way around until you've cut out a big enough section to fit in a grinding bit. You can then use that grinding bit to bring the board to its final shape.

The way the board etches there is a thin ring of just fiberglass around the edge of the board, Right before you grind to that point the last remaining bit of copper will release. When the last bit of copper releases don't grind anymore. By relying on that sign it allows you to make a very consistent and circular piece (assuming you didn't mess up the etching like i did and put the pattern too close to a wall). Finish the outside diameter this same way.

You should also drill out the holes for the data in, 5v, and ground connections. A small dremel bit (.7mm) works great for this.

Step 7: Soldering!

In my opinion this is a great project for a person who wants to learn how to get into surface mount soldering. All of the important components are large, heat resistant, and the pads are spaced far apart from each other. Its actually very difficult to mess up and is a great way to build confidence in surface mount soldering without having to mess around with teeny tiny components.

In order to solder your NeoPixels onto your board you first need to deposit a teeny, tiny amount of solder paste to each pad using either a syringe or a stencil. If you have a stencil simply spread a blob of solder paste around the stencil like a thin layer of butter on toast until all the pads are covered. You don't need as much as you'd think, just keep spreading.

Next you'll want to place your components on your board. As long as each pad is touching its relevant blob of solder then you are close enough. Solder paste has this magical property where when it turns molten it actually pulls the component into place almost every time.

If you're too insecure about your soldering skills you can either change the 0603 capacitors to a larger format or skip them altogether. They increase the lifespan of the NeoPixel but unless you're using this as a light source its unlikely you will ever see one burn out. That being said I strongly recommend that you install them, simply because the skill is valuable to have.

In terms of actually soldering, it couldn't be easier. Simply spend about two minutes preheating your board with a hot air gun then focus more heavily area by area until everything reflows. You can tell when it has reflown because the solder turns shinny and typically the component does a little "wiggle" into place .

Step 8: Interface and Done!

You are able to interface with this board exactly like you'd interface with a normal NeoPixel product. Start by plugging the power/ground pins of your NeoPixel ring into the 5v/Gnd pins of your chosen microcontroller. Connect the last pin (data) to any digital pin. Then simply download the NeoPixel library, set your number of LEDs (26 in this case), your chosen digital pin, and start programming your animations!

The strandtest example code is a great place to get started. It includes many great examples and effectively demonstrates what NeoPixels are capable of. If you need more details on how to use NeoPixels check out this tutorial: The Magic of NeoPixels.

I hope you all enjoyed this tutorial. If you liked this project you might also like my upcoming DIY Flexible NeoPixel Strip project. Subscribe so you don't miss it!

Please vote for me in the Colors of the Rainbow contest!!

Stay Awesome

-HyperIon

Share

    Recommendations

    • First Time Author

      First Time Author
    • PCB Contest

      PCB Contest
    • Big and Small Contest

      Big and Small Contest

    13 Discussions

    0
    None
    keith726

    Question 5 months ago

    How do the LEDs know the position of each LED in the strand? When you assemble individual LEDs, how do you address each one individually?

    4 more answers
    0
    None
    mero55keith726

    Answer 3 months ago

    Hey!
    Though registers might make sense at first, no where does the code (or even micro-controller) find out the register codes of each LED (or even they're order).
    After googling a bit, I came across the datasheet of the LED itself ws2812. (http://www.world-semi.com/solution/list-4-1.html#1... -- last document at the bottom) and on page 4 of the datasheet it shows that MCU never truly addresses individual LEDs. Instead the MCU sends 24-bits instructions (e.g color, brightness ...) after each other, the first 24 bits are saved/executed by the receiving LED module, and the following 24-bits instructions are passed onto the next LED module which will also save/execute the first 24-bits instruction it receives and then pass on the ones that follow to the LED after it.


    I believe u can keep doing this in a window of atleast 280us before the LED module starts executing the 24-bit instructions it receives rather than passing them on. (This I believe explains why Adafruit mention the time constrain of sending data to long strands of Neopixels + why Neopixels have a relatively low refresh rate.)

    Hope that helps!!

    Capture.PNG
    0
    None
    keith726mero55

    Reply 3 months ago

    Mero55, you are correct (I guess it pays to read the data sheet - duh!). I never heard about this method of transferring data, and it's REALLY cool. Just send out a bunch of 24-bit strings, and the first neopixel ( which had 3 leds) grabs the first 24 bits, then retransmits the string of bits minus the 24 bits that it used. The next neopixel grabs the second set of 24 bits, keeps those 24 bits for its leds, then passes the remaining string of 24-bits down the line to the next leds. This way, you're not addressing pixel 1, 2, or 3 - you're sending as many 24-bit "packages" as you have pixels, and the pixels are wired in series. Each pixel grabs the first 24 bits available to it, keeps those for its own use, then retransmits the REMAINING 24-bit packages down the line to the next pixels. Brilliant!
    In essence, each neopixel has a 24-bit shift register in it, but instead of transferring all the incoming data to its output (typical shift register "overflow"), this device essentially switches the input string of bits to the output (to the next pixel) as soon as its 24-bit register is filled.

    1
    None
    keith726keith726

    Answer 5 months ago

    Hyper_ion,

    That makes perfect sense. I'm very familiar with shift registers, and I think you are correct. I didn't think of that.

    Do you have to input the total number of LEDs in your strand somewhere in the software? That would imply that your reasoning is correct.

    By the way, have you ever tried to get a technical answer from Adafruit? I've had no success - I guess they're too busy to answer thousands of questions from newbies. And their document on using neopixels, while excellent, does not explain HOW each LED is addressed.

    I like their products - I have one neopixel 6" semi-circle that I haven't tried yet. I've wondered how you could make your own strips with individual LEDs and then address each one. I believe that you're correct - shift registers!

    Thank you so much for taking the time to reply.

    Keith726

    1
    None
    Hyper_Ionkeith726

    Answer 5 months ago

    I could be totally wrong, I haven't researched it, but typically when devices work without addresses in series they work like a thing called a shift register.
    Say I have a chain of LEDs that turn on at one and off at zero. (Neopixels are more complex but same idea).
    If I send the command "1" then the first one turns on. If I send "0" then the first one turns on AND it towards the one to the next LED. If I send another zero, the last LED turns on. If I send a third zero, all LEDs turn off and the "1" I sent goes into Oblivion.
    Essentially the LEDs don't have to know that any of their neighbors exist, they just know that when they get a new instruction they should shout their last instruction on data-out. However, you don't have to worry about this. The Neopixel library already handles all of it. Just run two commands. Strip.setPixelcolor("pixel", "color in hex"); and Strip.show();

    Set pixel color just makes the Arduino know what it's about to upload. Like if I wanted the last LED to turn on then set pixel color would change then "planned" state of the third pixel to 1 but would NOT change any other pixels. If it we're planning to output "100" and you said setPixelColor(0,1) then that would change the plan to "101". Strip.show() actually outputs the sequence.

    Let me know if that helped/if something I said was wrong!

    1
    None
    Build_it_Bob

    5 months ago on Step 8

    What an amazing instructable! You are SO creative and talented. It was amazing to watch from start to end. I was very impressed with the entire build. Thank you ever so much for sharing!

    1
    None
    iceng

    5 months ago

    I really like this !

    As a pro full ckt, PCB and Sadw designer I look forward to doing my private stuff differently..

    Thanks for a view into your sweet way of doing boards...

    1 reply
    0
    None
    DeadlyDad

    Question 5 months ago

    Cool project! One thing that occurred to me; would it not be easier to make trapezoidal sections that have placements for the LED's that form a curve? That way, you could cut the necessary pieces out with just a saw, then solder them together, edge to edge.

    1 more answer
    0
    None
    Hyper_IonDeadlyDad

    Answer 5 months ago

    That may be easier for some people! By trapezoidal sections, do you mean like a pizza? I considered at one point splitting it into fours and engraving them somewhat concentrically.

    Personally cutting things with a saw is far harder than grinding/milling with a dremel, so its easier for me to make it as a whole circle. However that's not true for everyone.

    My next project is going to be showing off a "Large Format, Reliable PCB manufacturing method" where I make a single giant 300x200 PCB. Id like to make like two dozen LEDs rings of different sizes, then give them out to people for funzies/patreon. In order to do that I need to find an easy way to cut out concentric rings. Not 100% sure how I'm going to do that right now, but it may end up being something like that.

    0
    None
    MissionCritical

    Tip 5 months ago on Step 6

    you should had applied some tape or some sort of protection film while machining on PCB, but other that that, everything is awesome, and i really would like to try this, thanks for sharing.