Voltage causes erratic behaviour

testerrrs

New Member
I have two 08M PICAXE chips running from a single 9V supply through a 78L05 regulator. This regulator should supply a constant 5V supply as long as input voltage remains above 7V. Both PICs are running at 8mhz.

There is a 10uF and 220nF capacitor across the 9V supply and a 100nF and 10uF capacitor across the regulated 5V supply.

When a good 9V battery is attached and the circuit is switched on (terminal voltage drops to ~8.2V), or when a 9V power supply is used, the circuit behaves very erratically. It is controlling an Ultrasound Range Finder, and the system returns random values. Sometimes the PICs will "crash" and the status LEDs attached to their output 0's flicker on and off, or just turn off completely and the PIC stops responding.

However, when a bad 9V battery is used and the circuit is turned on (terminal voltage at ~7V, regulated voltage ~5V), or when the power supply is used at just 6V (regulated supply ~4.5V), the system works fine and returns correct values.

Any ideas what's going on here?

TIA,
Jon
 

kevrus

New Member
I usually use a cap with a larger value than 10uf, do you know what the current draw is through the regulator, and is the regulator getting hot when using 9v/good battery? It may be overheating if the power dissipation is too high. It maybe that your 78L05 regulator is the small TO92 style (like a small signal transistor) in which case the max current is only 100mA and they have thermal shutdown capabilities.
You may need to upgrade to a TO220 style regulator of which there are a few types with current ratings from 500mA (78M05) to 2A (78S05) with maybe a small heatsink...if this is the problem of course.
 

Michael 2727

Senior Member
There can be 9V DC and 9V DC.

You could have a DC supply -
Transformer, Bridge Rectifier, Capacitor too small in value.
Transformer, Bridge Rectifier, Capacitor adequate value.
Transformer, Half Bridge (2 Diodes), plus Capacitor.

They are all technically a 9V DC supply but the amount of
voltage ripple could vary from smooth to almost useless, if
used in a Microcontroller or Audio application etc.

A Regulator is not designed to remove large ripple from a poor DC source.
When using a regulator I would suggest a minimum input capacitor
value of 100µF to 2,200µF, and only use 100µF if your load was
only a very few mA.

You could test your DC Supply for large 50Hz/60Hz ripple by placing
a small speaker in series with 100 Ohm to 300 Ohm resistor.
If you can hear any Hum you may have a cheapish import supply
that needs extra capacitance added.
If your supply has any blown diodes you may also hear it.

$0.02c
 

testerrrs

New Member
Thanks for the replies.

@Michael: The problem also occurs when using a 9V battery. Would I still need to look at using a higher value cap?

@kevrus: Measuring the circuit with an ammeter shows a current draw of 45mA. Th regulator is the TO92 style, but does not get at all hot when in use. Is there an ything else I can try?

Any other ideas much appreciated,

Jon
 

BeanieBots

Moderator
Your meter might show 45mA but the peak value will be MUCH higher.
US sensors pull many hundreds of milliamps when sending. The 78L05 just can't cope:eek:
Fit MUCH larger caps near the US device. About 4700uF and ideally, use a larger T220 type regulator.
 

Michael 2727

Senior Member
I would never use anything under 100µF for the input side
af a Regulator and even then only if the load was < 20mA.

And what BB said above ^ ^ ^ ^ ^
 
Last edited:

Mycroft2152

Senior Member
There are a few factors that may becausing the problem:

9 volt batteries a low current sources

Wall warts usually have a lot of ripple that needs to be filtered and are not designed for high current apps.

78L05 regulators are onlly good for 100 milliamps

Lastly and most significant; the sonar units require a hefty pulse of current to send out a ping.

You may not be seeing this pulse on your multimemter. When the 'ping' is generated, the high current pulse will drop the voltage of the 9 volt battery below the minimum for the regulator.

Here is a good explanation on the use of the sonar sensors:

http://www.acroname.com/robotics/info/articles/sonar/sonar.html#e11

At that point strange things happpen :(

You may need to change to AA alkaline batteries or a Nicad pack and add a large cap to the power bus.
 
Last edited:

andrew_qld

Senior Member
A 9V battery cannot supply all that much current (300 to 500mA for a good one when its new). If the terminal voltage is dropping to 8.2V (or worse) under load then it could mean that the circuit is drawing a fair bit of current (or high current pulses as Beanie suggests) or the battery is going flat.

Do you have the specs on the rangefinder to indicate what it should be drawing current wise?

I thought about the floating serin pin too but the circuit behaves at 4.5V then I don't think this is the problem.

Regulators themselves draw a fair bit of current even when nothing is connected. A 78L05 will flatten a 9V battery in 24 hours without anything running on it.
 

andrew_qld

Senior Member
I hate it when it takes me 10 minutes to write a reply and 2 or 3 messages pop up saying the same thing after I have sent it.
 

testerrrs

New Member
Thanks all :)

I have replaced the 78L05 with a L78S05 which is rated up to 2A.

I now have 2x1000uF caps across the input and also 2x1000uF caps across the 5v regulated output.

The system is now running off 6xAA (new) batteries, terminal voltage ~9.2V.

However, the exact same problem is still occuring. Any other ideas? Do I also need some small caps across the input and regulated supplies?

Jon
 

Michael 2727

Senior Member
Very large capacitors on the Regulator Output can
in some cases cause problems.
I suggest you trawl the NET for further info on
Regulator circuits, there's plenty of info out there.

I'll attach a circuit below, this is almost Bullet Proof
in 99% of applications. The Reg can be any 78XX
3 Pin type.
Remember, for correct regulation, + 2V on the input
side of the Reg, ALWAYS and under ANY load condition.
 

Attachments

hippy

Technical Support
Staff member
You can also go for separate regulated supplies for the ultrasound module and the rest of the electronics. The ultrasound supply will probably need larger reservoir capacitors than the electronics does.
 

Mycroft2152

Senior Member
I'd agree with Hippy, the next step is to separate power supplies.

By the way which ranger finder are you using?

In what format is the distance results and how are you interpreting it?
 

BeanieBots

Moderator
That's the joy of such an active forum.
I hate it when sombody waits a few days and then says the same as that which has already been said. Never hurts to drive a point home though:)
 

GGnz

New Member
I have a very similar problem. I have a 12VDC powerpack with a 5V Regulator hooked up and when I insert the chip, Pin 0 goes high and low at intervals, and the other pins seem to go half High (if that makes sense). Even with the serin port not floating it does this.
 

Michael 2727

Senior Member
GG what do you get using 3 x AA Cells ?
If you are having problems try the battery version.
This way you can verify if the problen is -
In the Chip.
In the programming of it.
Incorrect wiring.
Or the supply you are trying to use.

You could chase your own tail forever otherwise.
 

GGnz

New Member
The LED flashes as it should but oddly enough I do not have to hook any resistors up which shows some considerable voltage drop (same as other thread). I have tried the chip in several programming boards/prototype boards and same result.

I have been doing a search on here as well and have one further question expanding my project. That is if I wish to drive 5 LED's of one output do I need to hook a transistor up or something since the outputs only have a current of 20mA?
 

BeanieBots

Moderator
If you don't put a resistor in series with the LED you risk destroying the PICAXE!
If you want to drive many LEDs then, then yes, you will need a transistor or similar device if you want to put more current through them than the PICAXE can supply alone. If running them from 5v, then they will need to be paralleled and EACH must have its own series resistor.
 

boriz

Senior Member
When using regulators, always study the datasheet. They can be a little more complicated than you might expect. Oscillations and such.

@Geforce.

Is the US unit getting it’s drive power from the 5v side of the regulator or straight from the battery?

Try something like this:

Drive power to US unit comes straight from battery terminals. Power to the regulator goes through a single rectifier diode with a 1000uF capacitor to ground from the cathode. The capacitor can thus supply >7v to your regulator (and uC) during the brief periods when the battery voltage drops below 7v. A switching diode would be better, but prolly not necessary.

Note. The larger the capacitor, the larger it’s effective series resistance and the larger the ripple, so when relying on a low ESR, it’s better to use several capacitors in parallel rather than one large capacitor. This puts the ESRs in parallel reducing the overall ESR significantly, but the total capacitance is the sum of the individual capacitances.

Does the US unit use some sort of inductive voltage booster? This could cause quite a bit of noise. The datasheet for the US unit should describe any special precautions you need to take.
 

testerrrs

New Member
Thanks for all the replies and my apologies for the late reply!

The US unit is not a prebuilt module. It is a circuit that I put together but I know for certain that it works fine. The transmitter (555) is powered straight from the battery (9V). Parts of the reciever run off the 9V supply and parts from the 5V reg. supply.

---

As far as using seperate power supplies goes, here's my results:

Took out the regulator. Connected the 9V line direct to a 9V battery, and the 5-6V line (PICAXEs) to a 6V battery. The same problem happens! I think this now rules out the regulator?

However. Connected the 9V line direct to a 9V battery, and the 5-6V line (PICAXEs) to a 4.5V battery. And now it works fine! The LCD display is a bit dull, but thats down to it being run off only 4.5v when it should be run off higher.

Any more suggestions welcomed! Should I carry on playing with the regulator circuits or does this show that this part of the circuit is not the problem? If so, where should I start looking now?

Thanks again,
Jon
 
Top