A Mansfield man who made a form of stun gun after watching a video on YouTube was held in prison for 44 days.
The homemade device discharged a shock but the batteries quickly went flat, Nottingham Crown Court was told.
Peter Charnock (27), of Layton Avenue, was prosecuted for having a prohibited weapon under the firearms act.
He also admitted handling a stolen laptop and failing to surrender to bail. He was in breach of a suspended sentence at the time.
Police went to his address on 22nd November last year and found the stun gun. “He said he watched a video on YouTube and made it himself. He didn’t say why,” said Paul Stimson, prosecuting.
His barrister Michael Evans said: “This stun gun is about as crude as one can get.
“He didn’t know it was an offence. There’s no warning on YouTube (that) it’s illegal.’
Judge Michael Stokes, the Recorder of Nottingham, told him he had now been in prison for 44 days and appeared to be well on the way to beating his drug addiction.
He was sentenced to a 12 months community order with supervision and 20 probation sessions. The device was confiscated and destroyed.