Go Down

Topic: Day and night ligthing (Read 864 times) previous topic - next topic

Happyhaddock

Hi, new to this forum here and no longer much of an electronics or programming wiz and have never used arduino hardware/software before. (back in the 80's and early 90's when home computing was still new I did as a child, do a lot of work building and maintaining school/Uni networks, used to do some basic programming but things move on and I'm about twenty years out of date)

Basically I'm a professional model maker and use lots of LED lights in my dioramas and the model trade provides lots of cheap PCB's (either ready built or in kit form to solder together) for common lighting effects. However I'm working on a project where I can't buy what I need but suspect something like arduino might be programmable to achieve the results I want.

I need something which over a period of about 30minutes can slowly fade out one large group of "daylight" simulating LED's that illuminate the case of my diorama, and as it does so gradually fades in a second smaller group of "moonlight" LED's ( possibly with a brief transition through a set of orange "sunrise/sunset" simulating LED's. Having done that it can keep endlessly cycling back and forth roughly every 30minutes to give an accelerated day/night cycle of illumination.

My two questions to folk here are

1) is this sort of thing possible with arduino

2)Is simply asking this question an indication that I won't possess the programming skills needed to do so and would need to get somebody else to set up/ build such a control unit for me?

Simpson_Jr

#1
Oct 06, 2013, 06:35 pm Last Edit: Oct 06, 2013, 06:38 pm by Simpson_Jr Reason: 1
Seems like a perfect job for an arduino and if you already have some programming experience, the better !

I don't know which language you've used for programming, but Arduino comes with a good tutorial to learn you the basics.

What you want isn't very difficult, If you follow a few chapters of the tutorial you probably already can build your project.

Personally I hadn't programmed in ages as well nor did I know C or C++ (used by arduino). One of my first projects (as for many people) was a moodlight using a red,green and blue led. Although I didn't program it to simulate night and day (including colorshifts) I probably could have within a few days.

jack wp

Yes, arduino can do what you want (not to hard).
Download the IDE (programming environment), and look at the example sketch, "fade". It shows how to fade a LED from low to high light output.
I think you can do the project, and we will be here to give advice along the way.
Good luck, Jack

PaulRB

Hi H.H.!

Yes, you should go for it with Arduino. You will soon find there's so many more things you can use them for also.

However, I forsee a problem. Arduino's analogWrite () fuction only has 256 levels (on basic Arduino like Uno). This may not be enough for the subtle gradual changes you need over long periods. Also the atmega chip in Arduino can only run perhaps 10 leds unaided. Try it and see what you think. If you need finer control over light levels and drive more leds, I would suggest a chip called TLC5940. Arduino can control this chip to run up to 16 channels with 4000 light levels and can power many more leds. There is an Ardino library that makes using this chip easy.

Paul

fungus


However, I forsee a problem. Arduino's analogWrite () fuction only has 256 levels (on basic Arduino like Uno). This may not be enough for the subtle gradual changes you need over long periods. Also the atmega chip in Arduino can only run perhaps 10 leds unaided. Try it and see what you think. If you need finer control over light levels and drive more leds, I would suggest a chip called TLC5940. Arduino can control this chip to run up to 16 channels with 4000 light levels and can power many more leds. There is an Ardino library that makes using this chip easy.


Two of the Arduino PWM pins can have 16-bit accuracy. This seems ideal if there's only two groups of lights.

analogWrite() won't do it, but it's very simple to write the timer values manually.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up