trouble with ttl/rs232 shifter (no 9 pin)

I am trying to interface a commerical ultrasonic sensor to a Seeeduino Stalker controller and need help with the connection points.

The ultrasonic sensor is capable of sending ASCII strings via RS-232 containing the distance information.

To change the RS–232 connection to a TTL connection compatible with the Seeeduino Stalker I am trying to use a Sparkfun Shifter (PRT-08780) without an RS-232 9 pin connector.

I believe the RS-232 #1 pin on the Shifter board is the one with a sqaure surround. Is this right ?

I have connected the sensor serial out line to the Rs-232 pin #3 (RS-in) and ground to pin #5 (GND) on the Sparkfun shifter board.

I have attached the TTL ouput pin of the shifter (marked TX-0) to the input port on the Seedino Stalker (marked as port ) - RXD).

I have attached the ground of the shifter to ground on the Stalker.

I have attached the power (VCC) on the shifter to 3 V (marked 3V3) on the Seeduino stalker.

From what intsructional info I can gather, This should shift the signal from the sensor from serial to 3 volt TTL which is compatible with the Seeduino Stalker.

I borrowed a very simple sketch which just captures incoming bytes and reprints then outputs them to the PC terminal progarm.

What I get is nothing, No data transmission lights, no output to the screen.

I know the ultrasonic sensor is powered and working since it shows an analog voltage out on another pin.

The first troubleshooting step with any serial data comm and converters is to loop the TX and RX (or IN and OUT) pins together, and see if you get an echo on the PC terminal program.

Your connections, as described, seem correct to me. Do you have a DVM to troubleshoot and measure voltages with ?

I do have a DVM. As described in my first post, I used it to measure the analog sensor voltage output which is proportional to the distance. That verified that the sensor was working. However, I want to use the output of a different pin (rs-232, ASCII) which contains distance information in text format. I can’t verify this is working using a DVM.

I did, however, wire the RS-232 output of the sensor to a 9 pin plug and used a serial-to-USB adapter to see if there was any output from the sensor to the PC using a simple terminal program on the PC, and found none. This raises two questions: (1) is the serial -to-USB dongle working right, and (2) am I looking at the right pins? The ASCII output of the sensor appears on pin 5 on the sensor. There is no input to the sensor, so only output and ground are required. I wired sensor ASCII output to pin 3 (data in) of the 9 pin rs-232 plug. Sensor ground is wired to pin 5 of the plug. I can verify that the sensor is powered and working with the DVM, but no output appears on the PC using a simple terminal program set to the parameters (9600 bps, 8N1) for the sensor.

Since the shifter is not used at all in this test, I assume maybe the fault lies with the ASCII output to the pin on the sensor.

I will try the terminal loopback test. I think I have a 9 pin loopback adapter around here somewhere…

Thanks for the help!

followup : I used a loopback plug to test the PC dongle & port. Echo was perfect, so I assume the PC and 9 pin-to-USB dongle are working OK.

I also checked and tested the physical connection (solder joint) between the sensor output pin and the signal cable, and it tests OK for continuity.

So either there is no ASCII output from the sensor or I have the pins on the rs-232 plug that attaches to the dongle messed up.

When an RS-232 link is between sending data it’ll be at the stop bit voltage, ideally -12v on old PCs, somewhere between -3v and -15v per EIA-232 spec. Try measuring the digital output (DC and AC volts) w/your DVM.

Do you have a link for the sensor ?

Here’s a link to the datasheet for the MoxSonar sensor:

http://www.maxbotix.com/documents/HRXL- … asheet.pdf

I am powering the sensor with a 5 VDC supply - the documentation says the serial output is rs232 format “with 0V to Vcc levels.” I assume in this case that means 0-5VDC (I have checked the power supply input with the DVM.)

Plitch:
I am powering the sensor with a 5 VDC supply - the documentation says the serial output is rs232 format “with 0V to Vcc levels.” I assume in this case that means 0-5VDC (I have checked the power supply input with the DVM.)

If yours is one with "RS-232" output then it's really inverted TTL output, 0-5v with the idle/stop bit at 0v. That's going to make it hard to detect w/a DVM. All you really need is an inverter and level-shifter (5v to 3.3v) function but that's what the 1/2 of the board you're using does (ideally).

You can test that the board is working. Remove the output from the sensor and instead connect a grounded wire to pin 3 (RS-IN). You should see 3v on the (TX-O) output to your Stalker board. Then remove the ground and apply 5v from your power supply to pin 3. You should measure 0v on the output now. If those happen then the shifter board would seem to be working.

thanks - I’ll give it a try.

Plitch:
I wired sensor ASCII output to pin 3 (data in) of the 9 pin rs-232 plug. Sensor ground is wired to pin 5 of the plug.

Try pin 2. The TD/RD designation is only valid if you know if your device is a DTE or DCE.

Usually, anything that emulates a COM port on a PC is a DTE (male connector). I can’t remember for sure, but I think pin 3 is TD (data out) on a DB9, and pin 2 is RD (data in).

I have tried a sensor capable of TTL output, and it works fine with my Seeeduino Stalker. So I guess I will abandon using the sensor with RS-232 serial output. I am guessing there may have been some mechanical problem with the serial output from the “old” rs-232 sensor.

In any case, many thanks for all the help from this group! hope I can return the favor someday.

If you’re done, please mark the thread as “solved” so others will know they don’t “have” to read it.

Thx.