He then went on to focus on Lauren Drew, a 14-year-old who died from an epilepsy attack at her home in Gloucester in January.
Duffy posted offensive and upsetting images relating to her death and for Mother's Day created a YouTube video with a picture of a coffin saying "Happy Mothers Day".
Public schoolgirl Natasha MacBryde was his next target. She killed herself after she was sent a message by an anonymous bully on a social networking website. She had also been teased by members of an all-girl clique at school.
Duffy set up a fake tribute page on Facebook called Tasha the Tank Engine.
On the official memorial page set up by her brother James he wrote: "I fell asleep on the track lolz," and posted images of her with text saying she was spoilt. Other trolls joined the abuse.
Duffy's final target was Jordan Cooper, 14, from Washington, Newcastle upon Tyne, who was stabbed to death.
Duffy created a group called "Jordan Cooper in pieces" with a profile picture of a knife with blood dripping off it. A further YouTube video was also made which contained pictures of his eyes crossed out and slashes across his face.
Duffy's lawyer Lance Whiteford said: "In terms of mitigation there is none. I cannot imagine the trauma and anxiety caused to the families of these horrible, despicable offences."
She said his condition meant he was not aware of the effect he was having on his victims.
Duffy had been cautioned for a similar offence in 2009 and Whiteford said he lived an isolated life and had himself been bullied at school and work.
Speaking outside court, Natasha MacBryde's father, Andrew, said: "He is a disturbed individual who caused the maximum of grief for his own satisfaction.
"I think he must be a very lonely man who unfortunately tried to get attention through the most disgusting way possible.
"In a way I feel sorry for him and I think he needs some sort of counselling as it is obviously very odd behaviour.
"I hope his sentencing shows other trollers that they are not anonymous and they will be caught if they continue their vile games.