![]() |
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.0014189800000000002Thanks for any help |
Re: Analog Sensors Returning Incorrect Voltages
Are you sure you didn't plug them in backwards?
|
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.
|
Re: Analog Sensors Returning Incorrect Voltages
Thanks!
Our Analog Breakout seemed to be labeled wrong :confused: 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 |
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); |
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 |
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! |
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!
|
| All times are GMT -5. The time now is 11:34. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi