Sergeant Lee Johnson was a popular officer well-known for his Twitter account.
But he had suffered from depression and was found hanged inside the Heddfan unit at the Wrexham Maelor Hospital.
At the inquest, coroner John Gittins was told the officer could not understand why he was depressed because he felt he had so much going for him.
The hearing in Ruthin was told that Sergeant Johnson had twice spoken of hanging himself at home in Pantymwyn, near Mold. It was after the second occasion in December, 2015, that he was admitted as a voluntary patient to the Heddfan unit.
He hanged himself in the unit on February 13, 2016.
Clinical psychologist Dr Emma Evans, told the inquest that Sergeant Johnson spoke quite openly to her about his mother’s suicide, his own traumatic childhood, horrible experiences he had had in the RAF and police, and the fact that he was under investigation for alleged misconduct.
She said the 45-year-old father-of-two, an officer with West Mercia Police, was reluctant to discuss issues he had with alcohol.
His wife Barbara, a police officer in the North Wales Force, described him as “a very focused, kind person” who struggled to cope with the stresses of his job.
He first sought advice from a GP about three or four years ago but early in 2015 the problem returned and it became progressively worse.
Mrs Johnson said that when he felt depressed he turned to alcohol and that made him suicidal.
“I felt we needed to do something because I feared that something bad was going to happen,” she said.
Having had dealings with Heddfan through their job, hospital was regarded as “the final straw” she said, but her husband seemed keen to go along with anything which would help him.
She added: “I thought it was a positive step because it was a place of safety."
Mrs Johnson told the inquest her husband felt safe in the unit but he told her and consultant psychiatrist Dr Nafisa Hussein that on occasions he had thought of throwing himself in front of a car or train.
Dr Hussein described him as a model patient, adding: “He seemed quite happy to be in hospital and happy to engage with anything that would help him. He was very open about discussing harming himself.”
She said she was shocked to hear that he had killed himself as he had told her he felt safe in hospital.
Dr Evans told the inquest she too, felt he genuinely wanted to make changes in his life which would be for the better, but was concerned about his future both in and out of the force.
The hearing continues.