8 Replies Latest reply on Apr 22, 2016 1:05 PM by Intel Corporation

    Edison ADC Converter Logic on 3.3V

    NickMC

      Hi,

       

      I am trying to read different sensors on the same board and I have been having some difficulties. I am using a digital temperature sensor which requires my to change the J9 jumper to 3.3 volts so that the internal pull up resistors do not pull the SDA and SCL lines up to 5 volts and kill my sensors. But then the analog sensors I have on A1 and A2 pins do not seem to work properly. I'm betting this has to do with the logic levels of the ADC converter right?

       

      do i need to apply a different voltage to AREF or is it a software change?

       

      Thanks,

      Nick

        • 1. Re: Edison ADC Converter Logic on 3.3V
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi NickMC,

          In the following document there is a description of the IOREF and AREF jumpers, in case you want to check how they can be used: https://communities.intel.com/docs/DOC-23455

          On the other hand, what are the outputs of the A1 and A2 pins when working with 5V and 3.3V? Are you working from the Arduino IDE?

          Regards,
          Diego

          • 2. Re: Edison ADC Converter Logic on 3.3V
            NickMC

            Hi Diego,

             

            I have used this document previously to change the IOREF Voltage to 3.3v. The trouble i am having is when i use analogread() to read the input of the pins A1 and A2,

             

              sensorValue = analogRead(SENSOR_PIN);

             

            I was getting sensor values of any number between 0 and 1023 like 1,5,8,9,57,64,195,206,207.

            But when I change the IOREF to 3.3v I only get bit numbers like 0,1,2,4,8,16,32,64,128,256


            This means that the accuracy is heavily reduced. as there is a huge difference between 128 and 256.


            But the input has not changed. I have one sensor that provides analog signal voltages between 200mV and 900mv max to pin A1 and another sensor that provides analog signal voltages between 0 and 5v max to pin A2. and i want to be able to read the voltage and display a corresponding value.


            I am working in the Arduino IDE.


            Any help would be appreciated,


            Regards,

            Nick

            • 3. Re: Edison ADC Converter Logic on 3.3V
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi NickMC,

              I did an analog reading test with both, 5V and 3.3V. The test with a reference of 5V was normal. Then, I changed the J9 jumper to set the reference to 3.3V. At first, I noticed the same behavior you described. Then, I rebooted the board (keeping the J9 in the 3.3V position), uploaded the test sketch again and this time I got better results and numbers from 0 to 1023. 

              Could you run the test again and check if you get better results this time? Make sure you power up the board with the jumper set to 3.3V. If you can save the values in a txt file and attach it in your next post would be great.

              Additionally, if you set the analog reference to 3.3V, you must use analog signals up to 3.3V. This means that you should not use the sensor that provides values from 0 to 5V.  You should use a voltage divider to limit the maximum value to 3.3V, otherwise the ADC might be damaged.

              Regards,
              Diego

              • 4. Re: Edison ADC Converter Logic on 3.3V
                NickMC

                Hi Diego,

                 

                Sorry about the other post I thought that disabling the internal pull up resistors on the Edison was a different topic, but if you don't think it will help then OK. Just out of curiosity, is it possible to read the SDA and SCL pins without them being internally pulled up?

                 

                In regards to this post, I have been unable to get numbers between 0 and 1023. I have moved the J9 jumper to 3v3, rebooted, re-flashed, reloaded code, nothing works. After doing all three of the above, I get the results in the file attached. When the sensor is attached I get values of 128 and 256 and when disconnected it floats between 32,64,128. There is an odd 130 in there but i don't know why.

                I am using

                • Intel® Edison module with an Arduino* expansion board.
                • Arduino sketch 1.6.0
                • edison-image-ww18-15.zip

                The sensor i am currently using provides mV values of 300 to 1100 which should be easily readable by the ADC and if it divides values of 0 - 2.5V into 1023 levels that should be a precision of 2.5mV. Correct?

                 

                Thanks,

                Nick

                • 5. Re: Edison ADC Converter Logic on 3.3V
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi NickMC,

                  Yes, that was a different topic, however, since you posted it as a different approach to solve the same issue, it's better to keep the discussion on this thread because at the end, we'd be talking about the same issue.

                  If you disable the internal pull ups, you would have to use external pull ups, so at the end, you would be using pull ups in the I2C lines. 

                  Just to clarify what I said in the other post, if you disable the internal pull ups in order to use external pull ups, you would have to connect them to 5V because the IOREF jumper is in the 5V position. You cannot connect them to 3.3V while the IOREF is set to 5V. That's why replacing the internal pull ups by external ones won't fix the issue because you would still have to connect them to 5V.

                  When you select 3.3V, the ADC can read values from 0 to 3.3V. I believe you are mentioning the range 0 to 2.5V because it appears in the document we discussed earlier, but that range applies when using an external analog reference. 

                  You are not getting values between 0 and 1023 because your sensor's maximum output is 1.1V. I did the test with a potentiometer, so I had variations from 0V to 3.3V, that's why I was able to get values from 0 to 1023. I recommend you to test the analog reading with a potentiometer and an input range from 0V to 3.3V. You should get values from 0 to 1023. If this test works as expected, then the issue is caused by the sensor's output. It's not that the sensor doesn't work, it's that the analog output is not appropriate for the analog input. You would have to add a stage between the sensor's output and the analog input. This is called signal conditioning: https://en.wikipedia.org/wiki/Signal_conditioning

                  I attached a file with the readings I got from the test I did previously. I did the test with the same image version you are using. Notice that the accuracy is not the same when the voltage is low. The measurements are better when the voltage is 1V or higher.

                  Regards,
                  Diego

                  1 of 1 people found this helpful
                  • 6. Re: Edison ADC Converter Logic on 3.3V
                    NickMC

                    Hi Diego,

                     

                    That information is very useful, thank you!

                     

                    I have been able to see some better results on a higher input range on the ADC, will continue to work on this and either look at increasing the input from the sensor or maybe even reducing the reference voltage on the AREF to get better results.

                     

                    Regards,

                    Nick

                    • 7. Re: Edison ADC Converter Logic on 3.3V
                      NickMC

                      Hi Diego,


                      Is there any tricks if I want to use the AREF as 1.2v to try to get better results on the ADC?

                      I have moved the J8 and J9 jumpers to positions 1 and 2 (top if reading the writing on the board) and have applied a 1.2 volt reference to the AREF pin (I tried both).


                      Why are there two AREFs? What is the difference? Which one should I use?


                      Do I need to enable settings?


                      Regards,

                      Nick

                      • 8. Re: Edison ADC Converter Logic on 3.3V
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi NickMC,

                        According to the Arduino Expansion Board's schematic, you should use the AREF located on the header labeled as J2B1, which is the one where the digital IOs are located. The other AREF is not used because internally, it's not connected to anything. If I'm not mistaken, that distribution of the headers is to keep the compatibility with the Arduino R3 footprint.

                        I haven't used an external analog reference before, but you should set the J8 and J9 jumpers as described in this document: https://communities.intel.com/docs/DOC-23455. The position you should use is 2-3. If you see carefully, there is a "3" and an arrow that points to the pin "1" (the pin in the middle is the pin "2"). By default, the jumpers are in the position 1-2, so you have to move them to the position 2-3. Notice that there is no need to move the jumper J9 because that jumper is for the IOREF. The jumper J8 is for the AREF. Check the document I mentioned above for additional details.

                        Now, I'm not sure if reducing the analog reference will produce better results. From what I got in the previous tests, it seems that the ADC accuracy is not the best when the analog signals are low (1V or lower). That seems to be an ADC's limitation. If I were you, I would keep the IOREF and AREF to 5V (the default position for each jumper) and I'd add the signal conditioning stage I mentioned before to get an analog signal from the sensor in the range of 0V to 5V.

                        Regards,
                        Diego