I never want my Android tablet to go to sleep, can I prevent sleep mode?
Depending on you tablet, you may have the option to set the screen timeout to "never" under Settings > Display > Sleep.
If you do not have this option, you can enable Settings > Developer options > Stay awake. This will keep your tablet awake while it is charging. This could be useful if your tablet does not support the "never" screen timeout.
Note: If you don't see Developer options in Settings, it may be made available by going to to Settings > About > Build number. Developer options should appear after tapping the build number several times.
There is a stay awake option while charging. For the older Android Froyo 2.2, it can be found under:
Settings > Applications > Development > Stay awake
"Screen will never sleep while charging."
The same option is still present up to the current 8.1 version, but you first have to unlock developer options.
Here’s a automation “flow” for Automate to keep the screen and CPU awake, but you can easily modify it to only keep the CPU awake: http://llamalab.com/automate/community/flows/374