Pages: [1]   Go Down
Author Topic: Day and night ligthing  (Read 789 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Netherlands
Online Online
God Member
*****
Karma: 7
Posts: 642
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 06, 2013, 11:38:47 am by Simpson_Jr » Logged

Texas
Offline Offline
Edison Member
*
Karma: 25
Posts: 1298
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Good luck, Jack

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1228
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 144
Posts: 5336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

Pages: [1]   Go Up
Jump to: