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

    Unipi 1.1 Analog Inputs

    Scheduled Pinned Locked Moved Unipi 1 - First Generation
    1 Posts 1 Posters 599 Views
    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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post