TMP36 Giving 0 voltage but only when powered by external DC

Hello,

I have a very simple setup with a TMP36 sensor being sensed on analog pin A0. I am taking 3.3V from the 3.3V Arduino pin.

When powered by USB from my computer, this works great, I get a voltage off the middle pin and record a temperature.

However when I switch to the barrel jack for DC wallwart power I get just 0V from the middle pin with no other changes.

I do NOT believe the DC power is underpowered, it is a 12V 2A supply. I measure the voltage across the 3.3V to the ground pin I am using and get a perfect 3.3V, same as with the USB power.

I have reproduced with another TMP36, and another different power supply too. Could my Arduino be faulty somehow? It seems to work other than this strange effect.

Could the TMP36 be shutting down due to some over power state (guessing here).

Thanks for any help you can provide!

  • N

You didn't post according to the forum guidelines, so a wild guess...
There is a while (!Serial) in your setup, that stops the code from running if there is no serial available.

How are you displaying the temp value.
Which Arduino. 12volt is too much for most.
Less voltage to drop is less heat in the regulator.
An Uno is happier with 7-9volt on the DC socket.
A 5volt cellphone charger on the USB socket is better still.
Leo..

Hi,

Sorry for the incomplete details, thanks for offering to help.

I have gone back to using sample code to try and track down the issue, here's what I'm running, very simple:

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

void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  float voltage = sensorValue * (3.3 / 1023.0);
  Serial.println(voltage); // Prints out 0 or very close to 0 when run on DC power.
}

This gives valid results when run powered by USB, but not when on DC power to the barrel jack. The loop performs fine, I just read 0 or close to 0 from the analog pin. I have tried using a different pin with no change.

The Arduino is an Uno Wifi Rev 2, I expected I would need a highish voltage power to handle the Wifi plus Arduino plus anything on the pins.

I have tried with a 5V cellphone charger on the USB socket and things work fine, except I want to later expand the project to include a specific sensor that requires 5V power, with the USB power I only get 4.7V at the 5V pin under those conditions which causes that other sensor to fail hence why I wanted to use a capable power supply. I also just dug up a 5V barrel jack DC charger, and that ALSO works.

So perhaps the problem is some kind of over-voltage from these 12V power supplies?

Maybe I need a 7V or 10V(if exists) to get what I want?

Thanks again!

  • N

P.S. Quick update: With the 5V wall charger, I don't even think I have the power to get the WiFi connected on the Uno WiFi Rev 2, I just loop trying to connect, so I know I need more than 5V, seems strange that 12V which is technically in spec for this board would break things?

The Uno WiFi is completely different from the standard Uno.
It has a switching 5volt supply, and should be fine with 12volt on the DC socket.

Not sure what’s going on here.
The MCU of this quirky board seems to run on 5volt, and the WiFi part seems to run on 3.3volt.
Maybe you should try to power the TMP36 from the 5volt pin.
Leo…

Good to know, thanks!

I saw a previous post (of yours! Linky) which mentioned maybe putting a resistor after the TMP36 sensor, I put a 100K (and also tried 10K) resistor after it on the ground side, this gives me a non-zero reading, but I don't seem to get a change in value from the TMP36.

I have tried powering the TMP36 from the 5V pin, and I get the same results, a 0 voltage read on the analog pin from the sensor.

(I would also like to try and keep to the 3.3V pin so I can use the AREF pin in a future tweak for more accurate readings).

I did see this post about a capacitor between the 'data output' terminal of the sensor and GND: here. But I have not tried this yet.

I don't know enough about what's going on here, but it seems like maybe something is going wrong with the sensor itself responding to the DC power? I would love to try with another Uno WiFi board, but I only have a normal Uno, perhaps that may still be worth a try.

Thanks for your continued help!

  • N

Nexum:
I would also like to try and keep to the 3.3V pin so I can use the AREF pin in a future tweak for more accurate readings.

Not with this board. The 3.3volt rail is powering the WiFi. Could be as 'dirty' as the 5volt rail.

I usually use the processor's buildin 1.1volt Aref for analogue sensors like this.
But don't know if this MCU (Atmega4809) has one, or has both a 1.1volt and 2.56volt internal Aref.
I guess you have to read the datasheet of this unusual Arduino version.

One day you will discover the much easier to use digital DS18B20 temp sensor.
And the much smaller $5 WeMos D1 mini, to replace this awkward and badly documented Uno WiFi board.
Leo..

Thank you :-).

I will try a messing with a capacitor etc. to try and get this to work, however... yes, the day I discovered the DS18B20 was yesterday, and mine should be arriving in the mail in a day or two, haha!

Hopefully I will have better luck with that, I am surprised at how prevalent the TMP36 sensor is considering its litany of problems, I suppose it is very cheap, but a couple bucks more gets you this seemingly much more capable and accurate sensor.

If I get the TMP36 working properly with 12V in on this Arduino I will post back here with more info, however I feel it's more likely I'll just jump ship to this digital sensor instead.

Thanks,

  • N

Arg, and now I have the new sensor, I run into a problem with the Uno Wifi Rev 2. Seems that others are having trouble with it and this sensor. I may just use a normal Uno and attach a WiFi board to be done with this.