Unipi 1.1 Analog Inputs
-
I have a rain sensor from VELUX VXPRVX00081.
I would like to measure the voltage at the 220K resistor. I need the lowest current possible to avoid electrolysis on the sensor so I think I can't acheive the bottom diagram.
With the top diagram, my multimeter read the correct value of the voltage. More water, more current, more voltage. But once plugged in the AIx the value return by the MCP3422 is always at maximum.
I'm using an external 12V power supply because of the internal sensor heater. The grounds are not connected together.
I'm reading the value from cpp program with WiringPi and mcp3422.h. The gain is b00, the sample_rate is b11 and LSB 15.625. I red The K factor from the EEPROM.
Here the _read funtion:float Analog_Input::_read() { std::lock_guard<std::mutex> lock(*i2cMutex); float value; value = analogRead (MCP3422_PIN_BASE + this->getChannel()) - 16; //std::cout << std::to_string(value) << std::endl; value = value * this->lsb / 1000 * this->getK() / 1000; //std::cout << std::to_string(value) << std::endl; return value; }So why I can't read the value of the voltage on the resistor, how to do ?
Thanks in advance.
Giamba.
