Maker Pro
Maker Pro

Lost in Translation... Poor Man's Fiber Optic Network

Rhybos

Aug 12, 2018
5
Joined
Aug 12, 2018
Messages
5
Okay here's how it is.

I've attached a UART to my computer and I've been echoing messages to its com port using CMD. In principle, these messages should be repeated over the TX line of the pinout. Actually, this part has been going extremely well! I'm driving a laser diode using a mosfet and a 9V power source, and the echoed messages pulse the laser just as expected.

Awesome!

The problem is the integration of this part here:
https://www.mouser.com/ds/2/678/V02-1501EN_DS_HFBR-0500Z_2014-09-190-909160.pdf

It's the HFBR 25X3Z reciever (page 18^^) this is a fairly standard 40Kb optical receiver, but when it reads the signal produced by the laser, it always produces some garbled, garbage signal. Like, when I echo the message "3" to the laser's COM port, it outputs a consistent 102, 41, 214, 0. For any one-digit number, it maps a four-number string to correspond to it and prints it to the serial monitor. I have recorded all of the numbers from 0-8, and there is no clear pattern. But as long as you know which four numbers to look for, you can tell which number was sent --I mean to emphasize that the detector is failing consistently.

It's like the detector is printing each individual bit that it receives, rather than the whole message itself.

Here's where my confusion begins... I have come to understand that the output from the laser's com port may be TTL, while the detector's com port is expecting an rs232 signal. However, when I connect a wire between the laser's TXD line and the detector's RXD line, the transmission is perfect. Clearly, the failure is of the optical components. I think it's the detector.

Any ideas on how to send an rs232 signal successfully?
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
Here's where my confusion begins... I have come to understand that the output from the laser's com port may be TTL, while the detector's com port is expecting an rs232 signal. However, when I connect a wire between the laser's TXD line and the detector's RXD line, the transmission is perfect. Clearly, the failure is of the optical components. I think it's the detector.

OK so to be clear … you are putting some other laser into the optical fibre ( the fibre in that datasheet ?) and then using the RX unit in the datasheet to receive the signal ?

if so, I would suggest your "other' laser is probably over-driving the receive laser

Now the other thing you haven't commented on is ….
1) are you only going in one direction ? …. that is, you don't have a return path ?
if so, then that may be the problem, if your UART also requires other RS232 signals … CD ( carrier detect), CTS ( clear to send) etc ??

2) If you are using the datasheet RX module and also the fibre, I would strongly suggest you use the matching TX module so that you have a matching system


just some initial thoughts :)
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
if you haven't got something like this for a setup …..

upload_2018-8-12_15-17-7.png

then all bets are off for having a working system ( that is from page 5)
 

Rhybos

Aug 12, 2018
5
Joined
Aug 12, 2018
Messages
5
OK so to be clear … you are putting some other laser into the optical fibre ( the fibre in that datasheet ?) and then using the RX unit in the datasheet to receive the signal ?

if so, I would suggest your "other' laser is probably over-driving the receive laser

Now the other thing you haven't commented on is ….
1) are you only going in one direction ? …. that is, you don't have a return path ?
if so, then that may be the problem, if your UART also requires other RS232 signals … CD ( carrier detect), CTS ( clear to send) etc ??

2) If you are using the datasheet RX module and also the fibre, I would strongly suggest you use the matching TX module so that you have a matching system


just some initial thoughts :)


Thank you so much!! I determined that the CTS etc signals apparently aren't necessary for the to transmit and receive effectively. I can even switch off the dte and rts without any issues. But I think you are absolutely right about over-driving the receiver. I found an old oscilloscope, and hooked it up to measure the actual voltage difference between the detector's signal cable and ground while receiving data, and it was huge --easily a potential culprit for confusing the Uart. Also, I learned that I should actually invert the signal so that negative voltages drive the reciever's rx pin.

If all else fails I absolutely will just buy the matching tx module haha... I'm not sure why that didn't occur to me.

This has really helped! I can finally stop banging my head against a wall.

Thanks again, and have a great day.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
This has really helped! I can finally stop banging my head against a wall.

Thanks again, and have a great day.


no probs

don't forget to come back at some stage with an update on how it worked :)
 
Top