0

I want to connect a Hokuyo scanning range finder to an Arduino Mega, the outputs are labeled like this:

  • COM+
  • COM-
  • Input
  • Output
  • DC12/24
  • GND

I want to read its serial output with Arduino, please help me in details. Thanks

4
  • Have you looked at the hardware documentation of the device you are trying to connect to, normally this will provide details on how to connect and interface with the COM Ports
    – Harvey
    May 23 '16 at 13:47
  • 2
    Failing @Harvey's suggestion, you will at the very least need to specify the exact model of the device you are trying to interface with. But I suspect this will be off-topic here anyway; Super User is concerned with using computers from a user perspective, not programming or hardware design.
    – Michael Kjörling
    May 23 '16 at 13:58
  • There are many protocols involved in COM programming also, so also a very broad question
    – Harvey
    May 23 '16 at 13:59
  • Welcome to superuser. This is not a forum, it's a question and answer site for problems related to computer hardware and software. Your question must show what research you've done. Your problem is very vague, it seems like you want us to do your research for you. Your question is also off-topic here, and would be better suited for Arduino.stackexchange.com
    – Bort
    May 23 '16 at 14:00
0

You should specify what model of Hokuyo scanning range finder you have. Some models are USB-interfaced, in which case COM+ and COM- could possibly correspond to USB D+ and D- leads.

The Hokuyo URG-04LX has both USB and RS-232 interfacing. The linked page shows the following pinout on CN1:

Pin No.   Signals                                Colors
1         N.C.                                   Red
2         N.C.                                   White
3         OUTPUT(Synchronous output)             Black
4         GND(5th pin of 9-pin, D-sub connector) Purple
5         RxD(3rd pin of 9-pin, D-sub connector) Yellow
6         TxD(2nd pin of 9-pin, D-sub connector) Green
7         0V                                     Blue
8         DC5V                                   Brown

Given that pinout, you would connect pin 5, RxD, to a TXD output on the Mega, and pin 6, TxD, to an RXD input on the Mega. Note, before making any such connection, measure the output voltage on pin 6. An ordinary Mega supports 0 V and 5 V levels for serial data, but standard RS-232 levels are lower and higher than that; for example, ±12 V. If you connect ±12 V RS-232 levels to your Mega, you will damage it. The several Hokuyo documents I've looked at don't say whether they use traditional RS-232 levels (±12 V) or TTL levels (0-5 V).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy