About grounding

Hi all,

I'm still in the process of learning more about electronics and my knowledge is still very basic.

I have a relatively simple prototype on a breadboard consisting of three lights, a piezo, a push button and a MPC9700 temperature sensor.
Depending on how I do my grounding, I am getting very accurate readings from the MPC9700 or totally wrong ones.

If I put the sensor on its own +3.3V directly from the Arduino pin and ground it directly in the Arduino pin on one side, and the LEDs, button and piezo on a common GND while feeding the pull up for the button directly from the Arduino's +5V then I am getting accurate readings. But as soon as I start using the power rails on my breadboard or use the same +5V for both the pull up resistors attached to the push button and the sensor or use a common ground for everything on the project; the readings are off but about 0.3—0.5V soaring to 1.10+V (for an expected reading of around 0.75V).

I am obviously missing something here, but what? Can someone explain what is happening?
Thanks a lot!

--edit: Current schematics with accurate readings (click to enlarge):

i think those "grounds" on the breadboard are not connected together... I think each group of 10 (or maybe 5) is isolated from the others. You can check that with an ohmmeter (multimeter) or just add jumpers to make-sure all of the grounds are connected.

if thats a standard BreadBoard . and the jumpers are as indicated, that complete rail is currently grounded. What Transistor is that ?
Or is that a Temp Sensor ?

also i just noticed that u have the 3.3v connected directly to the 5v

DVDdoug:
i think those "grounds" on the breadboard are not connected together... I think each group of 10 (or maybe 5) is isolated from the others. You can check that with an ohmmeter (multimeter) or just add jumpers to make-sure all of the grounds are connected.

I just checked with a multimeter and they are. On the breadboard I am using, the rails are split in two in the middle but otherwise, the 5 holes blocks are connected together on each halves.

woody_unreal:
also i just noticed that u have the 3.3v connected directly to the 5v

Yes, my bad, this was an error in the Fritzing schematics.

Here is the updated version:

woody_unreal:
if thats a standard BreadBoard . and the jumpers are as indicated, that complete rail is currently grounded. What Transistor is that ?
Or is that a Temp Sensor ?

It's a MCP9700 temperature sensor

:slight_smile: now if you have the image is at is EXACTLY then u only have 1 wire to your sensor :slight_smile:

GRRRRRR I have trouble with Fritzing, let me fix that:

Since ive never used that sensor before but i looked at the datasheet is seems no resistor required .. Example
Imgur
so unless there is something odd in the coding :slight_smile:
also temperature – Starter Kit

I opened another thread about this sensor a few days ago and we determined that it was the best to do to filter out any interference as per Fig3 of the datasheet (cf http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=lm35&reg=en&fileType=pdf)

I am using a 10k? resistor and a 1µF capacitor between the Vout and GND

i still think your breadboard should have been stable ,, regardless of the extras, since you said

am getting accurate readings

so a off the wall thought , wonder if a wire in the board isn't connected or if a wire is making contact with the base of the breadboard, I wish i had a sensor around to try it like yours :slight_smile: also you can use the full 5v for that sensor.

are you using a copyed coding from someone else ?

so what happens if they all connect to a common ground, but you power the pushbotton and the sensor individually? i.e. connect the temperature sensor to a digital pin for +5v?

If you have the bushbotton and the temp. sensor in parallel they are bound to interact somehow... (but that's just my intuition - I had a problem similar to that at some point and since then try to power sensors individually cause I now it will work that way. If I don't do it, I always have that slight uncertainty that something might be interacting...)

woody_unreal:
are you using a copyed coding from someone else ?

No it's my own code on which someone suggested modifications for on this thread: http://arduino.cc/forum/index.php/topic,97012.0.html
I know the code is messy, sorry about that, I intend to clean it up when I get everything in order

fkeel:
so what happens if they all connect to a common ground, but you power the pushbotton and the sensor individually? i.e. connect the temperature sensor to a digital pin for +5v?

If you have the bushbotton and the temp. sensor in parallel they are bound to interact somehow... (but that's just my intuition - I had a problem similar to that at some point and since then try to power sensors individually cause I now it will work that way. If I don't do it, I always have that slight uncertainty that something might be interacting...)

This results in the sensor returning between 0.5V and 0.6V more than it should

what do you base your "what it should be" values on? I don't know the sensor you are using, but I would expect it to give higher readings when powered by 5v than when powered by 3.3v

if you are powering it through the digital pin and connecting it to a common ground and have no other connections going on... there really is nothing which should be interfering with your readings...

fkeel:
what do you base your "what it should be" values on? I don't know the sensor you are using, but I would expect it to give higher readings when powered by 5v than when powered by 3.3v

if you are powering it through the digital pin and connecting it to a common ground and have no other connections going on... there really is nothing which should be interfering with your readings...

The datasheet says it will output 10mV/ºC no matter what voltage it is fed, as long as it is within specs. I removed the resistor and the capacitor and the sensor reads between 22.80 and 24.26ºC. Not sure why there is such a difference.
Without the resistor and capacitor, I can use the +5V rail but not the GND rail. If I feed the rail with +3.3V, readings are off coming in at around 30ºC.

Boy, is this frustrating!!!

ok :slight_smile: one thing also with your setup tha u need resistor to ground and to pin then resistor to sensor - you are seting it up with resistor to cap. and also the cap goes between the legs of the sensor- as indicated on the link for the other thread :slight_smile: the resistor to ground with get rid of those crazy values i bet

Yes I re-read the topic and it seems the person who was giving me advice was using the LM35 datasheet... Hence the confusion. I will try this when I get back today and report back :slight_smile: