Disclaimer and Social

This page may contain affiliate links. As an Amazon Associate I earn from qualifying purchases.

Showing posts with label rgb. Show all posts
Showing posts with label rgb. Show all posts

Monday, July 16, 2018

Color-Wheel for HSB and NeoPixels

Here is a helpful color-wheel for using NeoPixels with the HSB color mode. I had to make a printable version when I switched from the RGB to HSB mode and thought I would share it here. I go into more detail on my Instructable for a visual tone piano.

HSB stands for HUE---SATURATION---BRILLIANCE and is just another way to represent the colors for NeoPixel code. I have used the RGB (red, green, blue) mode for so long the HSB mode threw me for a loop until I drew myself a picture of how it works.

I would have probably never used HSB unless Adafruit's amazing Circuit Playground board started using HSB as its beginner-friendly color mode. Now, Microsoft's MakeCode visual programming platform also offers HSB as an alternative to RGB. So I had to learn it.



HSB vs RGB color wheel space mode for Arduino Circuit Playground NeoPixels
Here's a helpful color-wheel showing how the HSB color space mode works with NeoPixels. The image also shows the basic code used to set the color on Adafruit's wonderful Circuit Playground Arduino board.


I have used RGB, CMYK and even LAB color spaces in Photoshop and Illustrator, but had always avoided HSB for some reason. So I originally felt that HSB didn't give me the precise control I was used to. However, after using it for a while I have come to like it.

Being able to set a basic color with a single number, and modify its intensity with a second (and third) number is a quick and slick method. I might not be able to get the perfect sick-acid-green or a eye-popping-pink-gold with a single color number, but honestly, I don't need to for most of my applications. The 256 mixtures of primary color duos gives me enough choices for most basic applications. And it's certainly simpler for beginners.


HSB neopixel color in Makecode for Circuit Playground
The free MakeCode online programming environment lets you play with HSB color mode. The model (upper left) shows the result of changing the values. It's a great way to try switching from RGB to HSB without even owning a board.

I was so used to mixing color in RGB and CMYK modes that I thought it was simple. Then I watched some new users struggle to make the color they wanted. It was painful just to watch and I remembered how confusing and complicated it really is. Suddenly, the HSB mode made perfect sense to use as the default color mode.

Basically, the HSB model mixes from:
  • pure red, 
  • adds some green to make yellow, 
  • then subtracts red to get pure green,
  • adds some blue to get blue-green,
  • subtracts green to get pure blue,
  • adds red to get purple,
  • and subtracts blue to return to pure red
The result is 256 hues and that's enough for most NeoPixel projects. The MakeCode environment exposes all three elemnts of HSB, so its a great way to quickly learn how to manipulate colors and intensity - you don't even need an Arduino, just used to online model and play with the values in code.


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

Monday, May 22, 2017

Glowing Pendant - First Enamel Experiment


Trying to create a pendant necklace that glows during the day as well as at night. Finally found some basic techniques that work with my 3d printer and regular filament. It's far from perfect, but the first, quickly printed piece looks good enough that I will continue to experiment and refine the idea.

This is what the pendant looks like during the day. The NeoPixels light up the thinner areas quite well and show up even in bright, outdoor light. The "stringing" doesn't show up as much in real life, but it is present. I printed this at high speed with a thick layer height. If I print a more hi-rez version the stripes should be a lot less noticeable.


This first piece has a lot of experiments built in: How does thickness affect the amount of light transmitted, how does thinning the front, back or both affect the look, can I "trap" the light in the thinned areas, and how do two lights show up within one thinned recess?


I learned a lot on this first iteration. I won't bore you with the details, but I will note that the difference between a nice glow, a stringy mess and nearly opaque can be a matter of 0.01 mm. That's a pretty tight tolerance.

As you can see below, even at night, the thicker areas block the light quickly.

I will need to try out other filaments to see if they give me more latitude in thicknesses while maintaining the diffuse look.

Glowing pendant with Adafruit Circuit Playground inside a E-sun PLA cover
And here is what the pendant looks like at night with the LEDs at full strength. I think it's pretty, but you can also dim the lights easily. And since these LEDs are on board the Circuit Playground board, you could also get the lights to react to sound, movement, heat or just randomly.

You might have noticed the curving incised lines. They are very deeply cut, so they transmit more of the light. I wanted to see what they looked like. I had hoped they would create a gradient as they carried the colored light from multiple LEDs. It kind of works.

But there was also a second reason for them. I wanted to try embedding wire in them, then pour enamel paint (okay, cheap nail polish - same thing) in between the wires like a cheap, faux cloisonné.


I did a first, tentative experiment with the nail polish. I selected different colors, styles and brands to see how they affected the light. I did not select the colors for a pleasing composition - and boy, did it turn out ugly in the daylight.

But the nail polish does affect the quality of the transmitted light. Once again, the results didn't adhere to my predictions. Chalky does not block more light and sparkly daylight posihs does not sparkle at night, even when lit.

This shows the pendant at night after I added some enamel paint (aka nail polish). It does affect the colors and somewhat smooth's out the stripes. Some colors and thickness kills a lot of the light, so I will have to learn which brands of nail polish work for this project. Even though it's the dimmest area, the red dot at the lower left is closest to the affect I wanted to achieve.

The thickness of the nail polish does affect how much light gets through. But I was happy to see that almost all the paint can be applied thickly with no significant negative affects. That's great, because I really want to just pour the paint into the recesses and not have to struggle to get an even coat with a brush.

All in all, I'm very happy with this first try. Expect to see more about this technique in the near future.

I used the Circuit Playground board from Adafruit - get  it at Amazon.


Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE




Saturday, May 13, 2017

Throwing Light #3 - Masks and Gobos


Now that I know some basic ways to "throw" light (see Part 1 and Part 2 of the series), I wanted to explore how to shape the rays into specific patterns. To find out, I printed a quick (and sloppy) series of masks to test how they affected the shape and quality of light.

Like the previous experiments, I used the Circuit Playground board from Adafruit. I used the larger, deeper version of the 3D printed medallion I created in Part 2. The masks fit over the front of the openings in the light channels. I did not realize how much light would leak out from around the masks (as you can see in the photos) but the masks are enough to test some basic techniques.


The version of the medallion with a reflective interior (at right in the photo above) was not affected by the masks; it's almost useless. But the masks do have a pronounced affect on the raw black PLA version at the left.


The 3D printed set of masks (in red) sits under Circuit Playground board. The Medallion slips over the top of this assembly.
Surprises and Successes

I have played with masks and gobos for photography and stage lighting, so I sort of knew what to expect from the different shape. But the sizes and distances are so much smaller here that I expected some slight differences.

Most of the masks gave the expected results, but there were a few surprises:




The biggest surprise came with the "posts" mask. I printed one set of 1x1mm posts and a second set that was also 1mm wide but 4mm deep. I expected the deeper posts to cast the stronger shadow like it does in a large scale mask. Instead, the skinny 1x1 posts yielded the more precise shadows. I think this might be because of the small scale. The sides of the larger posts may reflect so much light that the shadow gets diffused from all the scattered light.

I was also hoping that the masks might be strong enough to shape the light from the reflectively painted version of the medallion. Unfortunately, the scattering overpowered the masks and there was negligible shaping from the masks.

SURPRISE!!! The skinny 1x1 posts actually created a stronger shadow that the deeper posts. I think the sides of the deep posts reflect and scatter too much light and negate the mask's shadow making. This is true even with the reflective version.

Bigger is better - sometimes. I wanted to see if a pinhole was large enough to create a visible ray -it was NOT!!! However, the larger round hole did emit a slightly shaped ray.


The vertical slot worked as expected, The diagonal slot worked sort of like I expected (a slight gradient) but it is the only shape that actually worked better with the reflective interior (see comparison photo above)

Aha, these worked exactly as expected. The "high slot" caused the beam to appear at a distance from the opening of the light channel.


Be sure to check out Part 1 and Part 2 of the series

Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE





Friday, March 17, 2017

Throwing Light #2 - Channel Size & Angled Reflector


Learned a lot about the basics of throwing and controlling light from NeoPixels in Part-1 of this series. But I wasn't getting the amount of light I wanted, probably because I was using a 3v board instead of a 5v - the LEDs are simply not as bright as I'm used to.

I decided to see if bigger "channels" would allow more light to be output, and whether adding a 45 degree "reflector" over the NeoPixels would help project more light.

The answer to both questions is YES: larger light channels do help, and an angled reflector helps (especially when silvered). And painting the channel with silver paint makes a huge differences at both sizes.



The design of the medallion remains essentially the same except for the increased depth of the channels.


Do Bigger Channels Make Brighter Light Rays

Yes, more light escapes from bigger channels. But to make a noticeable difference, I had to make the much larger. So much larger that it makes the pendant slightly bulky, almost 8mm total thickness. And, it is so large I could now put a strip of NeoPixels "on edge" and project the light directly down the channel instead of bouncing it 90 degrees.

To test, I printed the thinnest pendant I could, with the channel's top only about 1mm above the face of the LED. Then I printed another one with roof about 4mm above the NeoPixel. You can see the results below.

With the raw black PLA the difference is noticeable, but not extreme (blue light). The difference is much more pronounced when the interior of the channels is painted with silver paint (shown in red at bottom of page)


A comparison of the amount of light coming out of a 1x4mm channel (top) and a larger 4x4mm channel (bottom). Notice that there is a distinct difference in the amount of light emitted from the two channels. This is the raw black PLA print. Even more light is emitted when the interior of the channel is painted with reflective paint.

Do Angled Reflector Surfaces Really Work
Yes, especially if the reflector-panel is painted with silver paint. The raw black PLA does reflect some additional light from the angled surface (blue image). But if the angled surface is painted silver, then the effect is much more pronounced. Unfortunately, the silver also scatters the light in all direction, making the "ray" shape less pronounced.

I wonder if only painting the angled surface, but not the rest of the channel would be "the best of both worlds" - bouncing more light, but scattering it less. Or maybe a tiny mosaic mirror would be ideal for reflecting and directing light. But as noted, at this thickness, the NeoPixels could be mounted vertically, negating the need for any reflector altogether.

An angled surface (shown at right above) was added to one half of the medallion. I wanted to see if the angled surface would reflect more light from the LEDs (shown as the red boxes).

Even the raw black PLA shoes a small increase in the amount of light when using an angled surface.


When the interior surfaces of the channels are painted silver, the
amount of light reflected off the angled surfaces increases dramatically.



Next, in Part 3, I experiment with gobos and patterns to throw shapes with the light rays


Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE

Saturday, March 4, 2017

Throwing Light #1

How to Throw and Channel Light with 3D Prints

Part 1 - Part 2 - Part 3 

I am learning how to sculpt light using 3D printed shapes, but understanding how to create specific effects is sometimes difficult. I can't always predict what is going to happen. So I started doing methodical experiments to find out what affects light's behavior, and more specifically, how I can control light to achieve the effects reliably. This post documents one of a series of ongoing experiments.

Notice how the right-side is brighter, but the light is more scattered. The left side has much more defined "rays" but isn't as bright. Also notice how some of the colors get absorbed (are dimmer) on the left side.

Questions I wanted to explore:
  • How does the type 3D material affect the light?
  • Does a reflective surface increase distance and brightness?
  • How far can I throw the light?
  • How does the shape, length or size of the channel affect the light?
  • Does the shape, length etc. affect how quickly the light cone expands
  • Can I shape the light with gobos, masks and cut-outs?
  • Can I throw light sideways as well as forwards?

Right now, I'm back on a jewelry making kick - embedding lights and sensors into decorative wearables. So I used jewelry-based designs to explore these questions. I wanted to move beyond a simple glowing or twinkling effect - I wanted to be able to cast shaped rays of light.

My new favorite toy for illuminating jewelry is the "Circuit Playground" board from Adafruit - it's the board used in this experiment. This little board comes with 10 Neopixels, plus built-in buttons and sensors. How about a 3-axis motion sensor, a light, color sensor, temperature sensor and a built-in microphone and speaker, all on one slim convenient board. (An even more powerful M0-based board is now available)



I designed a simple cover to fit over the top of the Circuit Playground board. There are square "channels" that fit over the NeoPixels and reflect the light out to the side of the medallion cover. The channels ranged from about 12mm to 20mm in length and about 4mm in width (the LEDs are 3.5). The top of the channel is about 2mm above the surface of the LED and 3mm total height.

For this experiment I wanted to throw light out of the side of a medallion, but not the front. I had already played with non-opaque and semi-translucent materials to create glowing objects. So I used black, standard PLA from Hatchbox. It is slightly shiny when printed and totally opaque to light at thicknesses over 0.7mm.

I painted half of the medallion's inside surface with "metallic silver" paint and left the other half raw black PLA. I also scuffed some of the raw PLA channels to see if a matte finish made a difference in the amount of light transmitted.





 What I Discovered in The First Test
  • YES - The choice of 3D printing material does affect the quality of light. The PLA seems to absorb some colors while leaving other colors unchanged.
  • YES - The shiny, printed PLA does reflect some of the light. Sanding the surface to a matte finish does have an affect on the amount of light that is emitted, but it is a minimal difference.
  • YES - Painting the inside of the light-channel with silver or white paint increases the amount of light emitted - increases it significantly. It also increases the distance the light travels away from the medallion.
  • HOWEVER - The reflectively painted channels also disperse the light much more quickly. This causes the "rays" to be much less defined. The light scatters so quickly that the ray-effect is lost after only a few millimeters.
  • AND - The silver/white paint has almost no affect on the color rendition of the light
  • NO - The length of the channel did not seem to affect the amount of light emitted. But the variance of 8mm between shortest and longest channel might not be enough to give a true indication. Without a channel the LEDs simply glow and do not create a ray. And longer channels may affect the amount of light more significantly.
  • ADJACENT SURFACES - The surface that the light gets projected onto can affect the appearance of the rays. Dark materials and matte surfaces create shorter visible rays. Light surfaces and reflective surfaces create much longer rays.
  • VERTICAL SURFACES - Although a parallel surface stops showing significant amounts of light after a few millimeters, a surface perpendicular to the light can be illuminated when it's several feet away.
  • BEHIND THE MEDALLION - The light rays expand in all directions, so the rays can also illuminate surfaces that are behind the medallion. This effect increases with the distance from the "mouth" of the light channel. So if the medallion is set an inch away from the wall, the rays will only begin shining on the wall surface after they travel several millimeters away from the medallion.
  • ALSO NOTE: The 3v Circuit Playground board does not put out nearly as much light as a 5v board. The LEDs are still blindingly bright, but the 3v version does not cast the light nearly as far as my older 5v experiments.




Future Experiments
  • Does the height of the light channel affect the distance the light rays travel?
  • Does an angled surface near the LED affect the amount or quality of light emitted? 
  • Can the channel surfaces be painted "selectively" to increase the amount of light while keeping the light more tightly focused and avoid scattering?
  • Does "reflective safety" paint act differently than "metallic silver" paint used here.
  • How well do gobos, masks and grills work to create shapes within the light rays.
  • Do these findings hold true for LEDs placed parallel to the light channels instead of perpendicular like in this experiment?
  • What are the minimum and maximum lengths of the light channels for specific effects?
More experimentation: Part 2 - Part 3 


Also find me on:
FACEBOOK -or- INSTRUCTABLES -or- YOUTUBE


As an Amazon Associate I earn from qualifying purchases.
Shop through our Amazon links to help support this site.

Also find me on:

Saturday, February 18, 2017

Diffusing Experiment




Played with some diffuser shields for NeoPixels using cheap E-sun PLA filament. I printed out copies of designs I had printed with Shapeways' Strong-and-Flexible materials. I wanted to compare the results. The PLA seemed very opaque and I thought it might block too much light, but I really liked the results

There is a difference between the two materials, but it doesn't show up very well in the photos. With a 1.0mm thickness, the S&F looked "grainy" - similar to Photoshop's add-gaussian-noise filter. The PLA was striated or slightly striped. Neither is noticeable from more than a few inches away however. A quick sanding on the PLA print's top layer would probably eliminate the stranding.

The PLA did seem to reduce the amount of light a little more, but it diffused the light more. Neither material significantly affected the colors. I probably wouldn't trust either to set my white balance, but for a rainbow light show with NeoPixels both materials work great.

Here's the case design. It uses a first generation Trinket from Adafruit, a 12 pixel ring and a potentiometer to change effects.




A pic with the cover on the case. This uses the Strong-and-Flexible material from Shapeways.


A close-up of the S&F material - notice the grain.


And a close-up using the cheap PLA. The camera grain almost hides the banding from the FDM printing process.


Overall, I'm very happy with the cheap PLA as a diffuser material. I will play around with other brands of PLA soon, and I understand some are much more translucent than the basic E-sun.