Whenever i wake up I start using my tablet or mobile phone and I try to touch something on the tablet and actually see myself doing this and then I immediately fall back to sleep kinda like passing out and then I wake up again later and then find out that I actually haven’t done something on my phone. And have also friended people on Facebook I don’t know.
I would call it obsessive-compulsive disorder (OCD).
Like @Noise alluded to, I would put a response interruption in place. Turn off your tablet and phone before going to sleep. Put them in another room. Extra steps you’ll have to do to use those devices.