Chosen Solution
Starting out of the blue a couple of days ago, my relatively new Macbook Pro (running Yosemite) started randomly putting itself to “sleep” while I am working. What I mean by “sleep” is that the screen goes black, it pauses iTunes, and it signs off of any Skype calls that might be in progress. I am mystified about how to fix this. Further clues to aid would-be troubleshooters: This is unrelated to “Energy Saver” settings. I have it set to put the display to sleep after 5 minutes of inactivity, and the computer to sleep after 15 minutes. Yet this issue occurs as I am working –literally while I am typing. It is not falling asleep due to inactivity; it’s more like narcolepsy.Interestingly, it doesn’t behave as it does during a normal sleep. In a normal sleep, you can wake it back up by tapping the trackpad, pressing a key, or pushing the Power button. When it does its narcoleptic thing, it only wakes back up when I tilt the whole machine to the right.Wondering if it might be a motherboard issue (just a blind guess), I drove to my nearest “Genius Bar” today. The guy took it apart, said the motherboard looked great, and told me that it could probably be fixed by downloading the most recent Yosemite update. Unfortunately that did not solve it either. Any ideas?
I might know. If you keep a magnet close to the top of the speaker grill it will put the Mac to sleep (lid closed sensor is a Hall sensor and magnet)
Disconnect the battery and the sleep wake sensor on step 14 MacBook Pro 13" Unibody Mid 2012 Left Speaker Replacement put a piece of electric tape on the sleep wake sensor cable ,dont connect it and reconnect the battery and close the back lid and test it and see if you get the same issue. If you dont thats your problem needs to be replaced. If you still do let me know.
See Constantly going into sleep mode, OK in Clamshell MacBook Pro Retina Like that post, I think this happens to me because I have a smartwatch and move it around that left side of the computer and the magnet sensor picks it up and thinks the lid is closed. I have done nothing to fix it and am just trying to not move my arm over to that side of the computer.