Led strip divided into a matrix

I have been reading for a few hours and I hope that I can now ask this question properly! I have an oven with 6 burners I would like to place a strip of W2812B LED above the knobs and then put a potentiometer on each knob connected to a Arduino Nano. When I turn on the gas the POTs will send signal to the analog inputs of the nano and change the lights from white to red but only the lights above the dial that's been used. All of the other lights will stay on in the standard white, illuminating the front of the oven in a pleasing way, when the burner is turned off the lights above will go back to the standard white.

I think the way to achieve this is divide the 55 led string into sections that correspond to the locations of the LEDs and have those be controlled by the individual POTs.

My question is- What are the correct terms to search for on this forum to achieve this? Is there some example code that shows a single strand of WS2812Bs with discrete groups of LEDs exhibiting different behaviors based on separate (analog) inputs. The ultimate goal is to have the LEDs get dimmer as the burner flame is decreased and maybe even turn green if the burner isn't lit but the gas is on, however that will come later after I add flame sensors.

The equipment list is -
[LAFVIN Nano V3.0](https://www.amazon.com/gp/product/B07G99NNXL/ref=ppx_yo_dt_b_search_asin_title?
Emakefun Nano Terminal Expansion Adapter Board for Arduino Nano V3.0 AVR

Thank you all, this is my first post
Lastly, I saw something about LED's, LEDs, LEDS Please what is the preferred way of abbreviating more than one Light Emitting Diode! Thanks!

Welcome to your first post.

I don't think there is any real trick to what you want to do, so I don't think there are specific search terms that will help.

A string of W2812B LEDs can be individually addressed in a serial fashion (ie, data is pumped through each led for the whole string). This means that each LED can change in color independently, so grouping the LEDs is really a software thing.

LEDs are generally referenced like an array where led[0] is the first LED and led[54] is the 55th LED, etc. So, for example, if you group by 10 then LEDs 0-9 will be in the first group, 10-19 in the second, etc. More generally using this even division, leds (igroupsize) to (igroupsize)+(groupsize-1) will be the i th group of LEDs (starting with group 0). So I would recommend making things easy for yourself and have 54 LEDs (group of 9 x 6 pots).

To implement what you want, change the color of each group depending on which pot has been set, to a hue that matches the pot setting.

Have you thought of using LED rings round each burner knob. It might look better than just a strip.

Grumpy_ Mike
Great advise thank you. It turns out I'm really lucky and this stove has a very convenient gap and trough just above the knobs. I've tested it and the lighting looks great, as if it was installed at the factory!

I seem to have started a hobby where I fix up my older appliances and make them smarter. It is kinda fun. Here is the old Traulson fridge I did. I added a raspberry pi and multiple thermometers to monitor the temp, I found out that the freezer was not working and then added control from the pi to the compressors. I had one small mishap exactly one year ago today but other than that its been fantastic!

Old analog control and wiring from factory

New wiring

Pi on the intake side of the condenser to keep it cool with fresh air


Added LEDs to the inside of the fridge as well

Do the arrays need to be the same size? I was hoping for something like [0,1,2,3,4] always white, then [5,6,7] changeable to red, and [8,9,10,11,12,13,14] always white. Those are not exact but you get the idea. the 'zones' would be different sizes due to placement on the panel.

Do the arrays need to be the same size?

No, you choose how to split them. Typically you’ll have a single array for the overall strip of LEDs, and you can split that however you wish in your code. So each segment of your LED strip can be anything from one LED to the whole strip; it’s completely under your control. A library such as FastLED will make setup very easy.

In terms of implementation, there are likely dozens of different approaches. A simple, though not very scalable approach might be:

int Burner1StartLed = 0;
int Burner1EndLed = 4;
int Burner2StartLed = 5;
int Burner2EndLed = 7;

And then statically refer to these when identifying each burner.

Perhaps a better approach would be to have an array of arrays:

int BurnerStrips[6][2];
BurnerStrips[0][0] = 0;
BurnerStrips[0][1] = 4;
BurnerStrips[1][0] = 5;
BurnerStrips[1][1] = 7;

Then you can more generically refer to each burner by number 0-5 and then index 0 of the sub-array is the start LED and index 1 is the end LED.

Honestly my C++ is pretty shoddy, so I expect there are cleaner ways of doing it! (Also, if you’re coding for space-efficiency, using an int is a bit wasteful.)

Once you have your start and end LED, setting the LEDs is something along the lines of:

for (int x = startLed; x <= endLed; x++) {
    leds[x] = CRGB::Green;