Andrew Ibrahim was expelled from three public schools
A student accused of making a "suicide vest" became interested in explosives to make himself "cool" and "popular", Winchester Crown Court has heard.
Andrew Ibrahim, 20, told court he had begun researching about explosives and extremist groups when he was 12 or 13.
He also said he had started using hard drugs at school.
Mr Ibrahim, of Bristol, denies making an explosive with intent to endanger life or cause serious injury to property in the UK in April 2008.
He also denies a charge of preparing terrorist acts by purchasing material to make an explosive, making that explosive, buying material to detonate the explosive, carrying out "reconnaissance" before the act and "making an improvised suicide vest in which to then detonate an explosive substance".
The jury heard he pleaded guilty to a third charge of making an explosive substance.
Mr Ibrahim told the court he had begun researching online about explosives, extremist groups and conspiracy theories because they were "controversial".
He said he did not have many friends and wanted to create a better self-image of himself.
He said: "It was the fact that they were controversial, they made me feel a bit cooler, I didn't have friends or a social life but by looking at these files it made me feel a bit cooler.
"I felt not so sad, as such a loser. It made me feel better and bigger and a cooler person."
But the defendant told the court that despite several failed experiments to create explosives, he had never intended to set off a bomb, blow himself up or injure another person.
He also told the court he was expelled from three schools for taking drugs and for acting inappropriately.
The trial continues.