Programming pattern to mimic the sun

Hi, totally new to Arduino here, have a bunch of WS2812B, and my first board coming tomorrow and I'm trying to program an LED strip around a terrain model to move like the sun, orange and from one side in the morning and wider (to give the effect of the sun higher) and cooler as it moves clockwise throughout the day then back to more directional and warm in evening, seems simple enough syncing the time is where it might get a little tricky, can anyone point me in the right direction on how I might even begin to figure that out?

Paul

Welcome to the forum.

There are a few ways to do that.
You need the time. That can be a RTC module (Real Time Clock) or you can get it from the internet if your board can connect online.
For a test, it is possible to let the Arduino keep track of the time, but then you have to set the time after every restart or upload of the code.
The code can calculate the led and the color, or you can use a table.

A RGBW ledstrip would be better to mimic the sun. Can you give a link to the ledstrip ? How many leds do you want to control ?

1 Like

Also looking for best way to control it/sync/switch between programs because I want to have some other light programs built in, toggle through with a single button is probably ideal, possibly some kind of bluetooth situation but I like the simplicity of a button or two directional buttons

I use this library to predict the suns location in the sky to position solar cells. It may help with determining some factors that may be useful. One way I see the library as useful is to use the length of day calculation as a template for LED behavior.

1 Like

Thanks!

I have some of the neopixel and then this one but definitely more concerned about doing it right than using what I have.

I think on average depending on the particular piece it's around 140-150 pixels. Initial designs I did just with Govee lights off amazon had two separate rows because their controllers wouldn't handle that many LEDs, which actually worked out because I could have two different layers of programs which looks really nice. So now I'm inclined to maybe do two rows of 60/m instead of one row of 120/m

Ooh thanks oh whoa so that doesn't need internet connection to work? That would be wild and perfect. Yeah this would definitely be something sold to customers so I have to make it user friendly all built in

Then I'm thinking about daylight savings and the protection act for 2023 so I might just give it an hour of slop seeing as it's very soft light and it's art so that's probably fine I guess

mmmmm thank you

If your goal is to track the sun, then you don't need to worry about Daylight Saving Time. This is because you don't care what the clocks are doing, you care what the sun is doing, and changes to the time on the clocks do not in any way affect the sun. So, basically, just pretend that Daylight Saving Time doesn't exist, and you're good to go.

Yeah I guess that's super important because summer and winter solstice are so different with the timing. No idea even the first thing to figure out how to translate that into an LED pattern, can anyone guide me to where I'd look for the next step? Ideal world I might just pay someone to do it

Now lets say horizon to horizon is 180 degrees.

Let's say we have 180 leds to represent the degrees.

The sun azimuth could be the brightest and most yellow of colors with the leds on either side fading from yellow to blue sky or some other cht.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.