Canada
Asked — Edited

Dj A Feature Request For Lidar-Lite Laser

Hello DJ I'm using the LIDAR-Lite Laser Rangefinder by PulsedLight in my project and would like to know if you can add support for it in ARC/ Ez-Script.

Its very similar to the " GetPing( trigger port, echo port ) " command except the trigger port is low and the echo port measures the low to high output pulse width in milliseconds .

Thanks

(http://www.robotshop.com/ca/en/lidar-lite-laser-rangefinder.html#Useful%20Links)


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

#9  

Hi MTiberia

Can you post a detailed description of how you did this? I would find it very helpful.

Thanks

Chris

#10  

I'm using the COM port feature to communicate with the Arduino Nano so you need to be tethered to your computer, You should be able to communicate with the Nano through the EZ-B UART ports but I haven't tried it. It would be easier to just use the EZ-B.

This unit supports two modes to communicate with your microcontroller, I2C or a bi directional mode with line #3 from the Pulsed Light, see the diagram in the Puled Light manual , lines 2,4 and 5 aren't used.

I chose the second method because it is very similar to the PING sensor.

You need to attach a 1K ohm resister to line #3 to make sure the output pin on the Nano( D11) is pulled low and attach a jumper to D12. Voltage to the Pulsed Light is supplied from the 5v pin on the Nano and ground is connected to the Nano's ground.

I modified the Arduino sample code downloaded from the Pulsed Light documents so that when EZ-Script sent 255 to the Nano it would take a reading and send it back to EZ Buider running on my computer.

User-inserted image

The Arduino Code :

unsigned long pulse_width; unsigned char Mantis,yy=255;

void setup() { Serial.begin(115200); // sets the serial port to 115200 pinMode(11, OUTPUT); // Set pin 11 as trigger pin pinMode(12, INPUT); // Set pin 12 as monitor pin digitalWrite(11, LOW);// Set trigger LOW for continuous read

}

void loop() {

if (Serial.available() >0) {

Mantis=Serial.read();

if ( Mantis==yy) {
  

pulse_width = pulseIn(12, HIGH); pulse_width = (pulse_width/10)-25; // 10usec = 1 cm of distance for LIDAR-Lite *** subract or add $AnyNumber to calibrate sensor**** int LSB_pulse_width=pulse_width % 256; int MSB_pulse_width=pulse_width /256;

Serial.write(char(LSB_pulse_width)); Serial.write(char(MSB_pulse_width));

 }

   }
      }

On the EZ-Script side:

ReadingPulsedLightLIDAR.EZB

#11  

@mtiberia How accurate (and stable) do you find the Lidar-lite to be? Pings have a habit of dancing all over the place. Trying to pin down any kind of accuracy is difficult with a ping. If DJ adds support for these I am definitely going to buy a few...

#12  

@ Richard You have to calibrate it, I needed to subtract 25 to get an accurate reading. Just came in from trying it outdoors and was getting accurate readings to 13m in bright sunshine. It also depends how quickly you update, I have a 200 mille second delay between readings.

I found the PING wouldn't do well with soft targets like drapes couches and clothes but the Lidar-lite Laser has no issues.

#13  

@mtiberia 13m! Wow,,,, Nice... I have a couple of arduinos so I may just buy one and try what you did... Still, I do hope we get support for it in ARC...

#14  

Thanks for taking the time to help - all my purchases will be coming in over the next couple of weeks and this will be very helpful.

Cheers

Chris