Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

PH Sensor Issue

Home Forums Environmental Sensors PH Sensor Issue

Viewing 10 reply threads
  • Author
    Posts
    • #12970
      Gera
      Participant
        Hello everybody, I am currently trying to work with the Mayfly board to find pH. I have the pH Electrode E201 – BNC and the board that comes with it is the DIY PH-4502C. I am having a problem wh
      • #12971
        Shannon Hicks
        Moderator

          Which analog pins of the Mayfly are you attempting to use to measure the voltage? And can you share the code you’re using to read the voltage?

        • #12972
          Gera
          Participant
            pin A0,

            here is the code:
            void setup() {
            // initialize serial communication at 9600 bits per second:
            Serial.begin(9600);
            }

            // the loop routine runs over and over showing the voltage on A0
            void loo

          • #12973
            Shannon Hicks
            Moderator
              What pin is the sensor getting power from? If it’s the Switched 5v pin (labeled SW5), or from one of the grove terminals (assuming you’ve moved the jumper over to the 5v setting), you sti
            • #12974
              Gera
              Participant

                The pin is USB5V, I tried using that SW5 as well. I tried using all those slots, all of them gave me the exact same value of 3.73V.

              • #12975
                Shannon Hicks
                Moderator
                  You mean the USB5V on the FTDI header? That’s only used if you’re supplying power to the board via an FTDI adapter when programming. You should definitely be using the SW5 pin for poweri
                • #12976
                  Shannon Hicks
                  Moderator
                    Also, you need to use 3.3 volts as the board voltage in your conversion formula and not 5.0 volts. And if you’re measuring a 50/50 voltage divider, you’ll then need to double the measured
                  • #12977
                    Gera
                    Participant
                      Sorry for the late answer I had some stuff to do.
                      Okay so, the circuit is connected like this:

                      Voltage: V+ which is the 5V DC connected to SW5
                      Ground: Ground to Ground
                      Analog = PO or PH analog output

                    • #12979
                      Gera
                      Participant
                        Also, with the code you provided, if I do not use the voltage divider I can calibrate it to 2.5V if I remove the *2 from the equation. I am first time coder and also the mayfly is something new for me
                      • #12980
                        Shannon Hicks
                        Moderator
                          The way a voltage divider works is for you to use 2 resistors in series, and then you measure the junction between the two resistors, and you’ll see a fraction of the overall voltage. The best
                        • #12981
                          Gera
                          Participant

                            Alright. I am getting the data right. Thank you for your help.

                        Viewing 10 reply threads
                        • You must be logged in to reply to this topic.