Go Down

Topic: De-coupling. (Read 9154 times) previous topic - next topic

beingobserver

Hi friends, i have 3 sensors which i can get accurate readings until i wire another tempreature sensor.
Even if i connect its GND pin to Arduino, results become inaccurate.

Grumpy_Mike suggested me to use 0.1uF decoupling capacitors and gave me a link (some schematics and explanation) about it. I think i understand how to use but i am not sure and i don't want to burn another circuit anymore :)

Can you please tell me how to use this capasitors to prevent inaccurate readings?

By the way thanks to Grumpy_Mike because of his great help.

Thanks

jack wp

there are many locations that de-coupling capacitors "may" do some good. The first one I see from your photo, put a couple on the bread board, between the +5 and ground. The second place may be between the analog input pins, and ground.
Did those help?

beingobserver

Ok, should i use just a capacitor or double ?

Sorry :)

jack wp

If you have several use 2 (or 3) the more you use does not hurt, and may actually help.

beingobserver

I used them like this (attached). But never helped at all. Readings are much far from accurate :)

jack wp

How about if you take all but one of these out of circuit? Does the one left give a expected reading?

beingobserver

Just one sensor (PH) and the GND pin of Temp. sensor. I can't take accurate readings.

As soon as i wire the GND i get inaccurate readings..

jack wp

A mystery.. what do you think it could be?
How about putting one of those caps across the ground to analog in?
Can you format your sketch, and show it in code tags? ( button looks like #).

beingobserver

#8
Sep 06, 2013, 02:13 am Last Edit: Sep 07, 2013, 12:31 am by beingobserver Reason: 1
Code: [Select]
String PHsensorString = "";
boolean PHsensorStringComplete = false;
String PHValueString = "";
float PHValueFloat = 0;

String TMPsensorString = "";
String TMPValueString = "";
float TMPsensorStringComplete = false;

void setup(){
 Serial.begin(38400);
 Serial1.begin(38400);
 Serial2.begin(38400);

 PHsensorString.reserve(30);
 TMPsensorString.reserve(30);
}

void serialEvent1() {
 if(Serial1.available() > 0){
   char inchar = (char) Serial1.read();
   PHsensorString += inchar;
 
 if(inchar == '\r'){
   char charray[PHsensorString.length() + 1];  
   PHValueString = PHsensorString;
   PHValueString.trim();
   PHsensorString.toCharArray(charray, sizeof(charray));
   PHValueFloat = atof(charray);
   PHsensorStringComplete = true;
}}}

void serialEvent2() {
 if(Serial2.available() > 0){
   char inchar = (char) Serial2.read();
   TMPsensorString += inchar;
   
 if(inchar == '\r'){
     TMPValueString = TMPsensorString;
     TMPValueString.trim();
     TMPsensorString = 0;
     TMPsensorStringComplete = true;
}}}

void loop() {
 if(PHsensorStringComplete == true){
   Serial.print("PH: ");
   Serial.println(PHValueString);
   PHsensorString = "";                                                      
   PHsensorStringComplete = false;
 }
 
 if(TMPsensorStringComplete == true){
   Serial.print("TMP: ");
   Serial.println(TMPValueString);
   TMPsensorString = "";                                                      
   TMPsensorStringComplete = false;
 }


}

GilchristT


Grumpy_Mike suggested me to use 0.1uF decoupling capacitors

That's his answer to everything  :smiley-roll:

To be fair, he's been right every time as well  ;)

beingobserver

He must be :)

But i don't know what is the problem.

beingobserver

Sorry friends but do you have any other idea?

How can i test step by step? Firstly i thought its a power issue but Grumpy_Mike and some other friends told me its not.
I tried de-coupling as you can see above.

Note: I have an avometer :)

jack wp

In looking at your sketch, I must have missed where your are reading your input.
Can you make a short sketch that demonstrates your problem?

xl97

all gnds connected for all components? (tie them together)

any +3.3v LOGIC devices? (not being level shifted?)

decoupling caps on ALL power pins, on all components?


jack wp

We are here to help. We enjoy providing suggestions (even if our suggestions are not always the answer). We should be patient, a step at a time.
Another suggestion (may not fix it tho). If you are taking several analog readings (especially if they are close together), try using two reads. First read to be discarded, then the second one to be used.
A  second suggestion: do some averaging (smoothing) of your analog readings.

Go Up