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
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.
Sign up to join this communityI want to connect a Hokuyo scanning range finder to an Arduino Mega, the outputs are labeled like this:
I want to read its serial output with Arduino, please help me in details. Thanks
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).