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 connected to 12V solenoid valve

Status
Not open for further replies.

prerna123

Newbie level 6
Joined
Sep 7, 2015
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
138
Hi,
I am using PIC16F877A to drive a solenoid valve it switches it on/off as programmed for specified duration. when i simulated on proteus and on PCB with LED connected instead of LOAD, it worked fine. The on/off cycle continues as desired. But when i connect 12VDc solenoid valve , the PIC resets. could you please help me solve this problem? I have diodes across the relay but it does not help.
 

hello


show us all your schematic .. power supply 12V, 5V etc ...
 

Attachments

  • PIC16F877A TIMER BOARD SCHEMATIC.pdf
    20.4 KB · Views: 106

Where is the 5V and 12V power supply and solenoid circuit ? I only see two relays. Add a 10uF electrolytic Capacitor across the VDD and VSS pins of PIC. It should be close to PIC on the PCB.
 

Although you had properly separated 12v bus from pic through a ULN2803 driver, i feel the lack of freewheeling diodes in parallel with the relay coil, as well are missing ceramic capacitors spreaded among such devices in order to decouple induced spikes coming from solenoid.

I already faced to a quite similar issue, and even doing all the tips above, a restart occured due to the tracks of busses 5v and 12v were routed very close on layout PCB. keep in mind that solenoids have extremely high inductance, and generates strong noise around every time current conduction accross it is open.
 

hello

the internal diode of ULN protect the transistor,
you have to power on the relay between Output and +12V
and add a diode accross the coil of relay

Image2.jpg
 

I have used a 22pf across the Vdd and vsspounds of pic should I change to 10uf and try again? I have already used diodes across the relay. In the actual circuit
 

Show the detailed power supply circuit. Add a 0.1 uF Monolithic and 10uF electrolytic accross the VDD and VSS pins of the PIC and they should be close to PIC power pins on the PCB. Add one 0.1uF Ceramic / Monolythic across the Relay coil. You should also have the free-wheeling diode across each relay coil. For better solution post the PCB layout image and provide power supply circuit. How much current relays and solenoids draw when they are all ON. Does your power supply have the ability to provide the required currents for the relays, solenoids and PIC ?

Add free-wheeling diode across solenoid coil. 0.1 Uf 50V also.
 
Last edited:

Hi

I have used a 22pf across the Vdd and vsspounds of pic should I change to 10uf and try again? I have already used diodes across the relay. In the actual circuit

A 22pF is completely wrong. Use a 100nF X7R ceramics at each IC and additionally a 10uF Tantal or electrolytic. You could lower the 100nF to maybe 10nF, and you could increase the 10uF to 100uF. Especially you need short and wide traces to connect the ceramics capacitor to the ICs. Use a solid ground plane.

I don't recommend the capacitor across the coil. If you use it then connect a resistor in series. Maybe 10 ohms. This is to limit the inrush current to the switch in transistor.

Klaus
 

Also it matters how you did the PCB routing - long tracks with loops works as pick up coils for all noises. Pay more attention for the GND tracks - they should be thick and short.

Always remember - one and the same schematic may work or may not work with the relays depend on the PCB routing.

Luben
 

Hi, sorry I mentioned it wrong it's 0.1uf. But after the suggestion I tried using both 0.1 and 10uF but it didn't help. I checked the valve itself takes about 2 amps and my smps is 2A I think I should use higher amp rating.
 

Yes, that why details about power supply was asked. If all the relays are ON and solenoid is turned ON then your power supply was not able to provide the required current to PIC and PIC was resetting. Use a power supply which can provide 5A. Are you using 12V battery ? If your power supply voltage is 18V or 24V then use a LM2576-12.0 to power the relays and solenoid and LM2576-5.0 to power the PIC and other circuits. Also put heatsinks for the buck regulators. These regulators are rated for 3A.
 

Had you gathered on PCB layout the power components within a strict region appart from the rest of digital circuits ? As mentioned before, it sounds likely as an induced current among near routed tracks.
 

Hi,

I have tried everything nothing helps. I hope there is nothing wrong with program? because till switching on/off relay it works fine but as soon as valve is connected it my code runs once without switching on the valve and stops in the end.

i replaced valve with low current coil too, but still the problem persists.
 

Hi,

I have tried everything nothing helps.

Like sometimes suggested.... Show us your layout and wiring diagram. Most probably here we can help you..

Klaus
 

Hi,



Like sometimes suggested.... Show us your layout and wiring diagram. Most probably here we can help you..

Klaus

Hi,

please find attachements
 

Attachments

  • Timer Electrical drawing-Model.pdf
    68.8 KB · Views: 123

Hi,

This is a schematic only, no pcb layout.

Still missing all the suggested improvements.
Do the LEDs have internal current limiting resistors? If not you need external ones.

Klaus
 

i have added resistance of 330 ohm for all the LEDs
 

Attachments

  • PIC16F877A TIMER BOARD SCHEMATIC.pdf
    20.4 KB · Views: 87

Have you added the diode on the solenoid coil itself? It's not enough to add the diodes on the relay, since the kickback frol the solenoid is more powerful.

You say the micro resets when the solenoid pulls? Then I would add a big capacitor over the 12V too, like 470 or even 1000uF. This will reduce the peak current pulse when the solenoid pulls. Depending on the power in use, the 12V may feedback into the regulation of the 5V output, for big pulses.

Does the circuit work ok if you try it without the solenoid connected? Try to replace the solenoid with a 12V LED, to verify.
 

I think the problem is in the code. Just let the code run without solenoid connected. It will only forward bias the transistor driving the solenoid. See if PIC still resets. Put a LED and add 1 sec delay after port initialization and then lit an LED. If PIC resets then LED will turn OFF and then turn ON after 1 sec and you will come to know if PIC resets. Zip and post the complete project (code) files.

You driving solenoid using ULN2803 ? If yes, it will not work. ULN can only sink 500 mA current per channel. Your solenoid draws 2 A current. Use 8A power MOSFET or Darlington transistor of 8 or 12A to drive the solenoid.

Why you don't show the full schematic which includes solenoid circuit ? Zip and post the proteus file also.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top