# Measure resistance: (NHS3152)

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

## Measure resistance: (NHS3152)

2,067 Views
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)
• ### NFC Controller Solutions

1 Solution
1,616 Views
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.

6 Replies
1,617 Views
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,616 Views
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);

{

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

}

return Chip_I2D_GetValue(NSS_I2D);

}

1,616 Views
NXP Employee

Hi Rex,

Kind regards,
Dries.

1,616 Views
Contributor II

Hi Dries

Best

Rex

1,616 Views
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.

1,616 Views
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.