1

Does anyone have any ideas on how I can use RPI with ADC to measure a tank level sensor which has a range of only 20 to 200 ohm.

tlfong01
  • 4,665
  • 3
  • 10
  • 24
AussieBrad
  • 11
  • 1
  • Hello, a link to the sensor might be appreciated to better form an answer. You might also get better replies if you can show what you've tried or researched yourself (so we don't repeat the effort). – Roger Jones Jun 13 '19 at 07:48
  • Ah, let me see. You can connect the variable resistance sensor in series with a fixed resistance, say, also 200 ohm, to a 3V3 voltage source. Then use an ADC, such as MCP3008 to measure the voltage across the fixed 200 ohm resistor. – tlfong01 Jun 13 '19 at 07:49
  • Or you might like to let us know which of the modules in the following post looks like your module - https://raspberrypi.stackexchange.com/questions/98491/water-level-detection-sensor-3-3-volt-vs-5-volt – tlfong01 Jun 13 '19 at 09:28
  • @tlfong01 A Wheatstone Bridge and a differential OpAmp and/or ADC would normally be used for small resistances. This is really sensitive but can also minimise the current used. – Roger Jones Jun 13 '19 at 09:54
  • @Roger Jones - Oh yes, Wheatstone Bridge. You remind me of my Wheatstone Bridge project not too many months ago. (1) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&hilit=wheatstone+bridge#p1393745 (2) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&hilit=wheatstone+bridge#p1394700 (3) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1405171&hilit=wheatstone+bridge#p1405402 – tlfong01 Jun 13 '19 at 12:52
  • 1
    I'm finding the wording of this question confusing, but will the opamp set-up in the answer here help? (Maybe I missed your point though.) https://raspberrypi.stackexchange.com/questions/76079/tmp36gz-ds1822-temperature-sensors-not-outputting-any-values/76091 – Brick Jun 13 '19 at 14:57
  • the answer to your question is yes ... do you really want to ask a question that has a yes/no answer? – jsotola Jun 13 '19 at 15:43
  • @jsotola It's an idiomatic way of asking how to do it. – Mark Smith Jun 14 '19 at 07:47
  • @Smith - glad to read your comments about idioms. The "idiom" is a bit hard to explain, because it is often culture dependent. Everyday idiom is no big deal here. What is causing problem is "technical" idiom. From time to time I read software guys complaining they don't understand a hardware related question. And vice versa, hardware guys don't understand software guys's questions. I often find the questions clear. It is just because each side does not understand the other side's technical idiom or jargon. I sometimes suspect that software guys and hardware guys think differently, . – tlfong01 Jun 14 '19 at 13:12
  • / continued from above - I think the problem is not just a language gap, but also a culture gap. For example, young guys in Asia respects old guys more than UK young guys do, and UK young guys respect old guys more than US young guys do, ... In the IT field, all old (experienced) guys are in big trouble, because they (wrongly) think that young ones should respect them more. The old ones often don't realize or do not want to admit that their knowledge and skills are becoming obsolete faster than they think. – tlfong01 Jun 14 '19 at 13:27
  • @AussieBrad, I measured 5 of my level sensors and found all of them have resistances of order 0.5 ohm. I searched Amazon but could not find any sensor with resistance 20 to 200 ohm. Did you DIY your own sensor? If not, please give me a web link to you sensor. Thanks. – tlfong01 Jun 15 '19 at 03:04

1 Answers1

-3

Question

Does anyone have any ideas on how I can use RPI with ADC to measure a tank level sensor which has a range of only 20 to 200 ohm?


Short Answer

Some months ago I played with a couple of moisture sensor / level detectors. Below is an example.

water level sensor Water Level Detection Discussion - Rpi StackExchnge

However the above sensor does not answer the OP's question, which asks to detect resistance using ADC, not analog or digital voltage levels. So I think I need to start from a variable resistance and check out how to use ADC to measure the resistance, within a range of 20 to 200 ohms.

I very surprisingly found that all the five samples from different manufacturers have the same resistance of 0.5 ohms for each of the two resistive "legs".

level sensor resistance

Anyway, I think I can try to use an ADC that can measure my sensor's 0.5 ohm range, and also the OP's 20~200 ohm range. I am thinking of starting with the cheapest, and lowest resolution ADC/DAC PCF8591. If its low resolution is not enough for 0.5 ohm range, then perhaps I will try others, such as MCP3x02/04/08. The good thing about PCF8591 is that there is cheapy module available, and programming easy, so is newbie friendly. On the other hand, MCP3x02/04/08 is big family of ADCs, from 12 bits to 18 bits (MCP3404)

PCF8592

mcp3x020408

level_sensor 1

level sensor 2


Long Answer

/ long answer to prune later, ...

Introduction and Summary


Question Analysis

  1. I think the preliminary functional spec of the project is very good, because it is concise and precise.

  2. There are many reasons that the question is so short, but I will not list my wild guesses for now. Perhaps later.

  3. The spec includes the following key words/phrases:

    "Rpi, ADC, tank level sensor, 20Ω ~ 200Ω.

  4. The word "tank", is crucial. She says "tank", not "container", perhaps she wants to indicate that the "tank" is deep , say, not a 5 inches deep fish "bowl" or "pond".

  5. The phrase "20Ω ~ 200Ω" is also crucial. There are basically two types of liquid level sensors: active and inactive. Active sensors are usually 5V or 12V powered, and the sensor output is a DC voltage level. Inactive sensors don't have any power. Usually the sensor is just a reed switch and floating magnet, or a long "resistor" whose resistance varies as the water level. Usually the resistor is far, perhaps 10ft, and up to 1,000 ft from the measuring instrument.

References

(1) Water Level Detection Discussion - Rpi StackExchnge

(2) AliExpress Level Sensors

(3) AliEXpress Non-contact Level Sensors

(4) AliExpress10A/250V Water Level Controller Module

(5) AliExpress Water level sensor Water drops tester

(6) AliExpress 5~24V 5mA Non-contact Induction Water Level Sensor

(7) Gig (ee, rpi, arduino) projects

(8) ph Sensor using sensor and ADCs PCF8591 and MCP3208

(9) How to use Rpi [python] to read [SPI MCP3008] ADC of a [water] tank level sensor? [Too many down votes make ext and imaged blurred]

(9a) Clear version of Ref (9)

(10) MCP3008 outputting just zero

(11) Rpi reading only zero output results from SPI 10-bit ADC MCP3008 problem

(12) How to increase sampling rate [higher resolution using MCP3208] on MCP3008 in python

(13) Interpreting voltage output on ADC with rated AC current sensor [MCP3008/MCP3208

(14) MCP3008 with photoresistor [nonlinear LDR], analog to digital, noisy readings

(15) How to use Rpi python to control PCM1802 24-bit HiFi stereo ADC and MAX4466 microphone amplifier


End of Answer

tlfong01
  • 4,665
  • 3
  • 10
  • 24