Difference between diff01 and diff23 on ADS1115

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

Is there an internal difference between the two differential inputs on the ADS1115? I am using the ADS1115 to monitor light levels from an LED using two identical light sensors. I have a temperature compensation algorithm that I wrote controlling the brightness of the LED across a range of temperatures. So, the brightness on my reference light sensor (which is right next to my sense sensor) is beautifully stable from 36F to 120F. So, I am assuming that the LED brightness is constant. I connected the output from the reference light sensor (which is now a temperature-compensated 2.5V) as one input for my diff01. I then have the output from my sense light sensor connected to the other end of diff01.

So, I would assume that with a stable LED brightness shining at two identical light sensors, I would have a stable diff01. No such luck. I am using diff23 to measure the output of the reference light sensor as compared to a 2.5VDC reference. Is this my problem? Do I need a temperature-compensated 2.5VDC reference as well?

Or, is there an internal difference on the ADS1115 chip between diff01 and diff23?

Many thanks.

Ryan

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Difference between diff01 and diff23 on ADS1115

Post by adafruit_support_bill »

There is no internal difference between the two sets of differential inputs. But there are a whole lot of other possible variables:
two identical light sensors
Have you hand-matched and calibrated them both to the same standard? What happens if you swap sensor connection?
a stable LED brightness shining at two identical light sensors
At identical distances and same point in the radiation pattern of your emitter and with no extraneous light? What happens if you swap sensor positions?
Do I need a temperature-compensated 2.5VDC reference as well?
From your description, it is hard to say what would be subject to temperature changes and how you are measuring them. Will all the electronics be subject to the same ambient temperatures? Are you measuring the temperature of the emitter? The whole circuit? Both?

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

Thanks for your help.

Great news about the internals. It seems to be a game of removing variables at this point.

I have not matched the sensors, but they are right next to each other and the signal still varies with temperature, so I am inclined to think that that is the problem.

The more I think about it, I think that my 2.5VDC reference voltage is the problem.

Is there a way to use the TLC59711 Adafruit 16-bit PWM LED Driver to generate a reference voltage? I am using that to modulate the supply voltage to the LED to keep its brightness constant. How could I wire up the TLC59711 to the ADS1115 to allow me to generate and control a reference voltage?

Also, I am using a thermal chamber to control for temperature. It is sealed from visible light. The sensors are light-blocking. And I am using an IR LED for this setup. So, there are very few uncontrolled things at this point... except the 2.5VDC reference voltage. I know the Arduino supply voltages vary with temperature.

And yes, everything would be at the same ambient temperature. But, temperature really matters for this application. If someone keeps it in their trunk and brings it inside, I need it to work consistently. The LED + sensor setup is really sensitive to temperature.

Thanks!

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Difference between diff01 and diff23 on ADS1115

Post by adafruit_support_bill »

I don't know what you are using for an LED, but light output will change with the die temperature, which can be considerably warmer than ambient for high-powered emitters. Output will also decrease with operating time. For critical electro-optical instrumentation, regular calibrations are the norm.
Is there a way to use the TLC59711 Adafruit 16-bit PWM LED Driver to generate a reference voltage?
Not that I know of. You are probably better off with a device designed for the purpose such as this one: http://www.maximintegrated.com/datashee ... vp/id/4212

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

Thank you for your continued advice Bill (I am assuming that is your name)

Last night, I tried something different.

I have a single, high-power IR LED that I bought from Adafruit.
That LED points at two TSL262 IR light sensors.
The output from one of the sensors (reference) is connected to ADC0 on the ADS1115.
The output from the other sensor (sense line) is connected to ADC2 on the ADS1115.
ADC1 and ADC3 are connected to an external CC power supply (Agilent E3631A) providing 2VDC via a long BNC cable that runs out of my thermal control chamber. I did this to eliminate fluctuations in what was being "diffed" on the ADS1115.

However, no such luck.

Using the TLC59711 to control the LED, I can control the brightness of the IR LED using the signal from the reference light sensor to keep its value steady. However, the other sensor is then still subject to changes in apparent brightness that correspond with the changes in temperature, here evident in the periodic turning on/off of the heater to keep the thermal chamber at 72F.

The code I am using to control the LED brightness as the temperature changes is this:

Code: Select all

      
void compensate_for_LED_brightness()
      {
          monitorBrightness();
          
          if(smoothed_sense < target_irradiance)
          {
            intensity++;
            setLED(intensity); 
          }
          else if(smoothed_sense > target_irradiance)
          {
            intensity--;
            setLED(intensity); 
          }
      }
      
      
      void monitorBrightness()
      {
          diff01 = ads.readADC_Differential_0_1();   
          diff23 = ads.readADC_Differential_2_3();  
          normalized_ref   = constrain(diff23 + 32767, 0, 65535);
          normalized_sense = constrain(diff01 + 32767, 0, 65535);
          Vsense = ((float)normalized_sense * multiplier) / 1000.0;
          Vref   = ((float)normalized_ref   * multiplier) / 1000.0;
          smoothed_ref    = digitalSmooth(normalized_ref, smoothArray_ref); 
          smoothed_sense  = digitalSmooth(normalized_sense, smoothArray_sense); 
          aged = smoothed_sense + (driftcomp * seconds);
      }


I have tried switching sensors and witness the same result. The compensated value remains steady as the temperature changes while the sense line varies directly with temperature.
Using the TLC59711 to control the LED, I can control the brightness of the IR LED using the signal from the reference light sensor to keep its value steady. However, the other sensor is then still subject to changes in apparent brightness that correspond with the changes in temperature, here evident in the periodic turning on/off of the heater to keep the thermal chamber at 72F.
Using the TLC59711 to control the LED, I can control the brightness of the IR LED using the signal from the reference light sensor to keep its value steady. However, the other sensor is then still subject to changes in apparent brightness that correspond with the changes in temperature, here evident in the periodic turning on/off of the heater to keep the thermal chamber at 72F.
Drift comparison w sense comp.jpg (240.09 KiB) Viewed 372 times
Am I connecting things to the ADS1115 wrong? Does the VCC for the ADS1115 need to be temperature compensated as well? I am really lost now...

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

Okay, I tested changing the source voltage (VDD) to the ADS1115 and found that is makes a HUGE difference in what the readings are for the board. I am a bit surprised how much of an effect this has actually. I tried varying the VDD from 5V to 4V to 3V and back and recorded the input using the same code I am using for my project. I figured I would keep as much the same as possible.

Here are the results:
Effect of VDD on ADS1115.jpg
Effect of VDD on ADS1115.jpg (117.53 KiB) Viewed 361 times
So, to fix that I hooked up a REF02 precision 5VDC voltage reference to VDD on the ADS1115. It seems to have enough umph to power the ADS1115 (again, I am not an EE) and everything was working before I put it in the thermal chamber. I started the board off at 70F and then raised the temp to 110F (it heats faster than it cools) ... same problem.

The REF02 is supposed to be very thermally stable, so I figured this would be a big improvement over the Arduino-supplied 5VDC which I know changes with temp. Alas... no.
Diff with precision 5VDC VDD.jpg
Diff with precision 5VDC VDD.jpg (180.75 KiB) Viewed 361 times
This graph was made with ADC1 and ADC3 being supplied with 2.5VDC from a lab power supply that is outside of the thermal chamber.

I am running out of things to change...

Here is my routine:
  • 1) Monitor the brightness of the LED using the reference sensor.
    2) Change the PWM value coming from the TLC59711 to keep the LED brightness the same (independent of temp)
    3) Record both the reference and sense values of the light sensors every 1000ms on an SD card.
    4) Both diff01 and diff23 share an externally supplied 2VDC source.
    5) Both light sensors are the same type (and if not matched, should exhibit similar characteristics)
    6) There is a single IR LED pointed at both light sensors
The sense signal (the green line) floats EXACTLY with the fan on the thermal chamber turning off and on to maintain a stable temperature inside of itself.

Bah. :?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Difference between diff01 and diff23 on ADS1115

Post by adafruit_support_bill »

If you post a diagram and/or photos of your setup we might be able to spot the problem.

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

Here are some pics of my breadboard:
photo 2.JPG
photo 2.JPG (575.77 KiB) Viewed 360 times
photo 3.JPG
photo 3.JPG (951.49 KiB) Viewed 360 times

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Difference between diff01 and diff23 on ADS1115

Post by rbardsley »

I don't have a schematic yet. But, everything is generally hooked up according to the Adafruit tutorials.

Is there a Fritzing part for the TLC57911 yet?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”