Paul33
Posts: 7
Joined: Sat Dec 03, 2016 10:29 pm

GPIO Values - am I going mad?

Sat Dec 03, 2016 10:50 pm

Hi all,
I'm new here so please excuse me if my question appears a little retarded.

I have my RP 2B with Win 10 IOT, I'm coding with VS2015 in C# and I have a nice little app running which displays a couple of buttons and reads the value of a variable resistor and a couple of heat sensitive resistors via an A2D converter.

I'm using this (which will probably tell you everything):

using Windows.Devices.Spi;

I'm connecting to an MCP3008 and the code that I am using is based on this resource:
http://blog.falafel.com/mcp3008-analog- ... onversion/

which in all fairness I've found to be very helpful.
but here's where it gets a little irritating

I have a variable res on channel 0 and a heat sensitive resistor on channel 1 and another on channel 2. Both of the thermistors are the same value and physically a couple of millimeters apart.
When I change the value of the variable res I see a different value on channel 0 (and lets not go into the fact that they're not linear!) but what I also see is that every time I alter the variable resistor value the value that comes back from one of the thermistors (channel 1) is different (only slightly <1%).

can anyone tell me why the value of channel 1 would be modified in this manner (or is this a case of kirchovs law and I should take a separate power rail for each channel? (the variable res and the themistors end at a different pin on the chip BUT they all share a positive supply line).

Thanks in advance and again, apologies if this is a subject that everyone else already knows the answer to.
Paul.

Paul33
Posts: 7
Joined: Sat Dec 03, 2016 10:29 pm

Re: GPIO Values - am I going mad?

Fri Dec 09, 2016 12:52 pm

anyone?

scotty101
Posts: 3958
Joined: Fri Jun 08, 2012 6:03 pm

Re: GPIO Values - am I going mad?

Fri Dec 09, 2016 12:55 pm

You'd have more luck asking on the Microsoft forums for IoT.

There isn't much interest for it here.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

PrimeTSS
Posts: 1
Joined: Sun Dec 25, 2016 1:57 am

Re: GPIO Values - am I going mad?

Sun Dec 25, 2016 2:16 am

Thanks for the question as you have helped me pick a AD chip

But anyway, the MPC3008 is a successive approx AD with built in sample and hold.
So I suspect it uses the same AD/Comparator and multiplexes/switches between channels to sample, one the input signal has been sampled and held.
So each channel should be pretty well isolated from the others (pretty obvious) and be very high impedance inputs...
So I'd say (bit hard without a cct diagram) your idea about the supply being loaded might be right.
How are the POTs wired?
POTS can be linear or log, so that might explain the variance.
Since your not driving anything that needs current, (only high impedance input to DA) are you using pretty high resister values in your cct/ voltage bridge to make sure when the POT is turned down to say short circuit, the current going through that branch of the circuit is small as not to load the VDD supply.

Just my quick thoughts

skipfire
Posts: 29
Joined: Fri Dec 30, 2016 1:27 pm
Location: Indiana, USA

Re: GPIO Values - am I going mad?

Fri Dec 30, 2016 1:54 pm

A slight difference of <1% could just be simple noise or small temperature fluctuations. Depending on how sensitive the thermistors are and how close they are to where you adjust the pot perhaps your body heat is warming them up a tad.

There is also the possibility of some sort of electrical issue with what you have wired.

If everything is powered by the same source supply, could you be running it near its limit and seeing small voltage changes on the output of the power supply when you adjust the pot?

eagleman
Posts: 45
Joined: Fri Jan 01, 2016 7:43 pm

Re: GPIO Values - am I going mad?

Sun Jan 01, 2017 12:21 am

do you have he thermistors in as part of a voltage divider. If so might the value of the non-thermistor resistor be too large or too small? If your thermistor is approximately 10K, then be sure the non-thermistor value is such that the voltage at the ADC reached the max voltage allowable by the 3008. I use a 5 volt reference and a 10k thermistor and a 10K fixed resistor with the voltage to the ADC coming from the junction of the two resistors. Also, I use a SPI controlled 16 channel ADC with selectable range of 3.3volts or 5volts: AD7490 from Analog Devices. It works just fine.
eagleman
Virginia Beach, VA. USA

Return to “Windows 10 for IoT”