TMP36 Sensor only working when connected via USB

Hi all,

I have a Mega 2650 and I'm having some trouble with what should be the simplest part of an otherwise complicated project.

One of the things the Mega is doing in this project is reading 4 TMP36 sensors. On an external printed board, I have traces setup to join the +5V pins of the sensors and the GND pins of the sensors, and then each has a pin which goes to one of the Mega's Analog Inputs. I also have a 10nF capacitor between these 5V and GND points.

When connected via USB, I get accurate temperate readings from the board. When powered with an external power supply (which is how it will be used eventually, as this is going into an underwater housing), I get non-sense from the sensors. When I measure the output of the sensors with a multimeter in this configuration, I see something like 0.2V, when I expect to see about 0.750V. Measuring from 5V to GND on the TMP36 shows 5V as expected.

The board is being powered by a DC-DC converter that takes 48V (because that is the power supply available in the housing I will be placing this into) and outputs 12V at up to 3A. This is being connected to the Vin pin on the Mega and GND pin on the Mega (as an aside, is there any difference between connecting to the Vin pin and the barrel jack? I couldn't find much on this).

I tried researching this issues, and people seemed to blame either ground issues or low voltage issues. I can measure the voltage into my board as 12V and measuring the 5V pin shows 5V, so I don't think it's a voltage problem, and as for the grounds, the negative output of the DC-DC converter, the GND of the Arduino, and the GND pin of the TMP36 are all tied to the same points.

All other aspects of the project work fine (it has multiple digital outputs for controlling some relays, it's controlling a WiFi shield, and it communicates with two different RS232 devices via TX/RX pins and some max232 chips). It's frustrating that what should be the simplest aspect of the project (I remember setting up analog temperature sensors in high school!) is the only part that I can't seem to figure out. Any insight on further things that I might be missing? I'm pretty close to just sicking a pro-mini in the housing somewhere, hooking the TMP36 sensors to that and it just sending the data to the Mega via serial (which I tried, and it worked, but it's messy as hell).

12volt on V-in is entering the danger zone for the Mega, especially with extra things connected to 5volt.
A Mega with Wifi shield already draws ~230mA. Feel if the 5volt regulator next to the DC socket gets hot.
I guess that the Mega could shut down after some time.
Can't you lower the DC/DC converter to 9volt (better) or 7.5volt (ideal).

The DC jack would be slightly better.
Reverse voltage protection and a 0.7volt diode drop before it internally connects to V-in.

The TMP36 problem could be fixed if you supply them from the Mega's 3.3volt pin.
Leo..

Wawa:
12volt on V-in is entering the danger zone for the Mega, especially with extra things connected to 5volt.
A Mega with Wifi shield already draws ~230mA. Feel if the 5volt regulator next to the DC socket gets hot.
I guess that the Mega could shut down after some time.
Can’t you lower the DC/DC converter to 9volt (better) or 7.5volt (ideal).

The DC jack would be slightly better.
Reverse voltage protection and a 0.7volt diode drop before it internally connects to V-in.

The TMP36 problem could be fixed if you supply them from the Mega’s 3.3volt pin.
Leo…

Thanks for the tips. I checked the voltage regulator, and it was getting warm. I wouldn’t call it alarmingly hot, but I can adjust the voltage to it before deploying it just in case. I assumed that that the 7-12V listed on the specs was the safe range. Unfortunately with our design getting to the DC jack would be tricky due to space constraints, but everything is soldered on anyway so we shouldn’t have a real possibility of reverse voltage.

Connecting the TMP36 to the arduino 3v3 didn’t change anything. However, I seem to have pinpointed the trouble point, but I’m not sure how to fix it. The device connects to a computer via RS232 with a max232 board inline to go between RS232 and 5v logic. When this is hooked up I’m getting nonsense from my TMP36 sensors, but when I disconnected this (basically just cut the cable that the comms go into the case with), and measure the output with my meter, they’re sensible again.

So for clarity: USB out of computer → max232 board (Tx/Rx/GND) with 5v being fed from a separate supply with it’s ground tied into the max232 IC’s ground → cable into housing → Tx/Rx into Arduino Rx/Tx Pins, GND into one of the GND pints on the arduino. The comms do work because I am able to communicate with the board, but something about this (I’m assuming the ground somehow) is causing the TMP36 to act all wonky.

Understanding grounds has always been a weak point in my understanding of electronics so it’s possible I’m missing something simple here. Any advice?

I wouldn't mind trying to help here but:

1)Why do you use an exernal USB-serial converter while the Mega already has a builtin USB port? Do you want to leave the Serial0 port free for debugging and use Serial1/2/3 for another communication with the computer?

2)Can you draw and share a simple schematic of how everything is connected. This would clarify a lot

Ty

Should be straightforward.
The TMP series data sheet quotes an absolute maximum supply voltage of 7-volts
I think the TMP36 has an offset voltage that has to go into the calculations.
Grounds are grounds and as far as I know, they get connected together.
The datasheet recommends 0.1uF (100nF), not 10nF.
You have some funny old voltages kicking around so I would check it out with a simple 5-volt supply, 0.1uF and at 25-C, you should get 750-mV, or thereabouts (500-mV offset plus 10-mV per degree C).
Make sure any analogue reference voltages are right.

edugimeno:
I wouldn't mind trying to help here but:

1)Why do you use an exernal USB-serial converter while the Mega already has a builtin USB port? Do you want to leave the Serial0 port free for debugging and use Serial1/2/3 for another communication with the computer?

2)Can you draw and share a simple schematic of how everything is connected. This would clarify a lot

Ty

This is for an underwater unit. It needs to go out of the computer into a long (100ft) underwater cable from the boat - USB wont cut it. We tried a few things, and going from USB-RS232-TTL was the thing that always seemed to work.

I'll try to put something simple for a schematic down, the whole system one would be a bit much.

tigger:
Should be straightforward.
The TMP series data sheet quotes an absolute maximum supply voltage of 7-volts
I think the TMP36 has an offset voltage that has to go into the calculations.
Grounds are grounds and as far as I know, they get connected together.
The datasheet recommends 0.1uF (100nF), not 10nF.
You have some funny old voltages kicking around so I would check it out with a simple 5-volt supply, 0.1uF and at 25-C, you should get 750-mV, or thereabouts (500-mV offset plus 10-mV per degree C).
Make sure any analogue reference voltages are right.

It should be straightforward! It works when I connect it to a 5v supply (it even works when I connect it to another arduino). I get reasonable readings, so the sensors work and I how how to use them in general.

When I connect it to my system as described, when I measure the voltage on the output pin, it reads something weird like 0.3V in a room temperature area, and it corrects back to about 0.75V when I cut the comms wire.

tigger:
Should be straightforward.
The TMP series data sheet quotes an absolute maximum supply voltage of 7-volts
I think the TMP36 has an offset voltage that has to go into the calculations.
Grounds are grounds and as far as I know, they get connected together.
The datasheet recommends 0.1uF (100nF), not 10nF.
You have some funny old voltages kicking around so I would check it out with a simple 5-volt supply, 0.1uF and at 25-C, you should get 750-mV, or thereabouts (500-mV offset plus 10-mV per degree C).
Make sure any analogue reference voltages are right.

Data sheet also stresses the cap needs to be as close as possible to where the TMP36 connects to power. The symptom is also for ground bounce. Star grounding may be required, if not already in place.

Paul