Analog Input Help Needed
#1
Posted 21 August 2010 - 10:26 PM
#2
Posted 22 August 2010 - 12:33 AM
#3
Posted 22 August 2010 - 01:00 AM
oz,
If you use a multimeter (connected to the analog pin from the gadget shield and any of the GND pins on the Netduino), what voltage do you read?
Also, I'm assuming that you haven't set a range--correct?
Chris
I get: around 3.something .. this isn't the most accurate multimeter so I guess it should be 3.0 to 3.5
No, I just did a
AnalogInput a5 = new AnalogInput(blah)
while(true)
Debug.Print(a5.Read().ToString());
#4
Posted 22 August 2010 - 01:14 AM
I get: around 3.something .. this isn't the most accurate multimeter so I guess it should be 3.0 to 3.5
No, I just did a
AnalogInput a5 = new AnalogInput(blah)
while(true)
Debug.Print(a5.Read().ToString());
Are you sure that it's hooked up right? If you get a 3.something on your voltage meter, it's likely a ~3.3V reading, which would be a reading of ~1023--which is what you're seeing in code.
#5
Posted 22 August 2010 - 01:29 AM
Are you sure that it's hooked up right? If you get a 3.something on your voltage meter, it's likely a ~3.3V reading, which would be a reading of ~1023--which is what you're seeing in code.
yep i triple checked.
#6
Posted 22 August 2010 - 03:11 AM
yep i triple checked.
If you're getting a consistent 3.3V reading on the analog sensor--even when you change the light level--then the sensor is not working properly.
[If I'm misunderstanding your question and you're getting different voltages based on light level but the Netduino is not seeing them then we can certainly debug from there.]
#7
Posted 22 August 2010 - 03:27 AM
If you're getting a consistent 3.3V reading on the analog sensor--even when you change the light level--then the sensor is not working properly.
[If I'm misunderstanding your question and you're getting different voltages based on light level but the Netduino is not seeing them then we can certainly debug from there.]
Nope you are correct. What does the SetRange do? is it like the map method in arduino programming?
I'll contact rugged circuits' support and see if they can tell me what to do.
#8
Posted 22 August 2010 - 03:32 AM
Nope you are correct. What does the SetRange do? is it like the map method in arduino programming?
I'll contact rugged circuits' support and see if they can tell me what to do.
AnalogInput.SetRange maps the analog input values to a specified range of integres. If 0-1023 on your device maps linearly to 0-100, then AnalogInput.SetRange(0, 100) will cause the AnalogInput.Read() method to return those values instead.
You can also submit reverse values to SetRange, such as AnalogInput.SetRange(100, -100)--which would cause an analog reading of 0V to return 100 and an analog reading of 3.3V to read -100.
Chris
#9
Posted 22 August 2010 - 03:37 AM
Yeah thats what I thought. Well I hope the people at rugged circuits can help me! I would hate to have no light sensor... Thank you for your help .AnalogInput.SetRange maps the analog input values to a specified range of integres. If 0-1023 on your device maps linearly to 0-100, then AnalogInput.SetRange(0, 100) will cause the AnalogInput.Read() method to return those values instead.
You can also submit reverse values to SetRange, such as AnalogInput.SetRange(100, -100)--which would cause an analog reading of 0V to return 100 and an analog reading of 3.3V to read -100.
Chris
#10
Posted 22 August 2010 - 03:45 AM
AnalogInput.SetRange maps the analog input values to a specified range of integres. If 0-1023 on your device maps linearly to 0-100, then AnalogInput.SetRange(0, 100) will cause the AnalogInput.Read() method to return those values instead.
You can also submit reverse values to SetRange, such as AnalogInput.SetRange(100, -100)--which would cause an analog reading of 0V to return 100 and an analog reading of 3.3V to read -100.
Chris
Wait.. also since the gadget shield had the issue that I had to connect the 3V3 to Aref [It is connected by wire, so it is fixed but-->], should I be using my multimeter probes on other pins?
#11
Posted 22 August 2010 - 05:08 AM
Wait.. also since the gadget shield had the issue that I had to connect the 3V3 to Aref [It is connected by wire, so it is fixed but-->], should I be using my multimeter probes on other pins?
If you probe the AnalogInput and GND pins to test for voltage, there's no harm in that.
Chris
#12
Posted 22 August 2010 - 05:40 AM
If you probe the AnalogInput and GND pins to test for voltage, there's no harm in that.
Chris
Thanks for the help, I tested those and they stay the same so I emailed rugged circuits. I hope they pay for the shipping too! I am very upset right now.
But THANK YOU and the rest of the team! Thank them for me, for making a great product, you have given me tons of new opportunities in the world of programming!
#13
Posted 22 August 2010 - 02:38 PM
They told me to check if the pull up resistor is on. How do I do this in the .net MF c#? Can I make an analog input an interrupt port and disable the pull up resistor like that?If you probe the AnalogInput and GND pins to test for voltage, there's no harm in that.
Chris
#14
Posted 22 August 2010 - 02:43 PM
They told me to check if the pull up resistor is on. How do I do this in the .net MF c#? Can I make an analog input an interrupt port and disable the pull up resistor like that?
oz, pull the shield off your Netduino and connect the necessary wires (but not the analog wire). Then test the voltage with a multimeter and see if you still get the constant 3.3V signal on the sensor's analog wire. If it works properly off the Netduino, there might be something we can do in code.
Also just to make sure we don't have a glitch in the Netduino AnalogInput code, before you create the AnalogInput make the port an OutputPort with a resistor state of Disabled. Then dispose that OutputPort and create your AnalogInput.
Chris
#15
Posted 22 August 2010 - 03:07 PM
oz, pull the shield off your Netduino and connect the necessary wires (but not the analog wire). Then test the voltage with a multimeter and see if you still get the constant 3.3V signal on the sensor's analog wire. If it works properly off the Netduino, there might be something we can do in code.
Also just to make sure we don't have a glitch in the Netduino AnalogInput code, before you create the AnalogInput make the port an OutputPort with a resistor state of Disabled. Then dispose that OutputPort and create your AnalogInput.
Chris
O wow, you sir are a master of un-disaster
InterruptPort test = new InterruptPort(Pins.GPIO_PIN_A5, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth); test.Dispose(); sensor = new AnalogInput(Pins.GPIO_PIN_A5);
and by doing that I get different values!.
#16
Posted 22 August 2010 - 03:10 PM
#17
Posted 22 August 2010 - 03:17 PM
Great. whats new or being fixed in the next update?Okay, very happy that it's working for you now.
I'll check and make sure that we're specifically disabling the (weak internal) pull-ups in the AnalogInput constructor code. If not, we'll make sure that we do so in the next firmware update.
Chris
#18
Posted 22 August 2010 - 03:27 PM
Great. whats new or being fixed in the next update?
We have two updates in the works:
v4.1.0.3 (patch 3):
* Minor updates to deployment/reboot code
v4.1.1.0 (first feature update)
* SD card mounting, file system support
* Expanded PWM support (ability to set clock times, etc.)
A few other things that we're working on:
* Networking capabilities
* Drivers for a number of shields
Chris
#19
Posted 22 August 2010 - 03:32 PM
We have two updates in the works:
v4.1.0.3 (patch 3):
* Minor updates to deployment/reboot code
v4.1.1.0 (first feature update)
* SD card mounting, file system support
* Expanded PWM support (ability to set clock times, etc.)
A few other things that we're working on:
* Networking capabilities
* Drivers for a number of shields
Chris
Nice stuff, I can't wait till you get the ethernet shields to work!
Here.. someone gave me this code, maybe you can model the drivers around it so arduino users can transfer easily.
http://trac.nchc.org...ernet_web_admin
#20
Posted 22 August 2010 - 04:40 PM
AnalogInput.SetRange maps the analog input values to a specified range of integres. If 0-1023 on your device maps linearly to 0-100, then AnalogInput.SetRange(0, 100) will cause the AnalogInput.Read() method to return those values instead.
You can also submit reverse values to SetRange, such as AnalogInput.SetRange(100, -100)--which would cause an analog reading of 0V to return 100 and an analog reading of 3.3V to read -100.
Chris
I really should pay more attention to the methods that are available in each class. I wrote my one code to do that recently.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users