Gravity: Throw in liquid level sensor frustration
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
I purchased the Gravity Throw-In Liquid Level Sensor (SKU: KIT0139) from amazon, and have been unable to get it to be more than a random number generator. I am connecting it to a 24V boost converter (up from 5V), the current to voltage converter to a 5V source, and using a MCP3208 ADC to convert the signal to digital for a raspberry pi. I have it wired identically to the diagram in the wiki. I've been pouring over the code in the wiki for a day now, and aside from finding a unit conversion issue, I haven't been able to figure out how to get reasonable measurements out of it. It thinks it's 1.3-1.5m deep when it's only 30cm, with measurements varying without changing the water level. Here is my python code:
Code: Select all
I'm out of ideas. Nothing about this probe seems to make sense based on the provided information. There's also no datasheet for the probe, and the only calibration curve seems to be the ideally linear relationship between voltage and current for the converter. Am I missing something?import gpiozero
import time
ch7 = gpiozero.MCP3208(channel=7, max_voltage=5.0)
A0 = 0.004
density = 1.0
r = 5000.0
while True:
V = ch7.voltage
A = V/120.0
depth = (A-A0)*(r/density/0.016)
print("{:0.1f}".format(depth))
time.sleep(0.2-time.monotonic()%0.2)
2020-06-16 06:21:37 I don't own an arduino, and the code I supplied uses the same math as the example, with a unit conversion error corrected (A instead of mA). Instead, I tried a 122 ohms of resistors (100+22) in series on the ground leg of the sensor. The circuit was connected to the ADC between the sensor and the resistors. This put the voltage at the measurement point at approximately the same voltages in the wiki. The sensor outputs a mostly stable voltage and the depth reading was almost correct, though still randomly varying +/- 2cm, and could be with some calibration effort. The supplied current to voltage converter is the problem.
wizzlebippi
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)