2
\$\begingroup\$

I am using an arduino to measure ambient temperature by reading an analog voltage from an Analog Device TMP36 temperature sensor. http://www.analog.com/static/imported-files/data_sheets/TMP35_36_37.pdf

The TMP36 is powered by the regulated 5V pin from the arduino, TMP36 output goes to A0, and shutdown is tied to the 5V pin. There is a 100n cap on Vin. Everything works great in this setup.

However, if I tie shutdown to an arduino IO pin, such as 12, after configuring pin 12 as an output, and writing high, I get a temperature reading that is approximately 4 degrees C less than it should be.

AND if I tie the enable pin to an arduino pin that has been setup for input with internal pullups enabled, I get the correct temperature!

I tested the output voltage of the pin, and measured 5V.

I thought that the temperature might be affected by a colder wire, but this really doesn't make sense, since all my wires are at ambient air temp, and I can use the same wire to connect shutdown to the 5V regulated out, and a GPIO in quick succession, and see the temperature drop when connected to the GPIO, and rise immediately to ambient air temp when plugged directly into regulated 5V.

Does anyone know what the difference could be between tying "shutdown" to an output enabled pin VS regulated 5V?

\$\endgroup\$
1
  • \$\begingroup\$ Is it possible that although you are writing a high to pin 12, this gets corrupted and sometimes you write a zero. Clutching at straws is a good game! \$\endgroup\$
    – Andy aka
    Commented Sep 19, 2013 at 8:12

1 Answer 1

1
\$\begingroup\$

I speculate wildly:

  • you haven't allowed the device turn-on time to elapse, try adding a delay,

  • the rise time of the SHUTDOWN pin relative to +Vs is somehow unusual, try controlling +Vs also from a GPIO.

\$\endgroup\$
2
  • \$\begingroup\$ For the first point, I actually don't switch the GPIO off and on. I leave it on continuously! I'll try the second, and see what happens. Thank you for answering. \$\endgroup\$
    – Eraticus
    Commented Sep 19, 2013 at 20:44
  • \$\begingroup\$ No Arduino GPIO is on continuously; for a brief time between power up reset and your sketch running, the GPIO is either an input, or in use by the bootloader. To avoid conflicting with the bootloader on an Uno, don't use D13, D0 or D1. Another difference is that an Arduino output pin may be damaged and be unable to source as much current, but that should not be a problem if you measure 5V from the output pin while it is connected to the SHUTDOWN pin. \$\endgroup\$ Commented Sep 20, 2013 at 2:11

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.