Hi Bob, Received an error message from the list stating that my reply is too huge (> 40KB) after trying to attach a picture of the Ac Opto Triac Relay board. Hence, resending the message. Thanks so much for your advices, help, tips and links. Colombain, Eisermann, Bob and to those who has provided me with help, many thanks to you guys too. I spotted the potential problem of using mechanical relays as they have limited life-span. Hence, I have purchased a AC Opto Triac relay board (with 4 Triac relays) from www.futurlec.com (I am not related to them). I will hook it up to the final PIC circuit. I will visit all the links as advised while waiting for my AC opto Triac relay board to arrive. By the way, how to count 50/60 Cycle power to have a very accurate time base ? I thought of using a 12V DC transformer to power the AC Opto Triac relay board and reduce the 12V to 5V via 7805 or 78L05 to power the PIC circuit. Thanks, Davis Bob Axtell wrote: techy fellow wrote: >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. > > A mechanical relay will wear out quickly at 8S on/off. I'd use an opto-SCR within a diode bridge to drive the load. Or, the sharp#PR31HD22NSZ. It can handle 1A at 220VAC, a functional replacement for mechanical relays. You must be VERY careful of your PCB layout, to prevent AC from getting into your controller on a moist day; to solve this, you will need to coat the PCB with a plastic spray. I'd use an PIC12F629 to drive all 4 Opto-relays, then use the MCLR\ input as a light sensor input. If you use the sharp optos, their input current load is very low, less than 5Ma (but in practice, 2Ma always worked) so if you stagger the outputs (2 ON, 2 OFF at the same time) you can actually make a transformerless power supply from 220VAC to control it. You can count 50/60 Cycle power to have a very accurate time base. If you use tantalum caps and pot the whole thing, it'll still be working at the next millenium. BASIC sounds good, but you might find that JAL is even easier for this project; JAL is a form of PASCAL. --Bob > >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 > > > > -- Note: Attachments must be sent to attach@engineer.cotse.net, and MAY delay replies to this message. 520-219-2363 -- 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!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist