Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Problem with Analog Input Port 0 and 5

analog input problem port 0 and 5

  • Please log in to reply
3 replies to this topic

#1 grey

grey

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 April 2015 - 11:24 AM

Hello everyone,
 
i'm trying to read some analog signals at my Netduino and run into a problem.
The problem is that the analog port 0 affects the port 5.
 
On port 0 I have a potentiometer connected and on port 5 a temperature sensor (actually it does not matter which sensors are connected, the phenomenon always arises). If the potentiometer is set to zero, the value 88 appears in the temperature sensor. However, when I increase the potentiometer, the value of the temperature sensor rises (about 160, so the double).
 
I have tried all other combinations of ports. The problem arises only when something is changed to port 0, it changes in port 5 something. Even if I do it the other way around, it has no effect.
 
Can someone explain to me this effect, or try it on his own Netduino. Maybe mine is broken at this point.
 
(Sorry for the bad english, I'm from Germany)
 
Thank you and nice Easter
grey

Attached Files



#2 grey

grey

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 April 2015 - 06:36 PM

hello again
 
my notes from before are not longer correct.
 
I have actually measured several hours and found out the following:
when I connect a sensor with much ohms (100k ohms), the input signal from this port changes, when I change the input value from another port.
 
I tested every combination and rotated at the respective potentiometers and get the following result:
 
Attached File  2015-04-06 21_55_41-Mappe1 - Excel.png   33.69KB   2 downloads
 
there are probably dependencies between the adjacent ports 0-1, 0-5, 1-2, 2-3, 3-4 and 4-5.
 
Does anyone have an explanation?
and does anyone have a solution for this problem?
 
 
Edit: I think this is a softwarebug, because this effect arises only when i use the "analogInput.Read()" function of the adjacent port.
 
Edit: New diagram.

Edited by grey, 06 April 2015 - 07:59 PM.


#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 April 2015 - 07:34 PM

Hi grey,

All 6 AnalogInputs operate through one ADC and are electrically part of one larger system, so while they are independent channels they can cause adjacent channels to "float".

If you open the adjacent analog ports as OutputPort with state set to False (or InputPort with ResistorMode set to PullDown), do you experience the same issue?

If you have other things plugged into the analog pins (which are actually analog+digital pins), make sure you are using them in code so that they are initialized. You can also tie adjacent pins to ground.

One last thing: there are impedance and other issues that can affect analog pins. Double-checking the instructions/datasheet for your component is always a good idea: some analog devices need 5V input vs. 3.3V input, etc. [In any case, be sure to limit the analog input's voltage range to 0-3.3V).

I know that's a lot of info... Does it get you on the right path?

Chris

#4 grey

grey

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 April 2015 - 09:40 PM

Hi chris, thank you for your quick response.
 
The effect arises only when i "read()" an adjacent pin.
All the other digital pins are not in use. The other (not in use) analog pins are connected to ground (see the picture before).
 
There is no hardware bug from my side. I checked all sensors with an oszilloscope and everthings works as it should.
 
I think these guys has the same problem:
http://forums.netdui...-tied-together/
http://forums.netdui...tage-incorrect/
http://forums.netdui...mpare-to-a1-a2/
 
this is my code
Microsoft.SPOT.Hardware.AnalogInput analogInputTemp = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_5);
            Microsoft.SPOT.Hardware.AnalogInput analogInputPoti = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_0);

            while (true)
            {
                Debug.Print("A5 " + analogInputTemp.Read().ToString());
                Debug.Print("A0 " + analogInputPoti.Read().ToString());

                Thread.Sleep(1000);
            }
output:
A5 0 A0 0      ->> both potis set to zero
A5 0 A0 0      
A5 1018 A0 0   ->> a5 poti set to max
A5 1016 A0 1   
A5 1019 A0 0
A5 482 A0 0    ->> a5 poti set to ~half
A5 467 A0 0
A5 467 A0 1017 ->> a0 poti set to max
A5 467 A0 1019
A5 467 A0 476  ->> a0 set to ~half
A5 467 A0 476
A5 339 A0 461
A5 0 A0 428    ->> a5 set to zero (the a5 poti falls from 461 to 428 automatically)
A5 1 A0 427
A5 0 A0 429
A5 1018 A0 526 ->> a5 set to max (the a5 poti increase from 428 to 526 automatically)
A5 1018 A0 526
A5 1018 A0 526
A5 446 A0 473  ->> a0 set to ~half (the a5 poti falls from 526 to 473 automatically)
...
in my post before I uploaded a diagram when this effect arise.
 
grey





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.