Relays for this kind of service should cost about US$0.50 in any kind of quantity. As a rule of thumb I have found that relays are cheaper and more practical than a Triac and a heat sink whenever the current is more than a couple of amps. However, that rule of thumb is at 120V, and your mileage WILL vary. You can't ask for much simpler drivers than a relay - any 2n2222 or similar NPN transistor will work, for a penny in quantity. Total isolation from input to output, and for loads that don't switch very often, long life, no care about power supply regulation. However Relays get finicky with high repetition, or wet enviroments. And they do have moving parts and do wear out. Anytime your PIC is on the same power supply, even after a regulator, with inductive loads, you need to be careful about glitches and grounding and shielding. If you can isolate your PIC it will be happier. If you set your PIC right on top of a solenoid valve coil, be ready for spooky problems. -- Lawrence Lile Senior Project Engineer Toastmaster, Inc. Division of Salton, Inc. 573-446-5661 voice 573-446-5676 fax "John N. Power" Sent by: pic microcontroller discussion list 03/10/2004 04:19 PM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: Re: ] Switching 24V AC inductive load with PIC, coupling & protection? > From: Andre Miller[SMTP:andre.miller@BLUERIVER.CO.ZA] > Sent: Wednesday, March 10, 2004 9:30 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE:] Switching 24V AC inductive load with PIC, coupling & protection? > Hi, > I want to use a PIC to switch valves used for irrigation (sprinkler system). > These valves use 24AC to switch. > Currently I'm thinking about using a TRIAC to drive them, but I'm not sure > what kind of coupling and protection I would need. Since its quite a low > voltage I need to switch, do I need to use an opto-coupler between the PIC > and the TRIAC? > Can I just use the same 24V AC transformer to drive both the logic and the > load? For example use a diode rectifier on the 24AC, and a 7805 to get 5V > for the logic, and then drive the TRIAC directly? There is no theoretical reason why you can't. The practical considerations are another matter. The construction techniques, grounding, etc. that you use will play an important part in how it works. > I've seen a sample circuit that uses a half-wave rectifier and a zener to > drive the logic circuit which then directly drives the TRIAC, but not sure > how suitable this would be? I don't know enough about TRIAC's to know how to > design such a circuit. Triacs turn off when the current through them goes to zero. This means that there is no inductive "kick" on turn off. There are other factors, though, that will affect the choice of driver. Because main terminal current can continue to flow after the gate drive is turned off, you have to be careful about how the triac is triggered. Suppose that you are using pulse triggering. You trigger the triac 1/4 of a half-cycle after the zero crossing. With a highly inductive load, the current from the previous trigger may still be flowing, causing the trigger to be ignored. The next trigger will find the triac (finally) off, so it turns the triac on. The next trigger after that finds the triac on, so nothing happens. The result is that every other trigger is ignored, causing the dread RECTIFICATION!. And you know what that means: DC in an inductive load blows fuses. One solution is to use level triggering, but this rules out transformers, leaving only optoisolators. This is actually not a bad solution. > Sorry if that's all confusing. What I need is to drive the 24AC valves with > a PIC, using a single 24AC transformer. Perhaps there are other ways of > doing this? I would like the components needed per valve I need to switch to > be as cheap as possible (Triac's cheaper than relays?). > Andre Miller John Power -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu