0
\$\begingroup\$

I got a strange issue with my Arduino, and more specifically with my breadboard. I got the following circuit:

+5V |----[TMP36]-----| GND
            |
            |
            A0

Where TMP36 is a thermoresistor (datasheet).

When I got this circuit, everything is fine and I got correct measures (temperature of 24°C), which corresponds to a value of 148 (on 1023), namely 0.72V.

Yet, as I would like to add another sensor on my breadboard, I plugged this same sensor between the Power and Ground lines. Here is my schematic:

+5V (Arduino) ------ Power line (+)
                          |
                          |
                       [TMP36] ------ A0
                          |
                          |
GND (Arduino) ------ Ground line (GND)

Here comes the trouble. I got an output value of 81 (so 0.39V). Pretty bad, as corresponding temperature is -11°C.

I can't see any reason for such a difference, but I'm an electronic newbie. :)

Have you any ideas on why such a behavior?

EDIT: adding the breadboard schematic:

enter image description here

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This is likely either a wiring error (misunderstanding of breadboard grid?), or an ADC multiplexing error. What happens if you remove the other chip without changing the software? What happens if you leave the other chip in, but only read the TMP36? \$\endgroup\$ Aug 5, 2014 at 19:08
  • \$\begingroup\$ I used only a single sensor. I modified my question to precise it. For the breadboard grid, I triple checked, and it seems correct to me. I added a picture of it on the post. \$\endgroup\$ Aug 5, 2014 at 19:54
  • \$\begingroup\$ Assuming your Thermosensor pins are connected properly in each case (they aren't shown on your schematics), there is no difference between your two schematics (one is a mirror image and a rotation of the other). The problem must lie somewhere else: Your physical system doesn't match the schematic in case 2; the device pins aren't assigned correctly; the device's analog out isn't connected to the analog pin you're trying to read; there's a short or an open somewhere; etc. \$\endgroup\$
    – JRobert
    Aug 5, 2014 at 21:58

2 Answers 2

0
\$\begingroup\$

First, this device is not a thermoresistor, better known as a thermistor. It is a integrated temperature sensor that produces a voltage output. Whatever is inside that measures the temperature is irrelevant to you, and quite unlikely to be a thermistor.

Second, it's called a schematic.

As for why you're not getting the expected reading, the obvious answer is that you forgot to connect the output of the sensor to a A/D input of the microcontroller. You only have power and ground connected. Hook up the second sensor just like the first, except connect its output to a different A/D input.

Another issue is that some variants of this device have a shutdown input. Make sure that it either floats to the appropriate level, or that you tie it to the appropriate level explicitly. The datasheet should tell you if it is OK to leave open.

Also, you are missing the bypass cap. Put a 1 µF or so ceramic cap accross the power and ground of each sensor, as physically close to the sensor with as short leads as you can manage. I'd probably put a small chip inductor in series with the supply first, then a 10 µF cap around the part. Integrated parts like this usually have some power supply noise rejection capability, but a chip inductor and cap will clean up the power the sensor sees, and are cheap and small.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for your reply. For the A/D input, I just forgot to draw the connection. But it is correctly set. :) I have only a single sensor here. That's why this result seems pretty strange. I'll try to explore the shutdown input. Not familiar with this concept for the moment, even if I read the related paragraph in the datasheet. I will also buy some capacitors to see if it may solve the issue. Even if I find the difference pretty big for only noise. :) \$\endgroup\$ Aug 5, 2014 at 19:42
  • \$\begingroup\$ @JonathanPetitcolas, do you have a voltmeter? It's always good to check numbers with a different 'thing'. If you don't own one, then go pick up a cheap DMM. (Everyone should have at least one.) \$\endgroup\$ Aug 6, 2014 at 2:54
  • \$\begingroup\$ It works now! Indeed, it needed some capacitors. I plugged one of them between power line and ground, and the other one between analogic output and ground. And I got correct stable values. Thanks for your help! :) \$\endgroup\$ Aug 13, 2014 at 18:53
0
\$\begingroup\$

If the voltage at sensor output pin is changed by the connection to the arduino, then that means the arduino is seen as a low impedance device. If the a0 pin were configured properly however, it would be extremely high impedance. Hence the arduino pin is probably misconfigured as output, pulling itself low. You should try putting the following line just before analogRead : pinMode (A0, INPUT);

If you have a multimeter, check that the voltage is indeed what the arduino adc tells you. If not, try to change to the internal voltage reference : analogReference(INTERNAL) and see if the result changes accordingly.

...and one last tip: unless you're going to measure high temperatures, the output of your sensor will stay well below 1v. Then you'll get way better results using the internal voltage ref which is more accurate and more stable.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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