power supply problem

Status
Not open for further replies.

newnew

New Member
hello
i have a simple circuit using a pic16f628A, when i use a normal wall adaptor everything works fine,
when i use a transformer
300mA, 9V
attached to 2amp rectifier (thats what i have now)
then capacitor in parallel (10uf or 1uf) , i get solid blocks on the LCD screen !
i tried different transformer (1am 12V) , same problem

can anyone explain what i am doing wrong ?

thanks

MikeMl

Well-Known Member
To make a proper power supply for the PIC with a 9V AC wall transformer, you would need a 500uF 15V capacitor behind the full-wave bridge rectifier. Your 1uF or 10uf capacitor would have a huge ripple voltage.

Since the capacitor charges to something like 1.3 to 1.4x9V = 12.6V, the voltage is very large compared to the maximum voltage the PIC will take. You will have to use an LM7805 or LM317 type of voltage regulator IC to create the required 5V. Hope you haven't fried something.

newnew

New Member
its ok , the 7805 is already in the circuit i made.
i will try the 500uf capacitor and let you know what happend

newnew

New Member
worked
thanks a lot mike

shimniok

Member
One source I read says the rule of thumb is 1000-2000uF per 1A

Hero999

Banned
It depends on the allowable voltage ripple, just saying 1000 to 2000µF per Amp of current isn't away enough. For instance if there's only 1V of headroom between the peak voltage and the drop-out of the regulator plus rectifier then the capacitor should be 10,000µF/A.

Here's a simple formula:
$C = \frac{10 \times I}{V_{R}}\\ V_R= \text{Maximum ripple}\\ I=\text{Current drawn by regulator in mA}\\ C=\text{Minimum Capacitance required in } \mu F$

Here's a more complex formula which is more accurate:
$C = \frac{I}{V_R} \times \left(\frac{1}{4f} + \frac{arcsin{\left(\frac{V_{IN}-V_R}{V_{IN}} \right)}}{2\pi f} \right)\\ C=\text{Minimum capacitance required in Farads}\\ V_R= \text{Maximum ripple}\\ V_{IN}= \text{Input voltage, excluding diode losses}\\ I=\text{Current drawn by regulator in Amps}\\ f= \text{Frequency}\\$

Note that in the first formula capacitance and current are in µF and mA respectively and in the second formula they are in F an A respectively. The simple formula is only valid for 50/60Hz.

All the above formula are for a bridge rectifier, for a half wave double the capacitance.

Last edited:

shimniok

Member
Cool, thanks for posting those details.

beesmurfy

New Member
Hi, I'm new here (first post)
I have a pic 16f628a circuit and all it has to do is flash an LED. It does this when connected to a 9v battery with a lm7805 but then when I use a power supply (a Nokia charger - output 5v 300ma DC) the led just freezes. the circuit is getting power and returns to normal when I touch ground with my finger. The output of the pic on the pin that is supposed to flash just settles on approx 2.5v when I use the power supply and just stays there with the LED on.

Thanks

rmn_tech

Member
You need more than 5v at the input of the 7805 to get 5v out. Check the data sheet.

beesmurfy

New Member
The thing is that the output of the power supply is 6v and the same thing happens if I plug that straight into the circuit. The output of the LM7805 is about 4.95v when the input is 6v.

shimniok

Member
Perhaps the "DC" output is a bit noisy / unfiltered? The touch-finger-all-ok thing makes me think noise... I dunno. If you have an oscilloscope you could check out what the wall wart output looks like. Or just throw a capacitor across the power rails, like 100-330µF (electrolytic, make sure it is oriented with correct polarity!!!) to reduce ripple and another smaller cap, I dunno, .1-1µF in hopes of filtering some noise?

beesmurfy

New Member
Hi, I tried a talanium 1uF and a electrolytic 100uf across the terminals but unfortunately no luck, I'm going to go use an oscilloscope today to check for noise. I also tried 3 100uf in parallel, hoping to achieve a 300uf cap but that also didn't help. the power supply is rated 300ma, is that too much current perhaps?

arunb

Member
7805 needs at least 12 V at the input for proper operation. 9 V is not enough. You could use a 5.1 V zener diode connected to a 560E resistance instead..

If the PIC draws more power than an additional transistor may have to be added. A nokia 5V charger may also work, (protected with a 5.1 V zener diode)

thanks
a

shimniok

Member
If the wallwart is 5V and you feed that directly to the ckt, then 300mA is fine b/c the circuit will only draw what it "needs" ... it probably also isn't too little as 300mA sounds like plenty to power an LED and an MCU.

Btw, voltage drop out for a 7805 can be quite a bit less than (12-5=) 7V !! But, check datasheet for your specific IC to be sure. I run 7805's off of weak 9V batteries, no problem.

Michael

beesmurfy

New Member
I checked the circuit today in the labs. I used the lab power supply and got the same problem, but then with the capacitor attached it was fine. I couldn't check the wall wart because I didn't have the right plug, so ill check it tomorrow. I think the problem is noise (thanks Michael) and that the wall wart just has more than the lab supply and more than a single 100uf cap can filter out. I looked at the circuit supply's spectrum and there seems to be (apart from the high DC component) two spikes, one at ~6 and ~10 Khz, I'm thinking that because the pic works at high freq (8mhz) this might be the cause of the problem, but I don't really know. Ill try use a RC filter, maybe that will help.

Thaks a lot for the help guys

beesmurfy

New Member
another part of the puzzle, if i plug one terminal of the 9v battery into either +5v or ground the pic flashes (i leave the other terminal unconnected)

shimniok

Member
That's odd.

Do you have a decoupling capacitor on the PIC? (not sure if it needs one but...)

Status
Not open for further replies.

Replies
11
Views
3K
Replies
2
Views
1K
Replies
8
Views
2K
Replies
6
Views
3K
Replies
21
Views
4K