prerna123
Newbie level 6
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.
Hi, the problem comes only when i connect solenoid valve. See this is my connection:
PIC's PIN 18 is connected to ULN2803 pin1 and output from uln2803 pin18 is connected to a relay which takes about 30mA and that relay is used to drive the solenoid valve.
Now, Till this relay part my code works perfectly. But as soon as i connect the valve to relay, it reaches to the last line that im displaying on LCD (i.e "stopped" ) and doesnt do anything.
- - - Updated - - -
What my program dioes is, when i press start button solenoid valve switches on for a few seconds and switches off for some seconds and this continues until i press stop button, for which im using a button on ext interrupt pin of PIC. if i connect LED it shows on off continuously without prob but when i connect valve through relay it stops.