I finally got the octocouplers and tried them in my circuit but without success. I think I have reviewed my code and circuit tens of times but I don’t see where is the issue. Even with the octocouplers connected I still have the same symptoms. Once the DC motor runs, I cannot read any signal anymore with the infrared. Weird, very weird.
Anyway, I keep looking but I am also busy with plan C :-). I have seen on Ebay that there exists an L298N with integrated optocouplers in the chip to for isolation. I have ordered it yesterday evening. I hope I can finally get it to work. In the meanwhile when I have time I keep looking into my circuit to see what could possibly be wrong. My circuit is not that complicated.