Full day Sun simulation

Funny, I was about to put that same image in my response.

I have not found CCT strands with accessible pins, only finding packaged house automation kits.

If the total is divided into segments, only 2 might need to be on at the same time if the sun is wider than 1 pixel. If the strips all have power, the each need a data line on a board pin cause the timing's critical.
With 8 pins, 50 led segments can work, 300 bytes for 2 adjacent.

The sun tracks a semicircle on an inclined plane that takes almost week to move 1 degree up or down, 46 degrees in 365.25 days.

Are you trying to simulate all colors of the sky, or just the sunight itself?
Because the sky itself will provide bluish cool white of up to 10000K, possibly more.
The Sun alone (Sun's direct light) will be from 2000K to about 6000K.

"strands"?
I am sorry, I don't fully understand your sentence here.

Strands of several connected CCTs, similar to WS2812... same size as the 5050.

1 Like

These might be the ones although I can't find a data sheet.
color temperature adjustable LEDs

2 Likes

Further searching describes a driver that seems to be able to control dimming and color temperature simultaneously but I can't figure out how. Meanwell make such a controller.

1 Like

I won’t be doing colors of the sky. The ceiling will be blue.
My plan currently is to use colors during sunrise/sunset at the ends of the two strips. I figure 6 inches or so of orange (I don’t yet have the LEDs as I don’t want to buy the wrong ones) will provide the shadows as if the sun were actually rising on one end of the track.
After a minute or what time I give the sunrise the orange changes to white and a new LED comes on every 2 seconds until all 400 LEDs in each strip are on. Then they’ll turn off one at a time and sunrise will be reversed followed by 12 minutes of darkness.

Instead of turning LEDs on individually, it is the same and easier if you do either PWM or analog control (filtered PWM).
Since you need 400 steps, that means 8 bits will not be enough, so the next step would be a 9- or a 10-bit PWM control.
You COULD use orange, but an orangish white LED would give you a wider spectrum of colors and imitate sunlight better. Just get something around 2000K.
@EmilyJane above has made a great find - a dual-CCT LED strip that might be perfect for you, plus they offer a controller for it, making the job easier.

That's a GREAT find! Almost perfect for the task.

It looked like it would do the job. I'm not sure but I guess you can control both light temperature mixing and dimming using PWM.

I visited the link but didn’t see the perfection. So thanks @EmilyJane!

Will the ESP32 still work for this?

And what is PWM?

I would say literally ANY of the MCUs compatible with Arduino will do the job.
PWM stands for Pulse Width Modulation. Instead of doing linear resistance change to affect current (and thus power), which would waste a lot of energy as heat, fast cycling of power ON and OFF (from hundreds to thousands of cycles per second) while controlling the width of each ON pulse provides a control of AVERAGE power (and thus brightness when applied to LEDs), with a very small waste of energy as heat in the control circuit, since the switching transistor(s) (typically MOSFET) is either ON or OFF, meaning there is either no voltage across it or no current through it, and thus no wasted power (untill currents go over a few amperes).
Your practical solution would be as simple as this (the guy is trying to do exactly the same thing as you, same schematic and same type of LED strip with CoolWhite and WarmWhite pins):
https://www.reddit.com/r/esp32/comments/176n1tn/mosfet_gives_too_little_voltage/
All you need to add to your ESP32 are 2 MOSFETs which can be turned on at less than 3V (low-voltage logic-level MOSFET) and 2 resistors to connect between 2 pins of the MOSFET (I would also add a small value resistor, like 10 ohms, from ESP32 to each MOSFET gate pin, but it's not really necessary in this case).
The MOSFET needs to be a low-voltage logic-level type. I can help you choosing the right one if you need me to.
As for the code, I would need to learn and figure it out for your particular case, although it should be fairly simple, but it would take me a couple days to get there.

1 Like

Will the MOSFET and resistor stuff come with the board or will that need to be ordered separate?
I think I have the lighting sorted but I’m still clueless on this programming part.
I think I’ll go with the ESP32 mentioned above. Where do I get the other stuff that’s been mentioned if it’s not in the ESP32 package?

Also for clarification, if the board has a 600 LED limit, can I do two strands of 500 LEDs programmed to receive the same information?

I apologize for your wait, I had been busy.
Since you have no experience or much understanding what needs to be done, I will help in steps as much as I can:

  1. Buy one warm-white (2200K) and one cold-white (6000) 24V LED strip, like this one: https://www.aliexpress.com/item/32996827567
  2. Buy a 24V 10A power supply like this one: 24V DC 10A 240W Switching Power Supply | ATO.com
    It needs to be 10A because one strip will be using about 3A maximum, and you will have 2 strips running at various power levels, plus a supply needs to be rated for twice as much the power you need to make sure it can keep running longer.
  3. You can buy a dual or tripple channel smart controller like this one https://www.aliexpress.com/item/1005004503637449.html, then use an app to program it. I am not 100% certain it will work for your application, but it seems that it would. Then you wouldn't have to deal with ESP32 and other components and programming.
  4. If you prefer the ESP32 route, which would give you more flexibility but also more difficulty, then after buying the LED strips and power supply, you should:
    a) buy almost any ESP32 board (I prefer ESP32-S because it has built-in PCB antenna AND an antenna connector for an external, usually better antenna);
    b) buy 2 or more resistors of 10k (10 kilo-ohms) from any electronic components store/distributor;
    c) buy 2 or more lov-logic-level MOSFETs which can be controlled directly by the 3.3V ESP32 output, but also withstand more than the supply voltage of 24V. Here is one specific model which would work in your case: GT088N06T Goford Semiconductor | Discrete Semiconductor Products | DigiKey
    d) Once you buy and connect everything, we can then worry about the actual program/code to run your setup. Don't forget about supplying the ESP32 with either 5V or 3.3V - you can use a USB adapter and a USB cable for that.

No need to apologize for the wait, my ceiling isn’t up yet so I have time.

The LEDs recommended by EmilyJane are 12v. I was going to get two of those with separate 10A power supplies as that’s what that website has recommended to me. Unfortunately they weren’t much help beyond powering the LEDs.

You mentioned antenna, are you thinking of controlling this with a remote? I can have the board mounted within reach and press a button. Which is something I keep forgetting to mention… I’m not going to need the program to run every time I turn on the lights. I’m thinking flip the light switch and everything powers up. Start my slot car race and press a button to begin the program.

And I’m not scared to learn a new skill.

Thanks for the guidance so far. Much appreciated.

1 Like

Is it true that you can control the color temperature of the resultant light by just varying the PWM percentages? Is it linear?

Yes, as far as I know. Whether you control LED brightness by constant current or by PWM, it should give a somewhat linear brightness change.
The warm LED CCT determines the lowest temperature point, and the cool/cold white CCT determines the highest, so if you use a 2000K and a 6000K you will be able to adjust the combined CCT between 2000K and 6000K.
It may not look perfect, but should be useful in most cases.
If you turn both colors on at the same time with equal current or pulse width, the resulting CCT should be somewhere in the middle, which is about 4000K.
One thing you should be aware of is that PWM-controlled LED light can show strange effect on cameras because it is a pulsating light which a fast camera shutter can notice and capture.

Okay, that's the way I understand it. Just checking.

1 Like