Measure resistance: (NHS3152)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Measure resistance: (NHS3152)

Jump to solution
2,315 Views
tom_sander
Contributor II

Hello NXP Community,

i have a NHS3152 Demoboard and i want to measure the resistance with two Pins.

The resistor is connected to ANA1 and ANA4.
To do this, I switched on the digital to analog converter at pin ANA1 and set it to a continuous voltage of 1.25 Volts. Then I switched on the analog to digital converter and measured the voltage.
To measure the current I first switched off the AD-converter and "disconnected" it from the pin. Then the I2D unit is connected to the pin and the current is measured.
The results nearly correspond to the real resistance. However, the resistance always deviates by about 10k.
My question is now whether I proceed correctly with the measurement and how I find simply the correct scaling of the current for arbitrary resistances.

Maybe, there is an easier way to do this?

sincerely, Tom

Labels (1)
1 Solution
1,864 Views
driesmoors
NXP Employee
NXP Employee

Hello Tom,

The best results require a different sequence.

  1. Set the configuration of the analog pins to IOCON_FUNC_1
  2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.
  3. Connect the I2D to ANA4, configure correctly and start a conversion. Only when a conversion is started, current will start flowing over your resistor. The current will continue to flow when the conversion ends. -> a
  4. Connect the ADC to ANA4, and measure the voltage. -> v4
  5. Connect the ADC to ANA1, and measure the voltage. -> v1

The resistor can now be calculated as (v1-v4)/a

Some notes:

  • Both the DAC output voltage and the gain factor of the I2D must be chosen in correspondence of range of resistance that is to be measured.
  • The NHS3152 is positioned as a therapy monitor; not as a general purpose resistor measurement tool.

Kind regards,
Dries.

View solution in original post

6 Replies
1,865 Views
driesmoors
NXP Employee
NXP Employee

Hello Tom,

The best results require a different sequence.

  1. Set the configuration of the analog pins to IOCON_FUNC_1
  2. Connect the DAC to ANA1, set a continuous conversion of 1.25V.
  3. Connect the I2D to ANA4, configure correctly and start a conversion. Only when a conversion is started, current will start flowing over your resistor. The current will continue to flow when the conversion ends. -> a
  4. Connect the ADC to ANA4, and measure the voltage. -> v4
  5. Connect the ADC to ANA1, and measure the voltage. -> v1

The resistor can now be calculated as (v1-v4)/a

Some notes:

  • Both the DAC output voltage and the gain factor of the I2D must be chosen in correspondence of range of resistance that is to be measured.
  • The NHS3152 is positioned as a therapy monitor; not as a general purpose resistor measurement tool.

Kind regards,
Dries.

1,864 Views
2574155474
Contributor II

Hello Dries

Please help me.How do I convert “int Chip_I2D_GetValue()”  to “**mA” ? What is the formula? for example ,how much mA when the value is 2570 . I used the code of "Therapy Adherence Demo Application"  to init.

Best

Rex

/** * Starts an I2D conversion, waits for completion and returns the I2D value * @pre proper I2D mux should be set. * @return The I2D conversion result in native value (12bits). */

static int GetI2D(void)

{

    Chip_I2D_Start(NSS_I2D);

   while (!(Chip_I2D_ReadStatus(NSS_I2D) & I2D_STATUS_CONVERSION_DONE))

   {

                ; /* Wait until the conversion is finished. */

     }

    return Chip_I2D_GetValue(NSS_I2D);

}

0 Kudos
1,864 Views
driesmoors
NXP Employee
NXP Employee

Hi Rex,

Have a look here: https://community.nxp.com/thread/515267#comment-1222869 

That thread is hopefully helpful to you.

Kind regards,
Dries.

0 Kudos
1,864 Views
2574155474
Contributor II

Hi Dries

I have read the link https://community.nxp.com/thread/515267#comment-1222869 .But the link only talk about how to Convert the voltage,not talk about how to convert current. I want to know how to convert current   "(Chip_I2D_GetValue(NSS_I2D))" .

Best

Rex

0 Kudos
1,864 Views
driesmoors
NXP Employee
NXP Employee

I'm sorry about that, I misread. The I2D SW driver provides an API to do just that: Chip_I2D_NativeToPicoAmpere

You can also have a look at the firmware documentation: <SDK>/docs/firmware.htmlDocumentation of the low-level HW block driversi2d: Current to Digital converter driverExample 1 - Single shot conversion with polling.

Best,
Dries.


 

0 Kudos
1,864 Views
tom_sander
Contributor II

A further question which arises to the topic: If you measure the voltage drop across the resistance, a certain current flows. The question now is whether the same current also flows when you measure the current through the resistor? It is possible that the ADC and I2D units have different input resistors. Or is this effect negligible ? This would falsify the measurement.

0 Kudos