Hello. You need to program RA5/MCLR as I/O port and add diodes between pic and optocouplers. Connect a 10uF cap to the out of 7805 regulator. Try it.