Mini Analog
#1
Posted 10 December 2011 - 08:51 AM
#2
Posted 10 December 2011 - 09:11 AM
#3
Posted 10 December 2011 - 11:50 AM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#4
Posted 11 December 2011 - 05:33 AM
#5
Posted 11 December 2011 - 05:59 AM
Hi ajcg1973,
Did you connect your analog input to the 5V pin or did you use a voltage devider circuit?
Hi Stefan, I'm using a Microchip MCP9700A connected to the 5V VDD line. (I should say that I have the Mini mounted on a Boe-Bot board from Parallax). The MCP9700A has a voltage range of 2.3V to 5.5V so I should be Ok on that...
#6
Posted 11 December 2011 - 06:33 AM
Hi ajcg1973,
Curious.
If you open up the unused analog pins on your Netduino Mini as OutputPorts (set to FALSE to drive 0V), does that help any?
Chris
Unfortunately it didn't seem have any effect on the results of the readings. I'll keep playing with it to see if I can gather any more info on the problem. I might treat myself to a new mini next month just to make sure it isn't a hardware problem.
Thanks guys for the replys.
#7
Posted 11 December 2011 - 07:02 AM
Hello ajcg1973.
I own just a N Plus (fw 4.1.0.6). There are some issues around the ADC readings, but I never heard anything as of yours.
Could you post some clue more, as long as a bit detailed description on the circuit to feed the analog inputs.
The code would be really useful as well.
Cheers
All of the issues that I have seen on the forum have been about the difference in readings on the same ADC port and I haven't seen anyone else complain about this specific issue. The interesting thing is with the Mini, the readings on the first Analog Pin (Pin 5) seems to be spot on with little variance. The other three ports on the Mini also have little variance in the readings but all read 20 units lower (0.064 Volts) than Pin 5.
Here is the simple code that I'm using:
public static void Main() { SecretLabs.NETMF.Hardware.AnalogInput an0 = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_5); while (true) { Debug.Print("Raw: " + an0.Read().ToString()); Thread.Sleep(1000); } }
I'm using the Microchip MCP9700A temperature sensor which converts temperature into a voltage value. The circuit is also simple - VDD (5V) to power the MCP9700A. GRD to GRD. MCP9700A voltage out to the ADC on the mini. I should also point at that 5V in on the MCP9700A is within spec and it outputs temperature as a voltage in Celcius but it is less than 1V so it is well within the Mini's ADC voltage range.
One thing that I did want to mention is the first reading on Analog 0 (PIN5) seems to be the same reading as the other analog pins where it is about 20 units less than the correct reading then it starts reading as expected from the second reading on:
#8
Posted 11 December 2011 - 12:47 PM
#9
Posted 11 December 2011 - 09:13 PM
Hi ajcg1973,Hi Stefan, I'm using a Microchip MCP9700A connected to the 5V VDD line. (I should say that I have the Mini mounted on a Boe-Bot board from Parallax). The MCP9700A has a voltage range of 2.3V to 5.5V so I should be Ok on that...
The Mini inputs aren't 5V tolerant, they accept 0 to 3.3V. This might be the case!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#10
Posted 24 December 2011 - 06:42 AM
Hi ajcg1973,
The Mini inputs aren't 5V tolerant, they accept 0 to 3.3V. This might be the case!
Hi Stefan,
Good suggestion. I took a look at the datasheet and it looks like the MCP9700A outputs 0.1V to 2.0V max. I don't think that I have a bad part because I have used it on other microcontrollers and it reads just fine. I'm going to try and power the sensor directly from one of the output pins (only uses 6uA) to see if that makes any difference. Hopefully I will have time to get out the meter this holiday week to help troubleshoot. I'll keep you posted. Thanks!---AJB
#11
Posted 29 December 2011 - 05:49 AM
Here is an update...
This is a weird one and it is quite puzzling to say the least. While troubleshooting I was trying different things. One of the things that I tried was to hook a MCP9700A sensor to multiple analog inputs each at the same time to see what the average difference in readings returned was between Analog Port 0 and Analog Port 1. What happened was very curious, Analog 0 and Analog 1 started to both read *perfect* results. So I started to experiment a little to see if I could explain what might be happening. When I moved Analog 0 input to GND, I read 0 units on Analog 0 but Analog 1 returned back to reading about 20 units less than it should. When I connected Analog 0 to 3.3V I started to read 1023 on Analog 0 (as expected) but I started to read ~600 units on Analog 1, instead of the correct 220 units that I was reading if Analog 0 was connected to the MCP9700A.
Any ideas? I looked at both the schematics and the firmware code to see if there was any difference in the code between Analog 0 and any other analog inputs and I wasn't able to find a difference. It is a little confusing as to why Analog 0 would have so much impact on Analog 1 when I'm within specification.
Mario,
I haven't tried your suggestion yet but I shall shortly. I'll post the results as soon as I can...---AJB
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users