TMP36, hooked to ground beside pin 52, Wi-Fi shield causing reading fluctuations

I have the TMP36 hooked to the ground beside pin 52 on my Mega 2560. While running by itself, everything works fine. But during the refresh period of the web sever, the TMP36 readings fluctuate greatly. This also happens but to a much smaller degree when the sound module is active during the switch file period.

I am no expert, but am fairly confident this is caused by the ground in arduino receiving more.... volts...current..power... whatever the proper word is. But the thing is, I don't have any thing else attached the that particular ground. The common ground that everything else is hooked to is the normal ground (between 5v and Vin) which is even found of an Uno.

Is there a way to isolate the ground I am using for the TMP36? I am using A14 for the reading pin, but according to the Wi-Fi shield and Mega datasheets, I can't figure out a reason the A14 would be a culprit.

Any suggestions?

Hi,
You cannot isolate gnd unfortunately.
Check the shield and see if it uses A14 pin as well.

Tom.... :slight_smile:

Hi.
Another thought, put a 0.1uF cap from A14 to gnd, to bypass the output of the sensor, and another from gnd to the positive pin of the sensor.

Keep the sensor wiring away from the wifi.

Tom..... :slight_smile:

ArduinoWiFiShield doesn't suggest that it does... Isn't there a way to make sure electricity only travels one way? That wouldn't help though would it.... Could adding more strain to the ground cause fluctuations on the TMP36 reading though? If you can't isolate ground, then if that was the problem, would running other electrical devices in the building effect it just as well?

Another thought, put a 0.1uF cap from A14 to gnd, to bypass the output of the sensor, and another from gnd to the positive pin of the sensor.

Keep the sensor wiring away from the wifi.

You are going to have to walk me through this. I have The Starter Kit and all the components it comes with. Is the cap included? On the TMP36 sensor, the left side is hooked to 5V, the middle is hooked to ground (beside pin 52) and the right side is hooked to A14.

As far as keeping the wiring away from the wifi... you are really going to have to explain how I should go by doing that one.... The wifi shield is attached directly on top of the Mega. The Mega has to be able to read the readings.

----------edit---------------
if I hook the ground of the tmp36 to the ground of a separate 9v battery... would that work?

Hi,
How are you powering the project?
If you are connected to the USB and computer does it do it?
I hope you are not using a 9V small smoke detector type battery, it will never be able to supply enough current for the WiFi for a start.

Can you post a picture of your project please so we can see yur layout.

Do not change and add gnds, all gnds should be connected together.

Tom..... :slight_smile:

How do you read the sensor. With the "normal" 5volt Vref?
In that case, when the onboard 5volt supply dips, the sensor value will increase.

As TomGeorge already asked: Is your power supply "solid" enough.
A Mega with WiFi shield alone could use 200mA.
Leo..

I hope you are not using a 9V small smoke detector type battery, it will never be able to supply enough current for the WiFi for a start.

Small world. The 9V is able to carry enough current for the WiFi shield to start and do what it needs to. The battery doesn't last long, but it is able to support it for a while.

But to answer your question, I am powering the project through a usb connected to my lap top. I have it set up to run on a 9v battery so I can transport it and show other people without using my lap top so they understand that the lap top isn't somehow controlling the arduino.

I am skeptical about posting a picture. The reason is, I am using the breadboard that came with the breadboard, and the easy to assemble wooden case that came in the StarterKit (If I started over, I would not go this route). Anyway, I thought it would be good to make it as compact as possible, and therefore cramped everything into the smallest spaces possible. There are wires on top of wires on top of wires. I will be happy to post what everything is connected to and to what pins on the mega if that will help, but figuring that out by looking at the wires is a cluster ____ nightmare.

If you are saying the drop in voltage may be the culprit, if I got a wall wart, and also used the usb connection, would that help?

How do you read the sensor. With the "normal" 5volt Vref?

Same method "the LoveOMeter" example that comes in the preloaded library in the starterkit library, called P03_LoveOMeter

----------------------------edit-----------------------------
would a yun shield be easier to support than a wifi shield? It says, low power consumption.

I would start with a proper 9volt/1A switchmode wall wart, plugged into the DC socket. Batteries are unreliable.
Not a 12volt type. That could overheat the onboard regulator and shut down the Arduino.
This 9volt supply will automatically disconnect the USB supply from the laptop.

Did you enter "LoveOMeter" in the search box on top of this page.
Seems to be a common problem.
We have to see the code. Maybe the TMP36 can be read with the more stable 1.1Vref.
Leo..

Hi,
If the sensor needs only three wires, what is the rats nest?
Do you have other hardware connected to the mega?
The capacitor will probably not be supplied in the kit.
You need them to filter any noise on the leads to the sensor, particularly when the WiFi transmits.
That is the reason I suggest you move the sensor away from the wifi shield.
If you are using breadboard and trying to minimise your project, forget it, leads will be the problem with picking up noise from other circuits.

Tom...... :slight_smile:

If the sensor needs only three wires, what is the rats nest?
Do you have other hardware connected to the mega?

I have buttons, leds, a rtc, 2 sensor modules, and the TMP36 hooked up to the 2 inch by 4 inch breadboard. The rats nest seemed like a good idea at first, wouldn't recommend it though.

The only shield I have connected to the Mega at this time is the Wi-Fi shield. I am curious does the Yun shield use less power than the Wi-Fi shield? They advertise it as "low power consumption".

As Leo pointed out, I now think the problem was because of the drop in 5v when other devices use a little power. I fixed my problem by taking out the tmp36 and using the temp sensor on the DS3201 RTC. I liked the tmp36 because I could touch it and the heat from my hand would be registered almost imminently. The DS3201 does not register temp changes as fast, therefor testing takes a little longer. But the change in 5v does not seem to effect it.