0

I am trying to setup a thermistor(PT1000) to work with arduino. For that I used voltage divider and 5V pin as the voltage source. I was getting very unstable results so I removed the thermistor and used 2 1kOhm resistors instead.

I was still getting results ranging from very close to true value of 1kOhm to 1.2kOhm. For reference, 4 Ohms are equivalent temperature change of 1 degree celsius.

I measured the voltage drop of each resistor and was surprised that it is far from equivalent. Check the video of full setup and the closeup wiring of the voltage divider - https://easyupload.io/5fctxm

enter image description here

I cannot explain the 0.3V voltage drop difference between two resistors of the same rating (resistance of 1000 Ohm +-0.5% was verified by multimeter) in any other way but that the breadboard contacts and jump wires are not suitable for accurate voltage measurement. Can someone with more experience confirm if my breadboard is broken or is such behaviour intended.

8
  • Have you measured the resistance of each resistor? That they are rated with the same resistance doesn't mean they have the same resistance. Depensing on what exactly you have you can get +-5% or +-1%
    – chrisl
    May 29 at 13:27
  • Welcome to Arduino:SE. This looks like a question about electronics / electrical engineering, rather than Arduino. May 29 at 13:27
  • Exactly where are you measuring a voltage that is 0.3V different (less than? more than?) from what you expect? Bread boards are good for saturated circuits (i.e. digital) but not great for some analog. And terrible for high frequencies. Values for resistor dividers are picked high enough to limit current (i.e. mitigate power requirements and unwanted voltage drops) and low enough to mitigate noise. I would try to remove any oxides by repeated insertions and measure again.
    – st2000
    May 29 at 13:27
  • @chrisl Resistors were also measured and are within 0.5% tolerance.
    – sanjihan
    May 29 at 13:42
  • @st2000 The voltage is measured across the 5V pin and first resistor in one case and across second resistor and the ground in the other case. The video shows more than the image.
    – sanjihan
    May 29 at 13:44

2 Answers 2

3

In order to assess the stability of analog readings on a breadboard, I did an experiment very similar to yours. I plugged two 1 kΩ resistors on a breadboard, connected in series between my Arduino's GND and +5V. I connected the middle point to A0 and made an histogram of one million consecutive calls to analogRead(A0).

Here is my test code:

const int histo_length = 64;
const long histo_count = 1000000;
long histo[histo_length];
int histo_start;

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

    // Center the histogram on the average reading.
    int sum = 0;
    for (int i = 0; i < 16; i++)
        sum += analogRead(A0);
    int average = sum / 16;
    histo_start = average - histo_length/2;

    // Fill the histogram.
    Serial.println("Ouliers:");
    for (long i = 0; i < histo_count; i++) {
        int x = analogRead(A0);
        if (x >= histo_start && x < histo_start + histo_length)
            histo[x - histo_start]++;
        else
            Serial.println(x);  // print oulier
    }

    // Print it out.
    Serial.println("Histogram:");
    for (int i = 0; i < histo_length; i++) {
        Serial.print(histo_start + i);
        Serial.print(" ");
        Serial.println(histo[i]);
    }
}

void loop() {}

Note that the full histogram would not fit in the memory of my Uno, hence the trick of printing out the outliers instead of recording them.

And here is the resulting histogram:

508 0
509 39386
510 960567
511 47
512 0

All other histogram bins were empty (no outliers).

As you can see, 96% of the calls returned 510. Most of those that did not return 510 returned 509, and less than 0.005% of them returned 511. The RMS dispersion of the readings is about 0.04 ADC steps.

I can hardly imagine anything more stable than this.

1
  • 1
    Very cool, thank you. I later deduced that my breadboard has faulty connectors. 1kOhm measured with multimeter is evaluated at 996 Ohms. When connected to breadboard it was from 1000 to 1200 Ohms. This was my first time using breadboards so it caught me completely off guard.
    – sanjihan
    May 29 at 15:58
1

Schematics even for such a question are indispensable.

Assuming from the following:

I cannot explain the 0.3V voltage drop difference between two resistors of the same rating

... means the voltage across each of 2 different resistors both labeled 1K Ohms in series with the same 2.1K Ohm resistor connected to 5V and 0V is different by 0.3V.

schematic

simulate this circuit – Schematic created using CircuitLab

If the two 1K Ohm resistors are assumed to be 0.5% (5th color band green) and the 2.1K Ohm resistor is perfect as well as the 5V potential. Then a 1K Ohm resistor of, say, 0.5% less impedance would be 995 ohms. And another, say, 0.5% more impedance would be 1005 ohms. The voltage across the 1st in this resistor divider circuit would be 1005 x ( 5 / (1005 + 2100)) or 1.62V. And the 2nd would be 995 x (5 / (995 + 2100)) or 1.61. This is a difference of 0.01V. That is less then the measured difference between the two different 1K Ohm resistors given the maximum possible percent error of 0.5%.

So the the 0.3V difference between voltage readings of the two different 1K Ohm resisters are difficult to account for. Perhaps cleaning the connections may improve the measurements.

8
  • Thank you. Both resistors are 1kOhm with 0.5% tolerance, verified by multimeter. I omitted the breadboard from all the connections and now the resistance readings are as expected.
    – sanjihan
    May 29 at 14:19
  • I few days ago, when I was connecting lcd, I experienced a similar problem. If I touched the wires a little, the display went "crazy". For this one, I made a gif :D im.ezgif.com/tmp/ezgif-1-eabc871208.gif
    – sanjihan
    May 29 at 14:20
  • Note, you may find most resistors are at the extreme edge of their specified tolerance. This is likely due to the manufacture filtering out the more precise resistors for a higher price. You were updating the LCD constantly making it more susceptible to intermittent connections. It might be if you stopped updating it and touched the wires, less or nothing would happen.
    – st2000
    May 29 at 14:27
  • Nuts, there's an error in the Answer and the difference is no where near 0.3V.
    – st2000
    May 29 at 14:33
  • 1
    It is likely more random than consistently a few ohms. This is why I initially said breadboards are good for saturated circuits (i.e. digital) and not so great for some analog and bad for high frequencies. Again, if important, use clean wires and work any oxidation off. Also, I didn't realize you were basing your ADC measurements off of 1 sample. This is usually never done because of noise. As this is embedded software (limited memory) I suggest using exponential averaging.
    – st2000
    May 30 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.