I see 2 possibilities why an output of the optoisolator would not go down enough, close to 0Volts.
1.) The output (collector) of the optocoupler is pulled up too strong.
2.) The input LED of the optocoupler is driven too weak.
An optocupler like the 817C is basicly a transistor with a photo-sensitive base. The current driven into the LED creating light and that drives the photo sensitive base of the receiver NPN transistor.
The higher current you driving the optocoupler LED with the higher current can flow into the base of the transistor and so the higher current can flow through the NPN junction.
The minimum guaranteed CTR (Current Transfer Ratio) of the particular 817C optocoupler is 50% at 5mA LED current.
This means that only 50% current of the LED is guaranteed to be able to flow through the NPN junction of the output transistor.
So, if you driving the LED with 5mA then it is guaranteed that at least 2.5mA of current can flow through the NPN junction.
And so, if you pulling the collector up too strong, if the pullup resistor is as low as that the transistor would require to drive more current through the NPN than the mentioned 2.5mA (in this example) then the transistor will be unable to pull the output fully to the 0Volts and the collector voltage will be higher than 0Volts.
I would try to not use any external pullups on the 817C, because the UC controllers internally have 4700 Ohms pullups on the inputs to 5Volts and would try to drive the LED with about 5-10mAmps.
Take into account when placing the series resistor for the LED, that the max. forward voltage of this optocoupler's LED is 1.4Volts.
So, if calculating and selecting the series resistor for the LED then calculate with the driving voltage minus 1.4Volts.
The situation and calculations are even a bit more complex than how I described, but I could probably write full a few A4 pages if I wanted to describe the working of an optocoupler in full details, but since I'm not here to give electric engineering lectures I will stop the description keeping it as simplified as possible.
I think I wrote down the most important things which are required for you to make the optocoupler circuit work.
A "ground loop" is a general term for having more than one return path for the electric current.
A ground loop will be not created for the UC100 if the BOB is fully isolated and for the UC100 side only the same USB power is used which comes via the UC100 cable.
If forexample you trying to use a circuit which using an external power supply with a commoned ground point with the UC100 ground then that can create a ground loop,
because the electric current can return throguh the ground wire of the UC100 USB cable and the other path is the ground wire of the external PSU.
So, a ground loop can be avoided to be done for the UC100 with not connecting a common grounded PSU to it externally, but use a BOB which do the isolation without an external power source.
Ofcourse the BOB has to have an external power source on the isolated side and for that do not use USB power from the same computer, because however that will not create a ground loop for the UC100, but could possibly bring noise into your computer and it could create ground loops for the computer if the BOB or it's wires gets grounded somewhere else, e.g. into the machine frame, control box, which is PE grounded...