POLICE found 48 indecent images of children on a former North Yorkshire station supervisor's computers.
The investigation into Ian Christie began in April 2011, said Robert Galley, prosecuting at York Crown Court.
North Yorkshire Police discovered that Christie, now 49, was downloading suspicious files that could contain indecent images of children.
In October 2014, officers took hard drives, computers, tablets and mobile phones from Christie's home.
Mr Galley said 48 was a relatively small number, with other offenders often having thousands of images.
Taryn Turner, defending, said: "There appears before you today in effect a broken man."
Christie had turned to alcohol and become socially isolated after the death of his partner in 2004.
The defendant had been a supervisor at Scarborough train station, but had to resign due to this court case.
He was now in poor mental health and had attempted suicide over Christmas.
Mrs Turner added: "He would be greatly assisted by having some counselling.
"He has had the anxiety of these proceedings hanging over his neck for a long time."
Christie, of Garibaldi Street, Scarborough, pleaded guilty to four counts of having indecent images of children at an earlier hearing.
On Friday, Recorder Michael Wheeler handed him a two-year community order, requiring him to do 160 hours of unpaid work.
Christie was also put on the sexual harm prevention order for five years and must register under the Sexual Offences Act for the same period.