Totem pole opto-isolator TLP152 won't work as intended
After your comment where you mention that you are using 5 volts for the driver side of the opto,  there is the problem.  

The data sheet, in Section 9 states that Vcc minimum is 10 volts and maximum of 30 volts.  You need to use higher applied voltage.