Chosen Solution

Hi folks, I am having the same problem as the above poster, and unfortunately the posted solution does not address it. MacBook falls asleep while running 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. By “sleep” I mean the screen goes black, it pauses iTunes, and it signs off of any Skype calls that might be in progress. I am mystified about why it’s doing this or how to fix it. Further clues to help would-be troubleshooters: This is unrelated to “Energy Saver” settings. My settings have it put the display to sleep after 5 minutes of inactivity, and the computer to sleep after 15 minutes. This “going to sleep” happens 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– and this wakes it up immediately, each and every time. Thinking maybe it was a motherboard issue (though it really was just a blind guess), I took it in to my local “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.