Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

reading accurate resistance 0-100 ohms


  • Please log in to reply
14 replies to this topic

#1 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 July 2012 - 12:14 AM

Hello, I am a new member on here. So firstly hello to all :-). I have a netdurino. My question is how can i read in a resistance value of 0 - 100 ohms ??. I need this to be an accurate measurement. Thanks to all who read this.

#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 03 July 2012 - 06:14 AM

Hi tree frog and welcome to the forums. You need to read this out with the netduino, or you just want to know its value? Keep in mind resistors always have a tolerance %, so it's never 100% accurate.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 July 2012 - 11:38 AM

Hello Tree Frog. First off, you should define what you mean as "accurate": 1%? 0.1%? some ppm? The more precise you want the measurement, the higher will be the complexity, thus the cost of the system. Secondly, you should specify whether this "resistance" is a real resistor (i.e. a part), or such a sensor, maybe a chemical moisture. For instance, if you are going to measure the resistance of the nitro-glycerin, I would suggest to ask to a chemical scientist first... Anyway, in general, the resistance is commonly measured by injecting a well-defined current through it, then measuring the across voltage drop. That's because V = R * I, so R = V / I. The math formula is trivial, but the hardware could easily be very complex if you are asking for an high precision measurement. Hope it helps. Cheers
Biggest fault of Netduino? It runs by electricity.

#4 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 July 2012 - 02:06 PM

Hi tree frog and welcome to the forums.

You need to read this out with the netduino, or you just want to know its value?
Keep in mind resistors always have a tolerance %, so it's never 100% accurate.


Hello,

Its actually a sender for a tank, a 0~90 ohm variable resistor. you only have 2 leads from the sender. So internally 2 pins are connected togeather. Not sure how to wire the sender, in a way that will not damage the input pin,
also to get me a reading that will be in a range i can use.

#5 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 July 2012 - 02:14 PM

Hello again, sorry for double post... Basically i need to get 0-100% from the 80 ohm sender, 0 being tank empty and 100% full. I do not know the best way to do this. I have read up on constant current sources, but for this application i think that may be overkill....

#6 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 July 2012 - 05:14 PM

hello again... How could i use the 0-80 ohm sender with an opto isolator. how could that be wired up??. It would be good to isolate the sender from the netduino. Any help would be much appreciated here. :-)

#7 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 03 July 2012 - 11:41 PM

Tree Frog, Where did the sender come from? Any numbers on it? A lot of level sender, like the ones used on a fuel tank or water tank actually use 3 connectors, but appear to have only 2. Like on a fuel tank you have power, wiper & ground connections. The ground is through the tank and may not have a wire on it or if the tank is plastic, it will have a wire that goes under one of the mounting screws. + power \ / \ /<---- Signal Lead \ / - ground The circuit forms a voltage divider with the signalbeing a varing voltage based on level. Chuck If you have a volt ohm meter, turn it to resistance and check between the 1 lead to the case, if the meter reads about 80 ohms then the case is grounded.

#8 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 04 July 2012 - 03:41 AM

Hello, The sender has a plastic case, so no way it could be grounded. The section on the top of the sender is a separate section. A magnet in the sender alters the resistance reading. I know it seems a bit odd... I believe some LP gas tanks use this same type of sender. I can post a picture so you can see what i mean tomorrow. So i have 2 leads coming off the sender, that vary from 0 - 80 ohms as i move the sender part that has the float on it. How can i use that resistance reading to give me some kind of data input that i can work with ????. I wish that the sender had 3 wires, or used a ground connection through the body of it but it does not :-(

#9 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 July 2012 - 03:47 AM

Tree frog, you forget to mention how accurate should be the reading. From what you write, I guess that you should expect a one percent of accuracy. This means that if your tank is 1000 liters, your meter won't be able to tell you if the actual quantity is 450 or 460, for instance. How far is the sensor from the Netduino? The opto-isolation could be a good idea whereas they are pretty far each other, and/or there are many other machinery, cables, etc. However, the opto-isolation yields to a much more complex circuit. Please, give us a more complete picture of your project, otherwise it's pretty hard to understand what will be the best solution. Cheers
Biggest fault of Netduino? It runs by electricity.

#10 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 04 July 2012 - 04:08 AM

Tree frog, you forget to mention how accurate should be the reading. From what you write, I guess that you should expect a one percent of accuracy. This means that if your tank is 1000 liters, your meter won't be able to tell you if the actual quantity is 450 or 460, for instance.

How far is the sensor from the Netduino?
The opto-isolation could be a good idea whereas they are pretty far each other, and/or there are many other machinery, cables, etc. However, the opto-isolation yields to a much more complex circuit.

Please, give us a more complete picture of your project, otherwise it's pretty hard to understand what will be the best solution.
Cheers


Hello,
The netduino will be about 15 feet from the water tank. The tank holds 30 gallons. I want to display the amount % on an LCD meter. Calibrating it as follws. Tank empty, take a reading of the input, fill the tank and then take a reading again.
Taking the 2 numbers that relate to empty and full, and dividing by 100. That should be able to give me % of 0 to 99.
It does not have to be 100% accurate, but good enough to show that basic content left in the tank. The opto idea seemed to be a good idea, but i have no idea how to do this. I have some knowledge of electronics, but do not know where to start on this project. If it could work without the opto isolator then perhaps that would be good enough. If i wanted to use a resistive divider what would i need resistor wise. The sender varies from 0 - 80 ohms, Voltage i guess would be taken from the netduino 3.3v line ?.

#11 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 July 2012 - 04:29 AM

15 feet is not too far, but neither so close. Since your sensor has a very low resistance, I think the circuit could be pretty simple. Well, about the opto, it has to be isolated if the sensor shares one lead with the tank chassis. Otherwise, if both the sensor leads are fully isolated from the tank (I mean also the sensor body), you don't need an opto-isolation. That's simplifying a lot. If your tank holds 30 gals, one gallon more or less is too inaccurate? That would be about 3%. I mean supposing there is 22 gals in the tank, your read will range from 21 to 23. A decimal would not have sense since the limited precision. Otherwise, is it better for you having an error much lower than above? Please, bear in mind that the sensor itself should have its own precision, so you can't build an high-precision meter, and connecting a low-precision sensor.
Biggest fault of Netduino? It runs by electricity.

#12 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 04 July 2012 - 05:42 AM

Yes, i understand your point that if the sensor is not high precision then you cannot display high precision. The sender is totally isolated from the tank , in fact the tank is plastic. Perhaps it might make more sense to say display 10 bars max, this is not high presicsion but might suffice. If i can find out how to wire it all up, then i could mess around with the input values to decide how precise i can get. So if i am using 3.3v and the sender is 0-80 ohms, what value resistance would i need for this to work best in a divider setup????.

#13 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 04 July 2012 - 05:52 AM

Okay, now the things are getting very clear. I think you can solve your problem with a simple voltage divider, let me a bit for calculating the best solution. About the sensor connection, I think there's no problem for the wiring. However, I would strongly suggest to use a coaxial cable. The shield will be connected to the Netduino common ground. The sensor will be wired to both shield and core. That's because the Netduino analog input will be exposed to any potential discharge (e.g. a lighting falling in the nearby). To keep it safe, the best thing is to use a coaxial cable, with the ground connected only to the Netduino side. Again, by the sensor side the cable must be wired *only* to the sensor, which is isolated. I mean "sensor isolated" also from the contained liquid, which can be conductive. Which kind of material the tank will contain? Cheers
Biggest fault of Netduino? It runs by electricity.

#14 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 04 July 2012 - 06:12 PM

Okay, now the things are getting very clear.

I think you can solve your problem with a simple voltage divider, let me a bit for calculating the best solution.
About the sensor connection, I think there's no problem for the wiring. However, I would strongly suggest to use a coaxial cable. The shield will be connected to the Netduino common ground. The sensor will be wired to both shield and core.
That's because the Netduino analog input will be exposed to any potential discharge (e.g. a lighting falling in the nearby). To keep it safe, the best thing is to use a coaxial cable, with the ground connected only to the Netduino side. Again, by the sensor side the cable must be wired *only* to the sensor, which is isolated.
I mean "sensor isolated" also from the contained liquid, which can be conductive. Which kind of material the tank will contain?

Cheers


Hello, i guess the solution is pretty simple....

3.3v
|
|< sender 0-80 ohms
|
|---- input to ADC
|
|< 100 ohm resister
|
|
| 0V

thanks guys :-)

#15 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 04 July 2012 - 06:15 PM

Hello, i guess the solution is pretty simple....

3.3v
|
|< sender 0-80 ohms
|
|---- input to ADC
|
|< 100 ohm resister
|
|
| 0V

thanks guys :-)


Close, but the ADC is referenced to ground, so if you connect it as follows:

3.3v
|
|< 100 ohm resister
|
|---- input to ADC, Max voltage = 1.466 vdc @ 80 ohms
|
|< sender 0-80 ohms
|
|
| 0V = ground

You can then scale the analog input for 0 to 100% scale.

Current with sender at 0 ohm = 33 ma.
Current with sender at 80 ohm = 18 ma.

If you connect the way you have it drawn the ADC will see:
3.3 vdc at 0 ohms
1.83 vdc at 80 ohms

Chuck




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.