• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Unipi 1.1 Analog Inputs

    Unipi 1 - First Generation
    1
    1
    175
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Giamba last edited by Giamba

      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.
      WhatsApp Image 2025-06-14 à 14.59.27_cbf19f60.jpg

      1 Reply Last reply Reply Quote 0
      • First post
        Last post