Simple question I expect (Potential Dividers)

SilentScreamer

Senior Member
Firstly I apologise for this question I imagine its simple once you know how.

I have a 6V battery that will power my 08M (just testing my LCD display for now, will later be upgraded to a 28X1). How can I find the resistance the PICAXE chip to work out what resister I will require? Or am I trying to do this the wrong way in which case how would I work it out?

This is for a coursework project, thus my desire to know how to calculate it.
 

eclectic

Moderator
Simple answer 1.

Do not use 6 volts.

Use 4.5. (three 1.5v cells)

OR,
use two diodes to drop the voltage to ~4.8v

e
 
Last edited:

eclectic

Moderator
SS.
Diodes.

Do you live near a Maplin's or similar ?

If so, go out and buy two or three.

Otherwise, "6 volt battery"

Is that 4 cells, or something different?
If it's four cells, then you can "tap" three,
with a little bit of care.

e
 

eclectic

Moderator
"and it needs to be working by Monday"

It's nice to see that old traditions are still going. :)

Plan C.

Two separate power supplies. Common ground

6v SLA AND 3 x 1.5v cells/batteries.

e
 

SilentScreamer

Senior Member
Old traditions do live on :p especially when I have to teach myself (my electronics teacher doesn't have a clue how to do electronics).

I'll try it if I need to. I'm still curious though how it would be done?
 

boriz

Senior Member
You seem to be misunderstanding the function of resistors. You must have heard this: “A resistor turns a voltage into a current, or a current into a voltage”?

A potential divider can indeed ‘program’ a specific voltage at it’s junction. But any load at all (even a small one), will change that voltage because it changes the current.

Let’s say you use a 100R and a 500R divider, with the bottom of the 500R at ground and the top of the 100R at 6v and the junction feeding the Picaxe. (aside from the fact that this is a mad waste of power), You would be right in expecting there to be exactly 5v at the junction. But as soon as you turn on the Picaxe, current flows through it. It’s almost exactly like putting another resistor in parallel with the 500R. So your divider voltage changes (drops).

I say ‘almost’ exactly, because unlike a resistor, the current used by the Picaxe will change from moment to moment depending on what it’s doing at the time. EG: You light a LED. That’s an additional 10mA etc. So the divider voltage is going to be changing unpredictably.

Variations in the Picaxe supply voltage will cause problems. At best, you will not be able to use the ADC inputs very well. At worst, the Picaxe will crash.

If you eliminate the 500R and just rely on the Picaxe itself as the bottom leg of the divider (I think this is what you were suggesting), thing’s will be even worse.

The voltage across a resistor will change according to how much current is flowing through it. Easy to calculate using Ohms law. V=IR, when V is the voltage across the resistor (in Volts), I is the current flowing through it (in Amps) and R is the resistor value (in Ohms).

A diode behaves very differently. It does not follow Ohms law. When forward biased, the voltage across it remains fairly constant. So variations in the load (Picaxe current) will not change the voltage across the diode appreciably.

Your question “How can I find the resistance the PICAXE chip” is a reasonable one. But would be better phrased “How can I determine what current will be flowing through the Picaxe chip?”. And of course the answer is, you can’t really. It changes from moment to moment. You can of course measure the current and calculate the equivalent resistance, but what would be the point when a millisecond later it will be different and you would have to calculate it again. This is essentially what Voltage Regulators do, they constantly adjust the current to maintain a constant voltage for the Picaxe.
 

eclectic

Moderator
SS.

Please post your circuit, or
at least a rough idea, so that suggestions can be made.

e

(who always handed in his coursework ahead of the deadline.)
cough-cough.
 

SilentScreamer

Senior Member
The deadline is some time in may (yet to be told the date) so I'm well ahead, just my teacher wont accept my 5 pages of code that I've wrote, that he hasn't even bothered to look at as its beyond him (guessed that I don't like him yet? :mad:), so I need something running in the real world by Monday.

As for my circuit, it is currently a 08M chip connected to a LCD firmware chip (the one PICAXE make) and a 16X2 LCD display.

It will later have a 3X4 keypad, a 12V siren (connected via a relay) and various inputs (such as a PIR sensor and reed switches). This will be on a 28X1 chip as I stated earlier.

EDIT: And thanks for the explanation, I hadn't considered that the current usage would change and thus expected the answer to be a simple figure :eek:.
 
Last edited:

Mycroft2152

Senior Member
SS,

You have a couple of problems here.

6 volts will fry a PICAXE

LCD ( and temp sensors) generally need 5 volts to work properly.

If you "need" 6 volts in other parts of you circuit, like for a servo, the easyist solution is to put 2 diodes in the power line to the PICAXE and run the servo (6 volts) doirect form the battery.

Just make sure nothing attached to the PICAXE will feed 6 volts into it.

Finaly, when running a PICAXE and other High current items form the same battery , you can have a voltage drop in the battery as the current is increased. So your 6 volts may actully only be 5 volts or less.

As had been said, this will screw up your ADC values, as the PICAXE uses the supply voltage as a reference.

Myc
 

SilentScreamer

Senior Member
My siren is 12V and the ADC isn't going to be used.

Thanks to all who have helped, ill use 3 AA batteries for now and the diodes on the final project, unless anyone knows of any issues with the LCD firmware running on 4.5 volts?
 

BeanieBots

Moderator
The LCD firmware chip should be OK at 4.5v but the LCD itself might not. They usually like a good 5v for good contrast.
Feed the PICAXE + firmware chip from two diode drops and the LCD from just one diode drop.
Better still, for your 'final' project, use a low-dropout voltage regulator and do it "properly".

Also, look up "Thevenin". It's a theorem which explains about the resistance of a potential divider as explained by Boriz.
Let's say you have a divider of R1 and R2. (R1 at the top).
Unloaded, the voltage will be V*R2/(R1+R2), but as has been explained, that voltage will drop as it gets loaded. By how much??
Well, the divider can be thought of as a voltage with a series resistor.
The voltage we've just worked out, the resistance is given by R1*R2/(R1+R2).
To get the full "brownie points" you need to show how to arrive at that from first principles, and then demonstrate why a divider alone is not suitable.
 

SilentScreamer

Senior Member
Thank you so much, I'm one of those unusual people that loves theories and maths. I'll look at it in more detail in the morning and ask about anything I don't understand with it.

Thanks again
 

BeanieBots

Moderator
Always glad to help anyone who wants to learn how to work it out themselves. Learn the theory (which is only ohms law + some algebra) and the world of analogue electronics will be your oyster!
 

Andrew Cowan

Senior Member
I find that unless the LCD has 5V it will be too faint to see. Try it on 4.5V, but I wouldn't be surprised if it didn't work.

I'm sure your electronics teacher has a diode or two - are you using one on the relay?

What is the other comonent that needs 6V? A servo will be happy (but slightly weaker) on 5V.

Andrew
 

SilentScreamer

Senior Member
The final thing will be ran using 12 volts, I will use a voltage regulator I expect as suggested earlier to get the 5 volts I need. The only component that requires more than 5 volts is the siren.

I changed a few facts (such as maplin is 10 minutes walk away from my house, I was there earlier) in the hope I would be able to get my answer as to how to work out potential dividers, something that has puzzled me for some time.
 

Mycroft2152

Senior Member
The rule of thumb for voltage dividers is that they are good to adjust an input voltage but no good for a power supply, as the voltage will vary with the current through them

There is a reason they make voltage regulators.

When using volktage regulators, make sure to include the capacitors on the front and back end.

Note: sirens tend to be power hogs, so that even at with a car battery. you may see a voltage drop. The voltage regulator is a must forthe logic part of the circuit.

Myc
 
Last edited:

BeanieBots

Moderator
Absolutely everything in electronics comes down to ohms law. It's just that sometimes the expression for "resistance" can get a little complex. A transistor for example.

For a potential divider is nice and simple.
V=IR.
So the voltage across the bottom resistor is its resistance X the current.
The current is the whole voltage across both resistors.
So, we get Voltage across bottom resistor = V*R2/(R1+R2).
As long as you can do algebra, then ohms law is all you need.
All the other theorems are just derivatives of it.
 

BeanieBots

Moderator
One regulator for both PICAXE and LCD will be OK.
A "standard" 7805 type regulator does require more than 6v input but there are LDO (low drop out) types available which only require about 100mV more than their output voltage.
As mentioned, when running from 12v, pay attention to the amount of heat that will be generated in the regulator. This will not be a problem if it's JUST an LCD and PICAXE, but if you start running a few LEDs for example, it can quickly build up.

Also, read the regulator datasheet. You also need capacitors to make most regulators work properly.
 

SilentScreamer

Senior Member
Right I have it all wired up, I'm trying to download a test program and it isn't working.

I have done the test that is in the "Serial port" tab of the options and I get the opposite result. When the LED is on I get -0.48V and when its off I get 3.43V. The firmware? button does not work either

Any ideas why I'm getting the opposite result to what I should?

and thanks eclectic for the links, they're proved very useful
 
Last edited:

boriz

Senior Member
"I'm one of those unusual people that loves theories and maths"

Get this book. You'll love it. It will be your best friend for years. You can thank me later.
 

SilentScreamer

Senior Member
The books on its way :D

Also this might be the simplest question ever (but I guess I said that at the beginning of this thread) but what is the voltage on a PICAXE's output pin a 28X1 in specific but does it change between chips? (I don't have a 28X1 to use a volt meter to test as of yet)
 

BeanieBots

Moderator
It will be very close to whatever the power rail voltage is.
Same goes for all PICAXEs, in fact, nearly all CMOS logic chips.
It will drop by a volt or so if you pull the max current of 20mA for eg. an LED.
 

Ralpht

New Member
Get this book. You'll love it. It will be your best friend for years. You can thank me later.
Cannot agree more. Everone playing with any aspect of electronics should have that book.
I've had a copy since the first edition, and will get the third edition when it is finally released.

Even though as an EE I should "know" all that this book covers, I always refer to it when designing something new.
 
Last edited:

boriz

Senior Member
I was never taught electronics. I just studied it as a hobby. Started with one of those 200-in-1 kits that have a set of components mounted on a board with spring clips on the terminals. No-one ever told me about this book. I found it by accident during a visit to the library.

I had it for over TWO YEARS! Constantly renewing it and occasionally paying fines. In fact I probably could have bought one for the price of all those fines.

If you only ever buy one electronics book. This is the one.
 

SilentScreamer

Senior Member
Well I've finally got a working prototype and ive now I've made the PCB and soldered it all together, the only problem is the voltage regullator is outputing ~2.5V not 5V. I've attached my Artwork (the voltage regulator is circled in black) and a "real world view" any ideas as to why it isn't working, ive checked the board there are no bridges or other problems with the soldering and I've tried 4 voltage regulators all without sucess.

The only other thing is that the voltage regulator is getting very hot despite the heat sink, it was cold on the breadboard.

((Btw Extra thanks for the book advice its a great electronics book))
 

Attachments

Top