|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Analog Sensors Returning Incorrect Voltages
Hey all,
Today we were adding our sensors to the robot and started testing out code and we discovered the they were returning near zero voltages from the getAverageVoltage() method. Code:
[cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.23009997599999998 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.24552717599999999 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.240384776 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.214672776 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.101539976 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.142679176 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.122109576 [cRIO] Ultrasonic: -0.0014189800000000002 [cRIO] Potentiometer: 0.106682376 Thanks for any help |
|
#2
|
||||||
|
||||||
|
Re: Analog Sensors Returning Incorrect Voltages
Are you sure you didn't plug them in backwards?
|
|
#3
|
|||
|
|||
|
Re: Analog Sensors Returning Incorrect Voltages
I had a similar problem with an ultrasonic, but that was a few weeks ago and I forget exactly how I fixed it. I think I had some code in the wrong place... It might help if you posted your code so we could take a look at it.
|
|
#4
|
||||
|
||||
|
Re: Analog Sensors Returning Incorrect Voltages
Thanks!
Our Analog Breakout seemed to be labeled wrong and the Potentiometer now works fine. However; the ultrasonic returns either a constant voltage of 3 with one orientation or a voltage ranging from 0-1. We are using the basic MaxSonar analog ultrasonic sensor.Any information would be incredibly beneficial. Thanks, Team 4338 |
|
#5
|
|||
|
|||
|
Re: Analog Sensors Returning Incorrect Voltages
I'm not sure about an analog ultrasonic sensor, but the digital ones require you to tell it when to ping. With the Ultrasonic object, you can turn on an "automatic mode" that will continuously ping.
Code:
us = new Ultrasonic(2,3); us.setAutomaticMode(true); |
|
#6
|
||||
|
||||
|
Re: Analog Sensors Returning Incorrect Voltages
If I remember correctly ping isn't a factor in an analog object (correct me if I'm wrong). The analog channel class has no method for setting ping. We tested with a multimeter and the sensor was receiving 5 volts when ground and +5 were tested. The AN return a near 0 voltage as before. We are getting correct readings from the pot so I can only assume something is wrong with either the sensor itself or the signal wiring.
Thanks Last edited by AIS Falcons : 02-14-2014 at 12:24 PM. |
|
#7
|
||||
|
||||
|
Re: Analog Sensors Returning Incorrect Voltages
Remember that the analog voltage is just proportional to the distance. Does it change with distance to the sensor?
I am assuming you are using the LV series sensor and have read the datasheet and the application notes for the sensor (I know because we screwed up at first too).http://www.maxbotix.com/documents/MB1000_Datasheet.pdf Enjoy! |
|
#8
|
||||
|
||||
|
Re: Analog Sensors Returning Incorrect Voltages
Thanks, we figured it out! The sensor is now working perfectly fine with further testing it should be great!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|