You have some options. You really want a to know whether it is day or night right ? And then turn on / off some switches. You can use the comparators in the 16F628 or 16F877A The 16F877A has the advantage of A/D I understand what you are doing, do you need code ? do you have a programmer ? Do you have MPLAB ? Have you programmed 16F628 / 16F877A before ? -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of techy fellow Sent: Thursday, 6 January 2005 12:43 AM To: Microcontroller discussion list - Public. Subject: [PIC]: HELP REQUIRED FROM NEWBIE Hi Andrew, Sorry for not being clear. I am working on a project using a PIC (16F877 or 16F628 ) or even AVR (90S2313, 90S8515) to control 4 relays (2 pairs); on and off for say, 8 seconds interval for 24/7. Powerheads (fish tank type) operating at 220v will be attached to the relays. During the day, when the fish tank lights are on, I want the on/ off interval to be 8 seconds. During the night when the lights are off, I want the on/ off interval to be 4 seconds. Thus, I think of using a light sensor as an input logic so as to use different interval routines within the PIC. As I am totally new to MCU and electronics hence, if I can get hold of a project that is as close to my requirement as possible, that will greatly help. The only plus I have is, I have some BASIC programming background. Hopefully, I can pick up quickly on modifying the source code to suit my needs. Thanks in advance for the help. cheers, Andrew Rich wrote: Here is the flow 1. Get the datasheet 2. Download MPLAB 7.0 3. Use MPLAB to simulate, syntax check and create the HEX file used for programming 4. I use a PIC programmer that hangs of the serial port 5. Surf the web for little examples i started out turning lights on and off What specifically do you need to know ? Ask lost of questions -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --------------------------------- Do you Yahoo!? All your favorites on one personal page  Try My Yahoo! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist