On Tue, 10 Mar 1998 14:55:27 -0400 Javier Puiggros Vogel writes: >I have a pic16c74A connected to 4 PCB relays (5V) to open valves for = >humidity control, but sometimes the program reset and start again. The >= >reset happen when the solenoid valves turn off. Both the relays and solenoid valves, being inductive, will generate a surge of voltage when turned off. Connecting any heavily inductive or capacitive load directly to a PIC pin is likely to cause trouble. Don't expect the protection diodes in the PIC to carry heavy current and still maintain proper operation. They are intended mostly to prevent permanent damage. Use an external diode arrangement to prevent any voltage higher than Vdd from reaching the PIC. The best way to do it is to use driver transistors for each relay. The base resistors will isolate the PIC fairly well. It may be possible to drive the solenoids directly from the transistors without using relays. The relay power should be drawn from a source other than Vdd (such as the raw input to the regulator). In any case, the relays or solenoids need to have diodes to shunt out any inductive "kickback". Dumping the inductive kickback into the Vdd line can also cause trouble. If the circuit doesn't use a lot of power, the burst of energy from a relay coil can make Vdd jump well above 5V. A large capacitor (1000 uF) from Vdd to ground can limit this voltage rise. Such a capacitor should be standard in any design that's used in a noisy environment anyway. If driving the solenoids via relays, the inductive "kickback" from the solenoids can make the relay contacts arc as they open. The high-frequency energy from this arcing may couple into the PIC and disrupt it. It also is likely to shorten the life of the relay. Either an MOV or a series resistor-capacitor snubbing network can be connected across the solenoid coil or maybe the relay contacts to reduce this problem. Just using a capacitor would make the relay contacts arc as they close. If you still have problems, test without the solenoids connected or energized to see if it's coming from the relay coils or the solenoid coils. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]