# Inconsistent resistance measurement in H-bridge

I have an H-bridge circuit that is meant to measure the voltage across the shunt (330 resistor) and load (pictured as 4700, but variable) to calculate the resistance of the load (I have added the 10k to lower the voltage across the other two components). The H-bridge reverses the direction of the current every .01 seconds, and the transistors are activated by GPIO pins from a Raspberry Pi. I am measuring the voltage using an ADC differential Pi. (https://www.abelectronics.co.uk/p/65/adc-differential-pi) When measured the voltages across the shunt and the load are not in the same ratio between flips, e.g (0.070984375 V and 1.013546875 V in one direction and 0.0710781250000001 and 1.01421875 V in the other direction).

The voltages being different between different directions is not my issue, so much as the fact that the ratio between the voltages is inconsistent. The voltages in a given direction are consistent between handheld voltmeters and multiple ADC boards that are run using the Pi. I have tried changing the base resistors for all four transistors and changing the input voltage but nothing fixes the problem.

• Did you match the transistors before measuring? Commented Nov 25, 2023 at 21:30
• At what point in the overall cycle (with reference to the alternation switch points) do you sample the signals and how many samples do you average? Or, is my question misunderstanding what your problem is (maybe be more explicit). Commented Nov 25, 2023 at 22:15
• Do us a favour and compute and post the ratios. Do yourself a favour and round off some of those spurious decimal places to leave an engineeringly appropriate number of significant figures on your voltage readings. Are those the settled readings, or do they change some more as you continue to read? Commented Nov 25, 2023 at 22:31
• @user55924 I have matched the PNPs and NPNs (e.g. two 2N3904s) respectively by their product code. If I need to do something different could you advise? Thank you.
– TTSB
Commented Nov 27, 2023 at 16:13
• @Andyaka The circuit is run on Python, there is a while loop in which the transistors are activated by the GPIO pins, the readings are taking using the ADC and transistor are turned off. There is a flag in the while loop to activate each pair of transistors alternately. In other words the readings are taken as soon as possible after the transistors are turned on and there is no time delay in the loop. The sample rate is 3.75 SPS.
– TTSB
Commented Nov 27, 2023 at 17:05