Go Down

Topic: Analog IN - floating voltage (no input) (Read 1 time) previous topic - next topic

knut_ny

add 1M from A0 to GND..
Salty water will give you a reading. As now the input is floating..
Ny

bjarne

I now see your other post with the computation of the voltage, and that should produce consistent results.  So that got me to thinking that I have had problems with totally weird results when my sketch was fairly large and especially when I had many strings.  I think that with the limited ram it is possible to run out heap and get some of the variables overwritten.  This problem completely went away when I cut down on the number of string and I also try to do as much processing on the Linino side to make the sketch size sampler.

So do you think that could be part of the problem?

And you posted the last one while I was typing this :)

delirium45


I now see your other post with the computation of the voltage, and that should produce consistent results.  So that got me to thinking that I have had problems with totally weird results when my sketch was fairly large and especially when I had many strings.  I think that with the limited ram it is possible to run out heap and get some of the variables overwritten.  This problem completely went away when I cut down on the number of string and I also try to do as much processing on the Linino side to make the sketch size sampler.

So do you think that could be part of the problem?

And you posted the last one while I was typing this :)


could be, but when compiled the sketch uses 61% of program storage space... i hope that isn't over-running the memory, but certainly i could cut  down on the output... that is just for debugging... but the actual analogRead value is what is used to trigger the events... so the actual voltages could be ignored.

delirium45

#18
Feb 03, 2014, 10:19 pm Last Edit: Feb 03, 2014, 10:26 pm by delirium45 Reason: 1

add 1M from A0 to GND..
Salty water will give you a reading. As now the input is floating..


what do you mean by that first statement ?
that i should put a large resistor between A0 and GND ? I had thought this too...
my biggest resistor, on-hand, is 10K ohm... would that be large enough ?

bjarne

It is not the sketch side itself that I had problem with, but rather (I think) the number of string that I used, which would used up variable space with being shown as global variables.  For a test try to make your strings a shorter, or even get rid of some of them.  I used to make changes in places totally unrelated to where my problem showed, and it went away.

Do you have a URL or part number for the sensor or switch you have in the pan.

You might not need a ground wire, but since you already have a 10k series resistor, the readings should have been cut in about half, did they?  I am assuming they 10k resistor is in addition to the one you added for the test.

bjarne



add 1M from A0 to GND..
Salty water will give you a reading. As now the input is floating..


what do you mean by that first statement ?
that i should put a large resistor between A0 and GND ? I had thought this too...
my biggest resistor, on-hand, is 10K ohm... would that be large enough ?

Did you not put a 10k resistor from A0 input to ground in the previous test?

delirium45

#21
Feb 03, 2014, 10:31 pm Last Edit: Feb 03, 2014, 10:37 pm by delirium45 Reason: 1

It is not the sketch side itself that I had problem with, but rather (I think) the number of string that I used, which would used up variable space with being shown as global variables.  For a test try to make your strings a shorter, or even get rid of some of them.  I used to make changes in places totally unrelated to where my problem showed, and it went away.

Do you have a URL or part number for the sensor or switch you have in the pan.

You might not need a ground wire, but since you already have a 10k series resistor, the readings should have been cut in about half, did they?  I am assuming they 10k resistor is in addition to the one you added for the test.


there is no sensor in the pan, it's just the wires... open... with enough water it will close the circuit.
as far as the 10k resistor... see my drawing of the circuit... maybe i misunderstood... but i put the 10k between the return-wire and the A0 pin... ground pin was never touched.



or do i need two resistors ?
one as shown above, and another to ground (red)?
or is it just the one to ground (red) ?


bjarne

#22
Feb 03, 2014, 10:43 pm Last Edit: Feb 03, 2014, 10:45 pm by bjarne Reason: 1
OK, I understood that you had a switch or sensor in the pan, now I see what you are doing, so you do need a resistor from A0 pin to ground on the Yun, but 10k will be too small.  You need a large resistor like knut_ny is saying, like 1 Mohm.

delirium45


OK, I understood that you had a switch or sensor in the pan, now I see what you are doing, so you do need a resistor from A0 pin to ground on the Yun, but 10k will be too small.  You need a large resistor like knut_ny is saying, like 1 Mohm.


Okay, thanks to you both !
I am a hardware newb, software is more my game... enjoying the cross-over, just need some lessons like this :)

Will get a 1M and update this thread.

Cheers !

knut_ny

Ny

delirium45

#25
Feb 05, 2014, 11:56 pm Last Edit: Feb 06, 2014, 12:03 am by delirium45 Reason: 1
Picked up a 5'er of 1Mohm resistors at local radioshack yesterday, and setup a breadboard test and it drops the floating analog-in voltages significantly... and only leaks a small amount to ground when the 'pan circuit' is closed [instead of solid 1023, it will pull at 1019-1021].

So this appears to be directionally correct... i'll try it on the full-scale model later tonight.

edit: thought i'd snap a picture of the test board... buttons simulate a closed connection/water in a pan, there are two pans in this scenario. the output is the LED light to confirm and trigger other logic.



delirium45

Full-scale test was not as good as small-scale.
Still floating around from 0-922... very strange.
Could this all be signal interference on the wires, or a pinch/short in the wires, something else ?

Here is what it yielded (mind you only HVAC-UP is connected, HVAC-DOWN has no input):


sonnyyu


Go Up