Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC Resets when soleniod switches

Status
Not open for further replies.

amrstaha

Full Member level 2
Joined
Aug 29, 2005
Messages
136
Helped
8
Reputation
16
Reaction score
2
Trophy points
1,298
Location
Egypt
Activity points
2,312
I'm using PIC16F876 in a circuit that turns ON/OFF a solenoid valve. The valve coil works with 220V AC. I use a relay between the microcontroller and the solenoid valve. Eventually, when the valve switches, the microcontrollers resets. Coud you help me solve this problem?

Thank you in advance.
 

Some more info regarding the circuit, please. A schematic if possible...
How do you connect the relay to the PIC? Directly or via a transistor?
Data on the relay?
Code for the PIC?
etc etc...

/Booter
 

Kickback from the solenoid winding generates a spike, which causes the PIC to reset. If this were a DC solenoid, I would suggest adding a catch diode in parallel with the winding. But you have an AC solenoid, and the simple diode wil not work - it will rectify the coil voltage. I have never dealt with AC solenoids, although a couple of things come to mind:

- Snubber circuit
- Transient voltage suppressor (TVS)
- Finally, you can optoisolate the solenoid from the PIC. This solution is almost guaranteed to work, but it requires more hardware.
 

I don't think the PIC is reset by the solenoid .. It looks like the relay causes this problem ..
Try to connect RF choke to the relay's supply side, a 100nF cap right next to the PIC and a protection diode ( this is a must!!!) in parallel with the relay's coil .. as per attached picture ..

Regards,
IanP
 

IanP said:
...and a protection diode ( this is a must!!!) in parallel with the relay's coil .. as per attached picture ..
In the circuit you are showing, the coil is driven with DC voltage, and our friend's coil is driven with AC. The shown diode will rectify the AC voltage. Do you think, that the "simple" silicon diode is still a good idea?
 

I'm using PIC16F876 in a circuit that turns ON/OFF a solenoid valve. The valve coil works with 220V AC. I use a relay between the microcontroller and the solenoid valve.

Regards,
IanP
 

IanP said:
I'm using PIC16F876 in a circuit that turns ON/OFF a solenoid valve. The valve coil works with 220V AC. I use a relay between the microcontroller and the solenoid valve.

Regards,
IanP
I see, I've missed the relay. You're right then, the diode should do the trick.
 

I think you should first determine what resets the circuit, the relay or something else? The first step is to run the circuit with the relay, but without the valve. If the micro does reset, you know it is the relay. If not, it is the valve.
 

Hi,

Put 102pf Ceramic Capacitor between Reset pin and ground and Enjoy.

Confirm me for Result .... mas_mdk@hotmail.com

Have a nice day:D
 

AmirSaleem said:
Put 102pf Ceramic Capacitor between Reset pin and ground and Enjoy.
Actually, Microchip advises not a to put a capacitor between MCLR and GND. Although, if you are still going to put a cap there, add a reverse-biased diode between MCLR and GND so that capacitor could discharge, when the powe is turned off.
 

HI, Place a zener diode of 5.6 Volts across the PIC VCC and GND together with a capacitor of 100nF. Also connect your MCLR pin direct to VCC or through a resistor of 10K and then use a diode from MCLR to VCC, Cathode of diode to VCC.

Paul.
 

See this Guidelines for Selecting Contact Protection Circuits.


https://www.relaycenter.com/cgi-bin/guide.pl?sesid=E3358790757X1422&SNAME=&SMAN=Select+manufacturer



This article show you the problems that arise with switching to a reactive load(voltage pulse, current pulse respectively for inductor to ground, capacitor to ground)
https://www.aemc.com/techinfo/appnotes/clamp_on_meters/App_Clamp-OnMeters_InrushCurrent.pdf



Analytical expression of the problem
**broken link removed**



Cheap solution to solve in-rush currents
**broken link removed**


Merit for Thanksgiving?
 

I think u can add a optocoupler between the PIC and the solenoid. This will prevent the PIC to reset.
 

Use another PIC wich has master clear disable capability is easier than making noise filters.!!
I faced such a problem in 16F84A and finally migrated the code to 16F628A and the problem solved.
Snubber network is another solution. but can't guarentee 100%!!!
 

It may be due to the high voltage the solenoid is handling.
You have to use noise reducing filters in your power supply.

Bye
 

I wrote on 10/07/2006 that connect a 102 pf capacitor with MCLR AND GND,

Sorry for mistake,

Connect 102 pf capacitor between MCLR AND Vcc With a reverse biased diod.
It is sure that problem will be solved. I also had same problem and get rid of by this network.

Also try to use low logic to operate relay with pnp transistor instead of PnP and with positive logic.

Thanks and reply.
 

hi amrstaha,

add a zero cross detector to your circuit.
turn on the relay switch only at the zero crossing point of the ac.
it not only can minimize the EMI but it also prolong the life of the relay.

you can find some information of zero cross detector from atmel.

good luck
 

this is a problem of emi /emc. Chekc the following and you may have a solution:
1. is your crystal properly grounded? if not, make it horizontal and ground the body.
2. have you implemented the MCLR circuit as recommended in the datasheet. If your controller supports internal MCLR, use internal. it is more stable in EMI problems.
3. put a free wheeling diode on the solenoid switch.
4. make sure you have placed the decoupling capacitos close to the controller. use a decap and 10uf cap parallel to it.
5. are you using a general purpose baord with lot of wires??? the wires are possibly picking up the EMI. if none of the above work use a printed circuit board or omit as mcuh of wire as possible. wire works as an antenna for EMI!

if this does not solve your probelm, email me at bahl@terronmicrosysyems.com

wish you all the best!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top