• AVR Freaks

AnsweredHot!PIC Auto-power control circuit problem

Page: 12 > Showing page 1 of 2
Author
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
2020/08/06 17:34:38 (permalink)
0

PIC Auto-power control circuit problem

Hi every one 
I design a relay based auto power and shutdown circuit i use the open drain pin in pic16f877a to power on - off the the +12v battery voltage which supply the micro by its power( see my attached schematic 
I HAVE two problems let's we began with the most and first one 
- when i power this circuit from transformer + bridge 12v the relay become on and every thing work will but if i supply the circuit from 12v battery the relay didn't powered on until i give it a short between collector and emitter of the transistor (short for instant time )it work and supply voltage to micro and load relays . the battery charged full before i test 
now what can be the solution for this problem 
Thanks 

Attached Image(s)

#1
ric
Super Member
  • Total Posts : 28378
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 17:59:57 (permalink)
0
You need to observe the transistor base with a storage scope to see what is happening.
My guess, with the transformer and bridge connected, you are seeing a series of pulses getting through C20, so the transistor is pulsing on and off, and enough charge is getting through to charge up the cap across the relay coil.
With the battery connected, you get a single pulse through C20, so the transistor turns on briefly once, then off again once C20 has charged.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
upand_at_them
Super Member
  • Total Posts : 649
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 19:42:11 (permalink)
0
Yeah, that transistor has a huge gain.
#3
PStechPaul
Super Member
  • Total Posts : 2919
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:13:07 (permalink)
0
I'm not clear about the purpose of this circuit. Apparently you want the circuit to power up when the battery is connected, but then be able to turn itself off upon command from the PIC. For one thing, capacitor C20 may take a long time to discharge sufficiently to be ready for the next time the battery is connected. And I don't see the reason for the 100 uF capacitor across the relay coil, except to slow down operation, which you may not want. What kind of filtering and actual voltage do you have on the transformer and bridge supply? As suggested, use a storage scope to see what's going on, or perhaps use a simulator.

 
#4
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:13:28 (permalink)
0
Hi sir
RIC your guess is true there are ripple voltage  in case of regulated power supply But with battery not f
-  i have a product use this circuit and work will the only difference between it and my sample one is the quality of the BC517 i use a Chinese one which may have low quality 
- What's your guess for solution i increase the capacitance of C20 and minimize the across relay capacitor and the same problem founded
- where the battery have a high impedance i connect a 1000uf/50v cap across the battery but didn't solve the problem 
- when i connect the same capacitor across the bridge output as i guess the relay not energized also same as battery 
 
#5
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:26:26 (permalink)
0
YES dear PAUL this circuit exactly work as you said after the PIC finish its job (JUST MAX IS one MINUTE) then it will disconnect himself from the Vbat  12v to not consume the battery current until the main power is come again which will disconnect the Positive terminal of battery and connect it with a battery charger  and when electricity cut-off again  the +vbat is connected to this circuit to power up the PIC and repeat his job  
 
#6
PStechPaul
Super Member
  • Total Posts : 2919
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:36:57 (permalink)
+1 (1)
C20 and the 1k resistor to GND have a TC of just 10 mSec, which may not be long enough to operate the relay, especially with the coil capacitor. Maybe try 10k or 20k to see if things improve. And maybe use a MOSFET instead of a BJT.

 
#7
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:46:23 (permalink)
0
Another related problem in this circuit is that when i power this circuit from the power supply the relay energized as i mention above and PIC do his job when i make RA4 low the relay doesn't cut-off the power 
- i see a 4.25v on the RA4 pin when i put it high and 0.19v when i put it low 
- after the PIC finish it's job i turn off all the peripherals like relays , leds, ADC modules, COMPRATOR and TIMERS every thing and then put RA4 to low the same problem the relay not shutdown 
- i tray to put PIC in sleep MODE AS A LAST CODE also same problem 
-- the only thing which i noticed is when the RA4 is high i see just 0.59v on the transistor base  where i know that i need minimum 2v for transistor to conduct 
Any help guess !!!!!
 
#8
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:48:51 (permalink)
0
Ok sir/ PAUL  now i will change the 1k resistor with higher values and see 
 
#9
PStechPaul
Super Member
  • Total Posts : 2919
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 21:59:25 (permalink)
0

I see that the BC517 is a darlington transistor, which will turn on at 1.5 volts. Perhaps it is defective, as you seem to suspect. Does it turn off if you connect a short from base to GND? You may need to use a scope to see if something may be oscillating or if noise is present.

 
#10
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 22:23:54 (permalink)
0
Dear PAUL 
1- I change 1k resistor from 5k until i reach to 25k (TC = 0.25 SEC) BUT the same problem without any notice 
2- when i short between GND and base it don't turn off 
3- i changed BC517 with other one the same problem ( may the two is bad !!!!!!?)
#11
davea
Super Member
  • Total Posts : 311
  • Reward points : 0
  • Joined: 2016/01/28 13:12:13
  • Location: Tampa Bay FL USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/06 23:21:54 (permalink)
+1 (1)
when i short between GND and base it don't turn off 
there something very wrong there...
1 there is no need for 100uf across the relay it would best used across VBAT
2 all timing is done by C20
3 the 1n4007 is not needed across the transter
4 500 ohm is too low for the OD load  
5 there is no discharge for C20 when VBAT is disconnected
   add 5k to top of C20 to GND
post edited by davea - 2020/08/06 23:43:12
#12
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 01:09:04 (permalink)
0
Thanks DAVEA for your replay now i change 500 ohm to 2k which give me 3.5v when RA4 is high and become 2v after 2k resistor but on the transistor base it give me 0.59v and the same problem still there
- i reject 100u cap and diode which across the transistor and same problem BUT when i power the circuit using regulated power supply the relay rapidly vibrate and PIC become in reset state 
 
*- i noticed that there are 10k resistor across Vbat terminals 
- now i see that this circuit like a latch relay just give a pulse to the transistor it will work and another pulse it will off but i don't know why it didn't work well 
- i wait for the original board i will get it again may be there a wrong or missed connection i guess the diode a cross the transistor may be reversed  let we see 
#13
ric
Super Member
  • Total Posts : 28378
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 02:59:02 (permalink) ☼ Best Answerby MOHAEGY 2020/08/08 15:00:22
+1 (1)
Robotics011
Thanks DAVEA for your replay now i change 500 ohm to 2k which give me 3.5v when RA4 is high and become 2v after 2k resistor but on the transistor base it give me 0.59v and the same problem still there

Are you sure the transistor is a BC517 ?
That voltage implies it is a simple NPN BJT, not a darlington.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#14
davea
Super Member
  • Total Posts : 311
  • Reward points : 0
  • Joined: 2016/01/28 13:12:13
  • Location: Tampa Bay FL USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 10:51:16 (permalink) ☄ Helpfulby MOHAEGY 2020/08/08 15:00:13
0
check what ric said..
also
if VBAT drops when relay closes then 
C20 will also drop the same amount reducing the base drive 
therefore oscillation  
it looks like if you replace C20 with a resistor and dump the 50K
and add .1uf for bypass at the base resistor divider 
or even larger for some time delay
it would work
post edited by davea - 2020/08/07 11:16:11
#15
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 16:25:10 (permalink)
0
Thanks RIC and DAVEA for your help
- for RIC
tomorrow at 10AM i will get the original board to check again and i will check for transistor and other component and the overall schematic.
- For DAVEA 
Ok it work when i replace C20 with 1k resistor and neglect 50k and put 0.1u in series with base resistor BUT no control from PIC no shutdown also
may be because RA4 is open drain here or something else
- the original circuit i discover from the project owner that it will shutdown after the PIC finish its job and if you press PIC reset BUTTON it work again and (as i said before) when main power come it cut the VBat and connect battery terminal to other charging circuit(using contactor with auxiliary points NC and NO)  
So i see its may be a latch circuit  let's we see tomorrow and i well type to yours what i found 
Thanks 
#16
davea
Super Member
  • Total Posts : 311
  • Reward points : 0
  • Joined: 2016/01/28 13:12:13
  • Location: Tampa Bay FL USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 19:34:17 (permalink)
0
Ok it work when i replace C20 with 1k resistor and neglect 50k
NO resister need to be at least 33k - 50K
 
what is this circuit used for ??
post edited by davea - 2020/08/07 19:36:12
#17
PStechPaul
Super Member
  • Total Posts : 2919
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/07 22:50:00 (permalink) ☄ Helpfulby MOHAEGY 2020/08/08 15:00:38
0
As I understand it, an external 12 volt battery may be connected to this circuit, in which case it should supply power to the PIC as well as some 12 volt power circuitry (perhaps the center tap push-pull inverter previously proposed). The PIC will perform its duties for a period of time, after which it will release the latch and turn itself off without draining the battery.
 
Here is a simple circuit which I think performs this function reliably. In the simulation, the battery voltage is applied at the 100 mSec time, which causes the P-channel MOSFET M1 to turn ON while capacitor C1 charges, with a TC of 50 mSec. The drain of the MOSFET supplies 12 VDC to the power circuitry (represented by the 12 ohm resistor R3), and the voltage regulator which supplies 5 VDC to the PIC (represented by R2, R4, R6, C4, and Q1). The collector of Q1 functions as the open drain pin used as a latch through R5 to the MOSFET. The capacitor C4 and the associated resistors function to simulate the PIC releasing the latch after about 150 mSec, at which point 12V power is removed from the power circuits and the voltage regulator. After about 1 second, current draw from the battery is less than 100 pA.
 

 

Attached Image(s)


 
#18
davea
Super Member
  • Total Posts : 311
  • Reward points : 0
  • Joined: 2016/01/28 13:12:13
  • Location: Tampa Bay FL USA
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/08 10:09:55 (permalink)
0
here is a safe and simple way
no sparks while connecting battery's 

Attached Image(s)

#19
MOHAEGY
Starting Member
  • Total Posts : 82
  • Reward points : 0
  • Joined: 2020/05/27 11:33:24
  • Location: 0
  • Status: offline
Re: PIC Auto-power control circuit problem 2020/08/08 15:03:36 (permalink)
0
Thanks to all the problem solved
- As Sir/PAUL said this circuit is a part of a lift rescue control card (see my attachment) this rescue card have 3 parts one of them this auto shutdown circuit the SECOND part is the 48 to 220V UPS using center=taped transformer the THIRD part is three phase lift motor circuit which consist of 6 PWM's signals from PIC to three IR2110 to six IRF150N mosfets this card work with FOUR batteries 12v/7AH connected in series and from the first batery take 12v to the shut-down circuit Also this card designed from 15 years ago its very genius design where the designer use PIC16F778A and make a software PWM's for three phase motor and just use the two PMW modules for UPS part (He use them in COMPARE MODE not as PWM module) where he use 12Mhz crystal oscillator which he can't generate a PWM with 50HZ  and he just generate a modulated square wave which passed to center-taped transformer through two IRFP260N mosftets (i assumed that because he can't generate a sine wave without using full bridge as SIR/ paul said in the my last post)
Now this the customer project which i work on it now and customer just want the same rescue card without any modifications in hardware where he afraid of changing the output quality of this card 
*-I was design the card PCB and work on software now i finished the 3-pase motor software and tested it on a motor and work well 
then now i just have another problem in UPS software part lets we talk about it but after i say how the auto power circuit problem has been solved
- Thanks A lot to sir / RIC after i got the original card again i found that the schematic say its BC517 transistor But after i check the transistor itself i found it is just BC547 
That's  and the diode across this transistor is also in the reverse direction 
Thanks sir/DAVEA and sir/PAUL for yours proposed circuit but as i said its customer needs 

Attached Image(s)

#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5