1

I am trying to read data from a LV-MaxSonar-EZ0's TX pin connected to the RX pin on a Raspberry Pi Zero W. The problem I'm running into is that the data I'm getting does not fit what the sensor's datasheet is specifying. According to that I should be receiving data in all ASCII. An ASCII 'R' followed by three ASCII numbers and a carriage return (ASCII 13).

When I fire up minicom with the command minicom -b 9600 -w -o -H -D /dev/serial0 I get the following:

00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d8 05 c0 06 f6 ac 0f 00 00 00 00 00 00 00 00 00 00 00

The output is uniform, so I guess that's good. However I am not seeing anything that corresponds to ASCII characters. Any tips?

I am running Raspbian Stretch Lite release from 2017-11-29 and connect to it over ssh.

Aurora0001
  • 6,357
  • 3
  • 25
  • 39
ns533
  • 119
  • 1

2 Answers2

0

If you don't have a scope you sure are in a world of pain.

With a few clicks I've found this on the manufacturer's documentation. Comparing their procedures to yours, what differences can you see?

One difference I see is they read /dev/ttyS0 and /dev/ttyAMA0 whereas you use /dev/serial0. According to rpi documentation, this is primary uart, usually reserved to console. Are you sure about your configuration?

In case nothing above helps, check out your cables. My experience with jumper cables has been very nice so far but be aware bad cables, cold solder joints, excessive length will flip your bits.

RalfFriedl
  • 2,180
  • 2
  • 11
  • 12
MaxDZ8
  • 339
  • 1
  • 7
-1

As I know, the output of the LV-MaxSonar-EZ series is analog, however the Raspberry pi is unable to read analog data. So the solution is to use a analogue/digital decoder, I suggest the MCP 3008.

singrium
  • 135
  • 1
  • 8