Created Wed, 21 Nov 2012 08:49:04 +0000 by jbcpt
Wed, 21 Nov 2012 08:49:04 +0000
Hi there guys,
You going to have to excuse the newbie question.. :oops:
I have a uno 32 board. And I found a example online, which is similar to what I want to achieve, just that I will be using a pressure sensor
I would just like to know why a 2.2 kOhm resistor is used to divide the voltage, how did they calculate what resistance was needed?
Here is the small tutorial that I was going through:
Wed, 21 Nov 2012 10:55:01 +0000
The exact value of resistor is not really that critical. It needs to be a value that gives reasonable results from the sensor you are using.
Find out the range of resistances your sensor gives, and then use those to calculate a ball-park resistance value that will give a desirable range using the standard potential divider formulae (available on [url]http://en.wikipedia.org/wiki/Voltage_divider#Resistive_divider[/url])
Fri, 23 Nov 2012 08:41:32 +0000
Thanks for the help Majenko.
I would also like to ask, as it seems to me that the 2.2 kO resistor in that circuit isnt really acting as a voltage divider as such, but more like a 'short circuit' protector.
Also if the LDR's lowest resistance is 131 ohms it will be allowing 25.19 mA of current passing back to pin A0, which may be a little high? (And im taking it, that is not the lightest environment either, so there may even be lower resistance, especially if you go put a light right above the LDR)
What are your thoughts on this?
Fri, 23 Nov 2012 09:47:46 +0000
Thanks for the help Majenko. I would also like to ask, as it seems to me that the 2.2 kO resistor in that circuit isnt really acting as a voltage divider as such, but more like a 'short circuit' protector.
What are you thinking it's protecting against a short circuit? It's there purely and simply to form a voltage divider with the LDR (or other sensor).
Also if the LDR's lowest resistance is 131 ohms it will be allowing 25.19 mA of current passing back to pin A0, which may be a little high? (And im taking it, that is not the lightest environment either, so there may even be lower resistance, especially if you go put a light right above the LDR) What are your thoughts on this?
You're forgetting one crucial factor - the analogue input has its own input impedance. This is in the order of 100MÎ© or so. The current that will be flowing into the pin will be in the order of pA or maybe nA at worst - even if you link it directly to the 3.3V pin with a piece of wire.
Without the resistor to form a divider, the voltage drop change over a range of LDR+input impedance (say 100,000,131 to 100,001,310) will be as good as unmeasurable. By establishing a voltage divider, the voltage range presented to the analogue pin changes between 0V and 3.3V depending on the ratio of the sensor and 2.2K resistor.
There is also a 5KÎ© "recommended" impedance for the output of any voltage source connected to an analogue pin (from the data sheet for the PIC32). This basically means that, to maintain accuracy and not have the input impedance of the analogue pin affect your readings, the resistance of whatever you are measuring across shouldn't exceed 5KÎ©. Any higher than that and the input impedance of the analogue pin will skew the results a tiny fraction. The higher the resistance, the more it will affect it. Still, for this kind of measurement those changes won't really be noticeable unless you go to hundreds of KÎ©.
Mon, 26 Nov 2012 11:19:12 +0000
Thanks Majenko, really appreciating all the help.
I am sort of getting the idea now, I played around a bit with the board this past weekend. connected up a Toyota boost pressure sensor onto the 5v output, and measured the signal wire from the sensor. It would read 2.450 v, and when i blew into the sensor it would increase to 2.485. I tried to measure the current between the 5v+ output and the sensor. But there was no reading, Is that because the current is in the nA or pA range ? (ie. too small to be read by my multimeter). And much would it be?
Mon, 26 Nov 2012 16:03:24 +0000
Without knowing how the sensor works it's impossible to tell what its current consumption should/would be. It's not really that interesting anyway, unless you're building a system to run off a very limited power source and you have to account for every single picoamp.