Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Source/sink

Status
Not open for further replies.

memo4

New Member
I've got an auxiliary port with 0 - 3.3V and 4mA source/sink. What does this 4mA source/sink mean?
 
Means that each pin on the port can handle a 4mA draw whether the pin is high or low. If the pin is high with a 4mA draw from the pin, it is said to be "sourcing" 4mA. If the pin is low with a 4mA draw from the pin, it is said to be "sinking" 4mA.

Sourcing = low resistance path exists from the pin to Vcc/Vdd
Sinking = low resistance path exists from the pin to GND/Vss
 
The 8051 is a prime example of this as it has weak internal pull ups on most ports (PORT 0 operates in open drain/collector fashion when used for general purpose I/O but has strong pull ups when used as the time multiplexed low order address/data port) . Sink current on these I believe is 10-15mA while source current is around 50uA.
 
Whi;e we are at it, the saturation voltage may play a role for you. For instance when driving a LED with a series resistor, it's customary to run a resistor to Vcc, then to the :ED and then to the processors Port or, for that matter, an external transistor.

You have to count all the drops.

Vcc-MAX LED Vf-Vce(SAT). so this could be R<= (3.3-1.2-0.6)/0.005A. This is the computation for the LED series resistor. 3.3 V supply. 1.2 for the LED and 0.6 for the transistor driving at 5 mA.
 
Thanks all for your explanations, but I still don't quite get it completely.

I'm using the I/O channels as analog inputs which gives me back a value varying from 0 to 3.3V. The unit that i'm using (an x-IMU) also has an 3.3 V power output, 100 mA. Conneting this to one of the analog input pins directly gives a signal of 3.3V. Though, in my application I'm using a part of the hand, a couple of fingers, to conduct the power output to the analog input. The skins resistance obviously causes the voltage measured is less than 3.3V, let's say half or 1/3 of it, but still... a clear signal (which is what I want). But the analog input only reads about 0,05V, more or less (depending on how tough the grip is).

Do I understand it correctly if I say that: the voltage measured is so low because it can only sink upto 4mA? If so, is there any way that I can somehow increase this signal?
Thanks again in advance.
 
I can't draw pretty pics, but you have output Z and input Z which are impeadances. Think of these right now as resistances. The output Z creates a voltage divider with the load. The input Z creates a voltage divider with the load.

Voltage sources have a very low output Z, < 0 ohms. A "typical" multimeter as an input resistance of 10 meg ohms. You can't measure things that have an R in the G ohm rang with that meter.

The "trick" is to make these insignificant. The other issue is to manage "contact resistance". One way to manage contact resistance is to use a 4-terminal measurement (Kelvin), where you measure the current through the device and the voltage across the device. Electrode gel may help the contact resistance problem.

Let's hope your using batteries or a medical supply with enough isolation and a GFCI.

Next real question is whether or not you should be looking at resistances. Because of Thevinin and Norton's theorems, an IDEAL voltage source in series with a resistor is a current source and and ideal currrent source in parallel with a resistor is a voltage source. An ideal voltage source has in output Z of zero ad and an ideal current source has an output Z of infiinity.

Op amp buffers, isolation amplifiers and differential amplifiers may be in your future,
 
Thanks all for your explanations, but I still don't quite get it completely.

I'm using the I/O channels as analog inputs which gives me back a value varying from 0 to 3.3V. The unit that i'm using (an x-IMU) also has an 3.3 V power output, 100 mA. Conneting this to one of the analog input pins directly gives a signal of 3.3V. Though, in my application I'm using a part of the hand, a couple of fingers, to conduct the power output to the analog input. The skins resistance obviously causes the voltage measured is less than 3.3V, let's say half or 1/3 of it, but still... a clear signal (which is what I want). But the analog input only reads about 0,05V, more or less (depending on how tough the grip is).

Do I understand it correctly if I say that: the voltage measured is so low because it can only sink upto 4mA? If so, is there any way that I can somehow increase this signal?
Thanks again in advance.

The source and sink ratings only apply to pins that are being used as output pins. When using a pin as an input, the pin is in a high impedance (i.e. "floating") state. If it is a true push-pull pin with both output drivers switched off when used as an input, it will not source nor sink any current whether an external device is driving the pin high or low.

The reason for the low voltage is due to the resistance of your hand. If you are using an ADC to read such low voltages, I would suggest using a lower +Vref for the ADC.
 
Thanks all for your explanations, but I still don't quite get it completely.

I'm using the I/O channels as analog inputs which gives me back a value varying from 0 to 3.3V. The unit that i'm using (an x-IMU) also has an 3.3 V power output, 100 mA. Conneting this to one of the analog input pins directly gives a signal of 3.3V. Though, in my application I'm using a part of the hand, a couple of fingers, to conduct the power output to the analog input. The skins resistance obviously causes the voltage measured is less than 3.3V, let's say half or 1/3 of it, but still... a clear signal (which is what I want). But the analog input only reads about 0,05V, more or less (depending on how tough the grip is).

Do I understand it correctly if I say that: the voltage measured is so low because it can only sink upto 4mA? If so, is there any way that I can somehow increase this signal?
Thanks again in advance.

I think we can set aside source and sink. You have a voltage source of 3.3 volts with a maximum current capability of 100 mA. If you were to directly connect this to your Input Channel it would read 3.3 volts just fine. However, you have a hand in series with the voltage source or a part of a hand. That is a very large resistance. You are correct to assume that some voltage will be dropped across the resistance induced by the hand but this will be a very large portion of your 3.3 volt source voltage. Before we even get into that you have another problem to worry about.

Using a good quality digital meter I just measured the resistance of my index to middle finger. Using moderate light pressure with my probes I am seeing about 900 K Ohm or 900,000 Ohms. Measurements like this are difficult as the probe pressure applied will change the readings as well as any perspiration on my hand (salts) and a host of other variables including what I ate for breakfast this morning. Note what KISS posted above (Post #8). You would now have a source voltage of 3.3 volts and 900,000 ohms in series with the input impedance of your measuring device.

I am guessing this is what you have:

14.3 Analogue input
In analogue input mode all 8 pins of the auxiliary port function as analogue inputs. Each analogue input
channel sas a 12-bit resolution and a range of 0 V to 3.3 V. The user may access analogue input data as
either raw un-calibrated ADC results or as calibrated units by specifying the mode in the analogue input data
mode register. Analogue input data is provided in either the raw analogue input data or calibrated analogue
input data packets. The data output rate of these packets may be set to disabled, 1 Hz, 2 Hz, 4 Hz, 8 Hz, 16
Hz, 32 Hz, 64 Hz, 128 Hz, 256 Hz or 512 Hz in the analogue input data output rate register.
Raw ADC data: In raw data mode the analogue input data is the ADC integer value between 0 and 4096
corresponding to a voltage between 0 V and 3.3 V. This data is provided in the raw analogue input data
packets.
Calibrated data: In calibrated data mode the analogue data is the calibrated measurement in Volts.
This data is provided in the calibrate analogue data packets. The calibrated measurement an is calculated
from the raw ADC measurements ~v according to a sensitivity san and bias ban as described by equation (6).
Parameters san and ban are dened in the analogue input sensitivity and bias registers.
an =
1
san
(a~n ban)


When using the aux channels as analog input they don't mention what the actual input impedance is but I would assume pretty high, check your user manual. The hand is dropping most of your 3.3 volts leaving little for the analog input to measure. What exactly are you trying to do?

Ron
 
Thanks all for the replies,

Good to know that the sinking/sourcing are not applicable in this matter, that makes this title becoming completely irrelevant, but ok.

I'm trying to measure hand contact with a certain object.
Measuring a voltage will give me the feedback needed to know whether there's contact or not. At the moment this voltage is to low to measure handcontant with absolute certainty, although I do a signal, it's not strong enough and, indeed, too dependent on things like: grip, perspiration and other factors.

I did configure the channel as an analog input. When I connect the 3.3V I'm indeed getting a full scale signal; 4096bits/3.3V.

I've attached a figure of my circuit used, S1 is the hand, A0 the analog input. I've tested with different resistors, in this circuit I used a 1k resistor, but I also tested with 10k, 100k and 1m. I was getting the strongest signal with 1k. A higher resistance caused only more noise on the signal.

**broken link removed**
The hand's resistance is indeed around 900k ohm. I've used the 3.3V, 100mA in series with digital voltmeter, something like below (not looking at the output given there); this gave me, using a part of the hand as conductor, a voltage varying around 1V. Can I achieve this on the analog input pin and if yes, what's the best possible way to do so?

**broken link removed**

Thanks all in advance, again.
 
No unfortunatly not because there's a hole lot more coming in contact with the object, while i'm only interrested in hand contact. The hand is the only thing coming in contact having a reasonably low resistance. The idea of measuring voltage is therefor ideal. Thanks though.
 
Well there are a variety of "touch" sensors out there, some direct contact and some proximity. Then there are also a variety of medical sensors out there like this pulse sensor. What this comes down to is figuring out, for your application, which sensor will serve your purposes.

Using your example you have a full scale analog input of 3.3 volts. The A to D you have is a 12-bit resolution and a range of 0 V to 3.3 V. In your circuit you were reading I believe you said you had a voltage varying around 1 volt. That would be just below one third of full scale, not bad really. With 12 bit resolution and a Vref of 3.3 volts (full scale) then 3.3 volts = 4096 counts. You can resolve .0008057 volt. Roughly .8 mV. You won't have any trouble with a volt measuring it. So if you only want hand contact and that gives you a volt what is the problem? You program your chip accordingly so IF Vin is greater THAN THEN.... wherever you want to go with it.

Ron
 
I don't know this particular chip but have had situations in the past where I forgot to switch the digital output off. The ADC still works but is biased toward high/low and gives nonsense readings. Make sure the the digital part of the pin is switched off.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top