ADG715 using Arduino due

I'm using an Arduino Due board to connect with an ADG715 analog switch using the I2C protocol. In ADG715 , 1st and 2nd channels connect with 4 resistors. For the output , I need the resistor value of what I'm connecting in both channels. Can check my code and tell how to solve it?.

#include <Wire.h>

#define ADG715_ADDR 0x4B  
#define CHANNEL_1_ADDR 0x01 // --Channel 1 address
#define CHANNEL_2_ADDR 0x02 // --Channel 2 address

void setup() 
{
  Wire.begin(); 
  Serial.begin(9600); 
}

void loop() {
  
  for (int i = 0; i < 4; i++) 
  {
    closeResistor(CHANNEL_1_ADDR, 1 << i);
    Serial.print("Channel 1 resistor ");
    Serial.print(i+1);
    Serial.println(" closed");
    delay(5000); 
  }

  
  //  for (int i = 0; i < 4; i++) 
  //  {
  //    closeResistor(CHANNEL_2_ADDR, 1 << i);
  //    Serial.print("Channel 2 resistor ");
  //    Serial.print(i+1);
  //    Serial.println(" closed");
  //    delay(20000); 
  //  }
 }

void closeResistor(uint8_t channel, uint8_t resistor)
{
  Wire.beginTransmission(ADG715_ADDR); 
  Wire.write(channel); 
  Wire.write(resistor); 
  Wire.endTransmission(); 

  delay(100); 
}

don't understand what this means?

  • the adg715 is 8 analog switches. when one of its switches are enabled, it will pass the voltage from the pin on one side of a switch to the pin on the other side of the switch

  • how do you expect to measure the resistor value? are you measuring the voltage across it knowing the current passing through it?

  • looks like the code is reading the switch position, whether the switch enabled or not, 0/1. the other side of the switch needs to be connected to an analog input in order to read the voltage through the switch

or am i misunderstanding?

Yeah, you are right. I'm not measuring voltage or current. But what I need to be is totally 8 resistors are connected in each switches of adg715. Can possible to get resistor values?

yes, but it's not obvious how they are connected nor why you need the analog switches?

Testing for RTD, for my college project.

???

RTD-Resistance Temperature Detector

don't understand why you haven't explained the circuit, how it is connected, what you expect to measure, how you expect to measure it and how you expect to compute the resistance


Hi, This is my circuit .sorry for delay. I need to measure resistor values through multimeter in RTD+1 and RTD-1.

Today I'm updated my code ,check and remind if any mistake.

don't this circuit.

looks like you can place 2 resistors in series with 4 other resistors aad connect the 2 ends of the series resistors together

  |------- RX --- R1 --------|
  | |----- RX --- R2 ------| |
  | | |--- RX --- R3 ----| | |
  | | | |- RX --- R4 --| | | |
  | | | |              | | | |
  | | | |------/ ------| | | |
  | | |--------/ --------| | |
  | |----------/ ----------| |
  |------------/ ------------|

don't understand how you expect to measure resistance with such a circuit

you could put a known and unknown resistor in series, connect one end to ground, the other end to a known references voltage, the common point to an ADC to measure the voltage and compute the unknown resistance value from the voltage

1 Like

to measure the resistance, wire the circuit as follows and measure the voltage at the analog input. the resistance is

    Runknown     = Rref * (1 - V) / V
      Vref
       |
    Runknown
       |
       |------AnalogIn
       |
     Rref
       |
      Gnd

The max on resistance of the ADG715 is 4.5 ohms.
If you are trying to measure the resistance of an RTD100 your error could be as high as 4.5%!
Is that good enough?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.