Optocoupler output for DMX controller


I'm designing a PCB that should work as a DMX receiver and/or DMX driver (controller). I pretty much followed this schematic, with the only exception that I didn't want to use the Tx and Rx pins of the arduino, because I need those to interface with another arduino. So I use pins 11 and 12.

The guy who made that pcb also made his own library, I'm using the DMXsimplle library at the moment (I'm only going to use it as a controller for now). The PCB is not yet made, since I want to be sure it's 100% ok (high cost), so I can't test my theories.

Now my problem: I've used 6N137 optocouplers to isolate the DMX signal. Seeing the schematic, I think the output of the optocoupler goes low when the input is high and vice versa. Is this right? The datasheet also says something like that I think. Would that mean that I need to switch every bit (HIGH to LOW and LOW to HIGH) I send out from the arduino, so the DMX signal matches the sent out serial data? Or is that something the DMX library does automatically?

PCB schematic: http://www.mathertel.de/Arduino/DMXShield.aspx Datasheet optocoupler: https://datasheet.lcsc.com/szlcsc/1912111437_Everlight-Elec-6N137S1-TA_C110020.pdf

This is a better datasheet, it shows the power supply connections for the opto-isolator more obviously which are crucial: https://www.vishay.com/docs/84732/6n137.pdf

Yes the output is inverted (active high), the truth-table explains this.

No idea what the DMX library does, but you can look at it to answer questions about it as its open-source (its highly instructive to do this IMO).

I'd recommend breadboarding the design before designed the PCB - then you can be sure of everything beforehand.

BTW isn't DMX512 supposed to be RS485? Why the opto coupler and not just RX485 driver?

Thanks for the datasheet. The Chinese part I'm going to use has the same part number, so I guess it works the same. I think I found the solution (well the solution is already in the schematic, I just didn't notice it): the input is also inverted. When the arduino pin goes low, the LED of the optocoupler is ON and therefore output is low.

Breadboarding will cost me probably half of what it would cost me to make the pcb through jlcpcb + I would need to wait for the parts to arrive.

And DMX512 specifications require isolation. Mainly against ground loops since DMX for lights could be used for lights far apart from each other. And also isolation for when you accidentally happen to put mains voltage on the DMX bus (which isn't really a concern for my setup).

What Arduino model are you using?
Be aware that DMX runs at 250000 baud and cannot be emulated with software serial, it really needs a hardware serial port connection.
It might be worth flipping the idea and use hardware serial for DMX and software serial (or some other protocol) for connection to other Arduino.