Go Down

Topic: HELP ! PHENIXTAG Laser Rangefinder (Read 620 times) previous topic - next topic

robert_james

Jan 12, 2017, 04:37 pm Last Edit: Jan 12, 2017, 04:57 pm by robert_james
Please I need idea for this laser rangefinder to work found on ebay..
I need atleast library or related sample program.. thanks!


http://www.ebay.ph/itm/70m-Laser-Distance-Meter-RangeFinder-Sensor-Distance-Measurer-Module-USB-RS232-/322325751672?hash=item4b0c1ca778:g:vMkAAOSwcL5XM-FX

https://github.com/jimoconnell/lidar

geologic

According to ebay link, it's just a matter of serial communication. Connect RX/TX to arduino, setup a SoftwareSerial and write those commands (letters)

robert_james

How about transferring it to the arduino micro? Any idea about the code?


I think I found a useful link but i didn't understand well..
LIDAR

Thanks!

geologic

That code is in python, you need to translate it to C (arduino). Something like this:

Code: [Select]

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // your arduino RX, TX pins
String str= "";


void setup()
{
  // Open serial communications to write to screen:
  Serial.begin(9600);
  Serial.println("Starting program:");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(19200);
}

void loop() // run over and over
{
  Serial.print("Taking measures... ");
  mySerial.println("C");

  if(mySerial.available() > 0)
    {
        str = mySerial.readStringUntil('\n');
    }
   Serial.println(str);
delay(500);
}




I'm curious about this sensor, let me know if is working and reliable

robert_james

I try your code but nothing happen..

Output image attach below..

Please help me.. I don't know anything about phython..

geologic

I made a mistake on my code, you have to send the letter "D" not "C"
So, replace mySerial.println("C") for mySerial.println("D")


Note that this code is just to guide you, not a perfect receipe...
To work with that module (according with ebay link) you send a command by serial comm and wait for the response. If you are not getting any answer, You can try several things:

1) swap RX / TX wires
2) replace mySerial.println("D") for mySerial.print("D\r\n");
3) put a delay (50)  after mySerial.println("D")

Also note that arduino operates normaly on 5V, that module operates at 2,9V. You will need a level shifter or resistor in the arduino TX wire or you could damage the sensor.

geologic

According with ebay link, there's a USB adapter and a software to test the unit, did you tried it first?

geologic

Did you made it work? I'm curious about this module...

ignatius_vito

It's working, I follow your instruction, but the measurement is still random code ( i don't know that language like ??///#&blablablaa. I'll try to fix it. But thanks , because from this instruction I can operate this Laser Rangefinder Module, B605B, RS232, 100M distance measurement. . Maybe you can help me?



That code is in python, you need to translate it to C (arduino). Something like this:

Code: [Select]

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // your arduino RX, TX pins
String str= "";


void setup()
{
  // Open serial communications to write to screen:
  Serial.begin(9600);
  Serial.println("Starting program:");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(19200);
}

void loop() // run over and over
{
  Serial.print("Taking measures... ");
  mySerial.println("C");

  if(mySerial.available() > 0)
    {
        str = mySerial.readStringUntil('\n');
    }
   Serial.println(str);
delay(500);
}




I'm curious about this sensor, let me know if is working and reliable


geologic

It's working, I follow your instruction, but the measurement is still random code ( i don't know that language like ??///#&blablablaa. I'll try to fix it. But thanks , because from this instruction I can operate this Laser Rangefinder Module, B605B, RS232, 100M distance measurement. . Maybe you can help me?



Did you manage to make it work? Can you post the output?

Go Up