Go Down

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

alnath

as far as I can see from the sketch, there are no analog readings, sensors values are sent via serial transmissions, right ?
BTW, what kind of "bad results" do you get ?
Are all your sensors fixed at 38400 bauds, or can you change the speed, and if yes, did you try a lower speed ?

beingobserver

@jack wp - i cleaned the code above. just PH and TMP sensor.

@xl97 now i have just 2 sensors. Both of 2 sensors can be work with 5v. I don't know too much about caps :) Just put them there.

@alnath yes, as you can see the code from previous page, there is not any analog readings. I am using serial 1 and serial 2 ports.
38400 bauds is the rate of factory. All sensors came with this settings. I can't change the speed without using delay.

The Story:
First, i am wiring the PH sensor.
Results are good, 6.8 to 6.9 and so on..
I checked this result with the PH sheets. And i tried with low PH waters also like 1.0 to 2.0 etc.

Then when i wire the GND pin of the TMP sensor, PH value sticks to 7.0.
I am continuing to wire other cables and TMP results are accurate even if the PH is always 7.0.

Then i unwire the TMP sensor, i get "check probe" message repeatedly.

I am resetting the Arduino, uploading the code and unplug the usb for "several times" and i am getting the accurate readings again.

I think its weird :D

Thank you

alnath

#17
Sep 07, 2013, 01:34 am Last Edit: Sep 07, 2013, 01:43 am by alnath Reason: 1
weird, yes .... maybe something wrong in the  call of serialEvent() functions, but it seems to be a hardware issue .

do you have an oscilloscope ?  you could see the signal, and probably see what happens

do you have a link to the sensors datasheet ?


edit  :  if it is a software problem, maybe you miss some bytes ? you could try, in the serialEventn() functions, to replace the if(serialn.available() ) with a while(serialn.available()  )  - just make sure you get out of the loop before the string is full ;) -

beingobserver

#18
Sep 07, 2013, 01:43 am Last Edit: Sep 07, 2013, 01:47 am by beingobserver Reason: 1
Actually, i can work with PH, ORP and DO sensors at the same time with the accurate results.
But when i wire this TMP sensor, things become weird :)

I don't have an oscilloscope unfortunately. I wish i have one :s

You can find all the things about the circuits.
PH: https://www.atlas-scientific.com/product_pages/embedded/ph.html
TMP: https://www.atlas-scientific.com/product_pages/sensors/env-tmp-d.html

Addition: I tried with the "while" instead of if also. The same result :)

alnath

thanks, I'll have a look .

did you check the +5V on each sensor with and without TMP sensor ?

beingobserver

I can say that its the same with or without the TMP sensor.

4.70 to 4.75. Its changing in this range.

alnath

ph circuit seems to need a particularly clean environment and doesn't like interferences  :smiley-eek:
maybe you could try to put it far from the TMP sensor , or even on a separate breadboard.....
and.... back to a decoupling capacitor, between its +5V and its GND (very close to the device)

what about the led indications ?

jack wp

Maybe a smoothing / averaging code would make it look better.
Average = ((average*5)+newReading)/6
or something like that.

beingobserver

@alnath I did you what you said. I used seperate breadboard and changed the position of capacitors (same result). Do you want me to turn off the leds?

@jack wp i could try smoothing the PH results but i never get any different value from 7.0.
This PH circuit is capable of measuring 0.1 to 14. So 7.0 is the half way of its range :D

I lost nearly a week with this. I have lots of things to do but can't move because my mind is stuck with this problem :)

Do i have to find an oscillator to test? Do you think i could find out the reason with that? I could try to find one.

alnath

no, I asked about the leds, because in the datasheet, they describe their meaning .

does the Ph circuit still works if alone ??

no more idea (for now  :smiley-mr-green:  ) I have an oscilloscope, so I'd use it to watch the signal Ph sensor sends,
but a logic analyser would be more useful here. If you can borrow one ..... ;)

beingobserver

PH led is blinking green, i think its ok.

Yes, PH is working good if i wire it alone.

Hmm, so i have to find one to borrow if i need one :) I have to make it work.

TomGeorge

#26
Sep 07, 2013, 12:03 pm Last Edit: Sep 07, 2013, 12:04 pm by TomGeorge Reason: 1
Hi, reading the posts is it right in stating that the readings you get are inaccurate not unstable when you install another sensor.
Where are you getting your power supply for the sensors, I hope not from the arduino 5V.  If this is the case then have you tried a separate power supply for the sensors?
You were asked about what the supply was measured at your sensors and I gather the 4.70 to 4.75V stated was the result.
It should be 5 volts if its coming from a regulated supply, again if its the 5V on the arduino board that you are using then I'd say you are overloading it regulator.
Tom.
Everything runs on smoke, let the smoke out, it stops running....

beingobserver

#27
Sep 07, 2013, 01:11 pm Last Edit: Sep 07, 2013, 01:13 pm by beingobserver Reason: 1
Yes, inaccurate readings when i connect the TMP sensor.

Yes, i am feeding the sensors with the Arduino :D I think i tried with external power supply in the past.
I can't remember because i tried tons of things :) I can try again if you want after seeing the values.

Please check the results, do you think there is something wrong?

Note: I am waiting someone to ban me from the forum :D

alnath

#28
Sep 07, 2013, 01:19 pm Last Edit: Sep 07, 2013, 01:26 pm by alnath Reason: 1
TomGeorges might be right, I cannot see any electrical characteristics in the TMP sensor datasheet
the sensors are designed to work between 3,3V - 5V , then 4,7V should work,  but it should not vary ....

why would someone ban you ?  XD


edit : the ph circuit datasheet warns a lot about wrong wiring etc.... maybe you could try a +5V power supply just for it (but all GND connected) ?

beingobserver

Actually it is varying but too little amounts. For example 4.75 to 4.80.

@alnath my topic is always at the top of General Electronics section :)

Thank you so much.

Go Up