A dad-of-two had taken cocaine with "unsavoury people" before police stopped him at the wheel in Sutton, a court heard.
Police pulled Ashley Jones's Vauxhall Astra over on Tom Wass Road, on the afternoon of November 30, last year.
A test revealed he 31 micrograms of cocaine in one litre of blood, when the specified limit is 10 micrograms.
Mary Dixon, mitigating, said Jones had been mixing with "some fairly unsavoury people" at the time and he had been arrested twice "in quick succession."
She said he had since distanced himself from the group, and had sought medical advice for depression.
She said his family would be affected by the inevitable driving ban.
Jones, 26, of Banks Avenue, Kirkby, admitted the driving offence when he appeared at Mansfield Magistrates Court, on Thursday.
He was fined £400 and ordered to pay £85 costs and a £40 government surcharge.
He was banned from driving for 12 months.
Read more of the latest court cases here.