Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

WS2811 Overall Brightness

Status
Not open for further replies.

Suraj143

Active Member
I want to control the overoll neopixel strip brightness when I turn the preset.
I use a PIC12F683 & doing analog read in potentiometer. When I turn it I get 8 or 16 values (Scalled down the 5V to 8 or 16 values.).

So now I have nice number from 1 to 16 & want to scale down the Strip bytes values (Red Byte, Green Byte, Blue Byte) from these numbers.

Need a small idea on my approach.

Thanks.
 
Hi,

I'm showing some patterns using different colours. Its working nicely.The problem is the brightness is too much for a room.Want to reduce the entire strip brightness while the patterns are running.

It means When I turn the preset the entire strip brightness won't go beyond the preset value.
 
Hi,

I'm showing some patterns using different colours. Its working nicely.The problem is the brightness is too much for a room.Want to reduce the entire strip brightness while the patterns are running.

It means When I turn the preset the entire strip brightness won't go beyond the preset value.

Then simply divide the values sent to each LED by the value read from the A2D, 1 will be maximum brightness, and 16 will be the lowest setting.
 
Ok. What about dividing colours like orange?
Ex: R'11111111', G'00100000',B'00000000'

In above the green byte I can shift only 5 times...!!!.
 
Ok. What about dividing colours like orange?
Ex: R'11111111', G'00100000',B'00000000'

In above the green byte I can shift only 5 times...!!!.


Shifting it 5 times makes it 1/32nd the brightness. Very dim.
Each shift is dividing by 2.
 
Hi yes that's how I did,there is limitations on that.

Yes, there are limits. How dim are you hoping to dim?

Understand that the chip you have is limited to 8-bit color on each channel (r, g, and b). That is, 256 x 256 x 256 "colors" (including shades and tints). Unfortunately, that is only about as good as a common computer monitor. I'm looking forward to hearing about your application and eye acuity that requires dim color rendering better today Han a computer monitor. Please advise.
 
Yes, there are limits. How dim are you hoping to dim?

Understand that the chip you have is limited to 8-bit color on each channel (r, g, and b). That is, 256 x 256 x 256 "colors" (including shades and tints). Unfortunately, that is only about as good as a common computer monitor. I'm looking forward to hearing about your application and eye acuity that requires dim color rendering better today Han a computer monitor. Please advise.

Many thanks,

It seems you also experienced in LED colour formats.If you like you can share your ideas on my thread here.
My target is to make colours & make dim levels on each colours on a compact byte format.I use PIC micros, so it has lesser RAM & the programming space also will be reduced if I use a compact RGB format.
https://www.electro-tech-online.com/threads/rgb-compact-format.155821/
 
Are you storing color image data or creating color patterns? The LED driver chip you are using requires all 24 bits of color to each chip. The chips are addressed as shift registers so the first 24 bits end up as the data for the last driver in the daisy chain.

Unless you are storing image data and that is some efficient format that code can decode, byte might be the most efficient for these chips.
 
The chips are addressed as shift registers so the first 24 bits end up as the data for the last driver in the daisy chain.
I thought this too but the first lot of data goes to the first LED. It's a weird (but clever) protocol.

Mike.
 
I thought this too but the first lot of data goes to the first LED. It's a weird (but clever) protocol.

Mike.

Right, I forgot about that weird "feature".
 
.I use PIC micros, so it has lesser RAM & the programming space also will be reduced if I use a compact RGB format.

It depends VERY much which PIC you choose, there are plenty of PIC's that have more of both than Arduino's.

However, you do really need to choose one with CLC as it makes driving WS2811's faster, easier, and more efficient - as it's done in hardware.
 
Last edited:
If you store your patterns in flash you can use 12 bits per location to store 4 bits for each colour.

Mike.
 
If you store your patterns in flash you can use 12 bits per location to store 4 bits for each colour.

Mike.
That's a very nice idea.Patterns are permanently stored in flash.I only need to read it from flash when I need them.I never deal with flash.
Not sure that I can read a flash byte from 2uS time....!!!!
 
Last edited:
Reading from flash takes 10 instructions so if your running at 8MHz it takes 1.25uS. After reading you can use the movf or swapf instruction to get the nibbles you need without shifting. Note also that flash tables can be any size and be placed anywhere until your flash is full. Unfortunately the 683 hasn't got writable flash so you would have to change chips. The 16F15313 is pin compatible and has 3.5K of flash and it's got a 32MHz internal oscillator.

Mike.
Edit, with that much memory you could just store 24 bit values - using 2 locations.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top