i have a same problem with you. My phone s4 sometimes turn off by itself. The screen just comeback when i connect the phone with charger. it make me crazy for 2 weeks. After upgrade my phone to newest rom version 5.0.1, the problem had gone. But when i install "assistive touch for android"...