Maxbotix Speed-up readings
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- brett burton
- Posts: 11
- Joined: Tue Jan 25, 2011 12:02 am
Maxbotix Speed-up readings
I'm using a Maxbotix Ultra-sonic rangefinder for a project. It's one from the HR series, if that matters. My problem is that the readings are too slow. is there a way to speed things up a bit? My guess is that it's getting a reading every 300-500 milliseconds. I realize it has to bounce sound out and wait for it to come back, but is there a way to have it pulse quicker or more frequently?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Maxbotix Speed-up readings
The HR models are slower than the standard resolution models as you might expect. Still, they produce 100mS (filtered) updates in continuous mode. If you use them in trigger mode, you can have an unfiltered result in 100ms from the trigger time. http://www.maxbotix.com/documents/HRLV- ... asheet.pdf
- brett burton
- Posts: 11
- Joined: Tue Jan 25, 2011 12:02 am
Re: Maxbotix Speed-up readings
If I'm understanding it correctly, the standard setup is for continuous mode. That would be the setup shown in the getting started tutorial:
http://www.adafruit.com/blog/2009/06/23 ... art-guide/
That should be reading continuously every 100ms? It seems slower. Am I missing something, or is my perception of time just off?
http://www.adafruit.com/blog/2009/06/23 ... art-guide/
That should be reading continuously every 100ms? It seems slower. Am I missing something, or is my perception of time just off?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Maxbotix Speed-up readings
Post the code you are using.
- brett burton
- Posts: 11
- Joined: Tue Jan 25, 2011 12:02 am
Re: Maxbotix Speed-up readings
int sonarPin = 1; //pin connected to analog out on maxsonar sensor
float distance;
//------------------------------------------------------------------
void setup() {
Serial.begin(9600);
}
//------------------------------------------------------------------
void loop() {
distance = analogRead(sonarPin) / 4.8; //this is my best guess scaling for inches on HRLV.
Serial.println(distance, 0);
}
float distance;
//------------------------------------------------------------------
void setup() {
Serial.begin(9600);
}
//------------------------------------------------------------------
void loop() {
distance = analogRead(sonarPin) / 4.8; //this is my best guess scaling for inches on HRLV.
Serial.println(distance, 0);
}
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Maxbotix Speed-up readings
The spec sheet describes continuous operation as:
The filter function is not clearly specified, but it is clearly some sort of low-pass filter. To get the best response time you will need to use the triggered mode of operation.• Free run operation uses a 2Hz filter,
with 100mS measurement and
output cycle
Please be positive and constructive with your questions and comments.