![Photo](http://www.gravatar.com/avatar/49a61780185f73421446c999c183a275?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
Analog voltage incorrect
#1
Posted 23 October 2010 - 09:08 PM
#2
Posted 24 October 2010 - 12:04 AM
You can also use the .SetRange(0, 3300) on your pin method to get the millivolt conversion "for free". I'm guessing if your aref is actual at 3.26 or something you could do .SetRange(0,3260)...
Also check this thread on the LM35
I'd be curious to know about fluctuations in your readings, which I have been struggling with:
Analog Input Fluctuations
#3
Posted 24 October 2010 - 06:34 AM
#4
Posted 24 October 2010 - 07:23 AM
#5
Posted 24 October 2010 - 07:33 AM
#6
Posted 24 October 2010 - 07:57 AM
Ok this is getting to me know. When I remove the humidity sensor that uses A0, the reading changes a lot.
Why do I measure a voltage on the analog pins with nothing attached?
Marius,
If you are opening up multiple analog pins in code, you need to have something connected to each one (or you need to wire the unused ones to ground). Otherwise, the unconnected analog inputs can drive floating readings...
Chris
#7
Posted 24 October 2010 - 01:37 PM
#8
Posted 24 October 2010 - 05:39 PM
Chris,
Do we have to load the input pin that has a sensor connected a bit as well? I am more concerned about the reading that is not consistent with the real voltage on the pin.
All analog inputs that are in use should be driven to a voltage (whether that is 0V, 3.3V, or anything in between). If you leave an analog input "floating," you'll get floating results...
I can ping our electrical engineering team on this, but some other forums members might have some insight to share as well...
Chris
#9
Posted 25 October 2010 - 07:13 PM
#10
Posted 25 October 2010 - 07:24 PM
Chris,
Because I am a newby I can ask this, I think.
What is the difference between declaring like this
static AnalogInput temp = new AnalogInput(Cpu.Pin.GPIO_Pin10);
and this
static AnalogInput temp = new AnalogInput(Pins.GPIO_PinA1);
Marius,
Cpu.Pin.GPIO_Pin10 refers to pin "PA10" on the Atmel microcontroller itself. As a general rule, skip those enumerations and use the Netduino ones (Pins.GPIO_PinA1, etc.) instead.
Chris
P.S. Advanced technique: you can access any digital pin on the Atmel microcontroller by using (Cpu.Pin)pinNumber -- where pinNumbers 0-30 are MCU pins A0-A30 and pinNumbers 32-62 are MCU pins B0-B30.
#11
Posted 25 October 2010 - 07:52 PM
#12
Posted 25 October 2010 - 08:06 PM
Thanks Chris, that is handy information.
I am still having a problem with the LM35. I have discovered that the ATD is ok but somehow connecting the LM35 directly to the pin make trouble. For some obscure reason is the reading lower than what I measure on the pin. I am beginning to think that it is an impedance problem.
Any news from your technical chaps regarding my problem here?
P.S. I am running the sensors from 3.3v, maybe a problem?
Marius,
Do you have a regulated power supply that outputs a constant voltage? If you can generate a known voltage to measure on your Netduino, we can identify if there's a glitch in the MCU's ADC (analog-to-digital converter) somewhere...
Or if you have a friend with a Netduino, it would be really interesting to see if they got the same results.
Chris
#13
Posted 26 October 2010 - 02:14 AM
Marius,
Do you have a regulated power supply that outputs a constant voltage? If you can generate a known voltage to measure on your Netduino, we can identify if there's a glitch in the MCU's ADC (analog-to-digital converter) somewhere...
Or if you have a friend with a Netduino, it would be really interesting to see if they got the same results.
Chris
I forget what type of filter they call it, but maybe try for aref a 10mf cap being fed through a 1k resistor from the v3.3 source. I had to do something simular with a sensor that I was working with to get rid of the noise that was affecting the sensor.
#14
Posted 26 October 2010 - 04:26 AM
#15
Posted 27 October 2010 - 03:32 PM
#16
Posted 27 October 2010 - 04:49 PM
#17
Posted 27 October 2010 - 04:59 PM
#18
Posted 27 October 2010 - 11:00 PM
#19
Posted 30 October 2010 - 07:56 AM
#20
Posted 30 October 2010 - 12:18 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users