problem with pic circuit

Thread Starter

kyu9971

Joined Mar 28, 2015
90
hi everyone,
i have an problem with an circuit based on pic18f2550.
the circuit purpose is supply an water pump when the voltage of battery reaches the value of 13,5 volt and remain on for 10 minutes.
while on the bench is ok (i have simulated the pump with a led), when i connect the circuit to the pump and the voltage reaches the fix value (13,5), the pic gone reset.
the 12 volts battery is recharged with an fotovoltaic modul while the pump have a power of 30 wh /12 v.
anybody can suggest me an way for solve this problem.
thank you so much everyone
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
Do you have a proper pull up for the MCLR?
Also you may not have suitable decoupling and if a uni-directional pump you could fit a BEMF diode, how are you switching the pump?
Max.
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
the pump is connected to the via an relais 12v and between it and the pic there is an npn transistor.can be the problem caused from the pump that is an inductive load?and as i can solve this?
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i am doing some test and i could see that if i connect the pump after the swithing of relais, the pic not reset, while it is reset when the pump is connect before the switching.
on the relais coil i have mounted ad 1n4148.
the supply is common for pump and pic.
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i measured the voltage between the pin 1 for supply the pic and ground ,when is reset and it is 5,07 v, it not drop. for supply the pic i used an voltage regulator lm7805 connected as its datasheet
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i doing other test. i replaced the pump with an 10w led light with it, is reset always, also if i attach the bulb after the switching relay.for moment i doing test with the battery (12v/12Ah) and i modified the code into the pic so as get the switching at 12,3v.in this moment the battery measured 12,7v, but the led light it is just a flash.
practically i turn on the circuit, the relais do "tic" the ligth it is just a flash and the pic is reset.
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i separated the supply with 2 battery.one for pic and one for pump . now is ok and the pic not reset more, but as can do for supply with only one battery?
 

ErnieM

Joined Apr 24, 2011
8,377
To really be helpful a schematic of your work will go a long way.

And if it is not too much to ask take a decent picture of your build.
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i attached two picture of my job, but for diagram i have only the schematic on paper
drawn manually and it is not very clean . i hope that with the picture can you have an idea of situation . anyway the circuit work ok only without load in output. if i connect the pump or an led light 10 w the pic is reset when relais switching on.
I hope I explained correctly
 

Attachments

Picbuster

Joined Dec 2, 2013
1,047
i separated the supply with 2 battery.one for pic and one for pump . now is ok and the pic not reset more, but as can do for supply with only one battery?
You are facing a power dip as result of switching the motor on.( internal motor resistance low so current high)
To solve this:
Split motor circuit from pic.
Couple the pic via a diode resistor of 50ohm and a 1000uF capacitor.
two +V wires running from your battery one to the motor
The other +V one via 50 Ohm and diode to +1000uf minus to PIC gnd the +1000uF goes to the input of the 5V lm7805.
( the cap 1000uF will act as a battery) and diode will stop Vbatt go low as motor start.
The relay coil should be fed directly via +Vbatt.
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i see schematic that you have posted, and i found many differents from my schematic .
i not never used the schottky diode and ask to you if possibile use that in picture .
for supply the pump i used only one contact of relais (positive) while the negative is connected directly to ground .
the relais is drived with an npn transistor "c945" but you speak of mosfet , what type?
for supply i used an lm340t05 (7805) with two disc capacitors from 10000pf (maybe these are wrong) .
in input i mounted an electrolitic capacitor from 1000uf/16v while in output i mounted an more small always elettrolitic capacitor from 100uf/25v .
in input to the circuit there is an capacitor 10uf/50v .
at this point i believe that i have wrong many things .
300120163306.jpg i attached a parts of my schematic so you can see my errors .300120163308.jpg 300120163310.jpg 300120163311.jpg 300120163312.jpg 300120163313.jpg
 

Thread Starter

kyu9971

Joined Mar 28, 2015
90
i solved with an 1000 uF capacitor , 50 ohm resistor and schottky diode in input to the circuit before of the lm 7805 as the Picbuster schematic .
while, with an 50 ohm resistor and schottky diode after the lm 7805, the pic not work for the voltage low.
thank you so much for your helped
 
Top