Hi yel-low,
Now that you are starting to think about your project, we can move on to the next step. This is where you need to make a decision as to how involved you want to get. Would you like to learn something about micro-controllers or do you just want to build your moonlight simulator ? Going from your last message, it seems as though you wouldn't mind learning a bit, so I will assume this is the path you are prepared to take.
At this point you need to decide how deep do you want to go. If you want to keep it all pretty superficial you could look into things like the Basic Stamp modules and the like. There are a few of these things available using different microcontroller architechtures. Some people think that these can form a introduction to electronics and microcontrollers, whereas others think they lead to brain-dead people who think they are learning stuff. I'll be upfront here and tell you that I would be in the later category.
If you can solder or are prepared to learn how to solder, then there is nothing like jumping in at the deep end. You'll either learn to swim or you will sink real quick
Then it comes down to selecting a way to jump in and which side of the pool you will jump from. One way would be on the side of the Atmel AVR and anotehr would be the PIC from Microchip. Both are fine microcontroller families with a wide selection of parts which can do different things. I have done quite a few commercial products in the past with PICs and am currently evaluating the AVR for use in my current project.
If you decide to follow this path you are going to need a way to program your microcontroller and develop the code. The lowest cost path would see you simply buy or build a device programmer and there seem to be quite a few hobby designs for both familes that you can find on the net and build for under US$40- which have programming software freely available. A quick search on Google will help you locate some of these.
This methodology will require what I term a "code-test-crash-burn" method of software development, which isn't really optimal, but it does work. Basically what you will end up doing is writing the program which gets burnt into the micro, compile it, program the device, then run it and see what it does. When things go wrong you will need to work out where in your program the problem is and this can be the hard part. To do this, you will usually use tricks like flash a LED at certain parts of the program, or flash the LED if the program starts to go down a certain branch. That sort of thing. Debugging programs this way can be a challenge in itself and sometimes you will need to devise creative ways of working out what your program is doing inside the micro. It can be frustrating, but it can also be fun.
Another method is to use an in-circuit emulator ( ICE ) which can be quite costly by comparison, yet it can really help in debugging and the entire development process can be a whole lot easier. Basically, an ICE is a special version of the microcontroller which is surrounded by other circuitry which mimics the microcontroller in a real-world device. You plug the ICE into the circuit instead of the microcontroller and the ICE does exactly what the micro would. Except that you can use tools to step through your program while it is executing, set break-points and use a host of other little tricks to quickly and easily determine exactly what is going on inside the micro and your program. The cost of an ICE can be anywhere from a few hundred dollars to a few thousand. Once again, there are a plethora of options available in this area and Google can get you looking in the right area, but I suggest you lurk in device specific forums for both the microcontrollers and development tools before buying any of these as they can have their own quirks and limitations which are handy to know about before you jump in.
Myself, I prefer to use ICE tools, but this isn't a hobby for me and sometimes I still need to rely on code-test-crash-burn as even ICE tools have limitations.
As a person just starting out, you should probably be looking at a simple programmer device which won't cost you much and will let you get started quickly and easily. I have just had a look at a site hosted by Nigel Goodwin who is a regular contributor here. His site is located
**broken link removed** and it really does contain everything you will need.
Not only does Nigel give you the software to program your PIC devices, he steers you in some directions which will allow you to build your own programmer cheaply and easily. His site also has some very good tutorials which will teach you a little about programming and electronics. These tutorials actually contain every element you would need to build your device.
He has circuits and software to drive an LCD, scan a keypad, talk to a real-time-clock chip, use the PWM facilities of the PIC, and pretty much everything else you will need. All that would be required would be for you to work through Nigels tutorials and then put it all together at the end. In short, he has your moonlight controller in what might be termed "kit form" and it is all sitting there waiting for you.
To answer one of your questions from your previous message; I would just code the clock-calendar in software and then work out the day of the month and set the moonlight level accordingly. For the small variation of 28-29-30-31 days, I don't think the fish would notice that we jumped from day 28 to day 1, or slipped in an extra day once in a while
You could use Nigels I2C clock-calendar chip and do the same thing. If it is day 15, then you apply the PWM required to get the desired level of illumination. On day X you simply apply the Y value of illumination. By the time you finish Nigels tutorials, you will know how to do this.
For someone who wants to get started in this area, Nigels site is a real goldmine.