A man arrested after being found in possession of a suspicious object, told a court he was using it for “sexual purposes”.