A weapons-obsessed teenager plotted carnage in the capital when he planted a homemade bomb on the Tube, a court has heard.