V.3 of sleep detection

Should detect straightforward sleep and intragrated with sending to
Arduino, but my laptop is too slow to run it i think.