Thanks for the circuit diagram! I still have one question though, how do I connect the AC supply and the = 5V DC supply together? Say I have a 24V transformer, which will drive the load, and I rectify / regulate this to drive the PIC. Where is 'ground' in this case for the rectified/regulated supply and where is ground for the two AC wires = coming out of the transformer? And do I just connect these two grounds = together? Sorry if you've answered this already. (And apologies about my poor = ASCII art!). Are there any connections missing from the below schematic? And = would it work like that? I know the supply is missing some filter/smoothing = caps. 7805 ,----. ,----------. =20 -------)------+-----|~ +|-----|IN G OUT|------ +5V to PIC 24V AC | |RECT| `----+-----' -------)-+----|-----|~ -|----------+------------ GND to PIC | | `----' ` | | ____ | | ------------|____|-------------- Trigger from PIC | _|_/ Rg | V_A | | C| | Solonoid C| | C| | | | +----+ _____ =20 Andr=E9 Miller =09 -----Original Message----- From: pic microcontroller discussion list = [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Spehro Pefhany Sent: 15 March 2004 04:02 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [EE:] Switching 24V AC inductive load with PIC, coupling & protection? At 10:20 AM 3/15/2004 +0200, you wrote: >Say for example I want to attempt driving the triac directly without an >opto-coupler, how would I connect the triac and its AC load to the = driving >pin of the PIC? +5, 24VAC #1 Rg A ___ | ---------+-|___|- | PIC | \_|_ ___ |/ V_A -|___|--| | B Rb |> | | C| | C| Solenoid =3D=3D=3D C| GND | 24VAC #2 1) Make sure no load current gets drawn through the 5V line (tie it together with the 24V line at only one point, and make sure the 24V line goes directly to the triacs) 2) No snubber parts shown, with normal 400V alternistors/snubberless triacs they should not be required @24VDC for commutation but you may wish to add them for EMI reasons. 3) Direct drive with PIC A OR with transistor B. B is more rugged in case the triac gets killed, and you can lower the resistor values to drive more insensitive triacs. Method A will also cause the protection diodes on the PIC to conduct maybe 2mA peak. Of course, using A LOW on the PIC =3D ON, and it's the opposite with B. With a typical alternistor (eg. Q4008) you'll NEED to use circuit B, as the trigger current is 35mA or so. In that case Rg is maybe 100R and Rb can be 1-2K. If you have sensitive gate triacs, you can use direct drive (A) but you'll probably need the snubber. For example, you might use Rg =3D 330R (and no transistor, Rb, of course). for a ~10mA gate current. Note: take care with this if you happen to have an emulator or other expensive equipment hooked up to your prototype. It's best to put 5V-only opto-isolation in there during development in such cases. (and be very anal with the prototype wiring and securing it to the bench etc.). Serial ports can usually take 24VAC, but anything like printer ports (and maybe further into your computer) or ICE-2000 = emulators is vulnerable to complete destruction in case of a momentary short or other lapse of concentration. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: = http://www.trexon.com Embedded software/hardware/analog Info for designers: = http://www.speff.com -- 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#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body