Mark Sinclair, of Derwent Road, St Annes, admitted drug driving on Park Road in Blackpool on April 2 this year.
Police pulled over his van and drug tested the 46-year-old after noticing reddening around his eyes.
Blackpool Magistrates Court heard Sinclair admitted taking cannabis due to suffering from arthritic back pain.
His defence lawyer Steven Duffy told magistrates that the derivative of cocaine that was found in his system may have come from the codeine he takes.
‘Devoted’ Blackpool mum, 29, found dead in bed by her boyfriend
Lytham St Annes care home boss appears in court after death of residents
Blackpool FC training ground plans pass first hurdle
Lytham man who made over £500k selling counterfeit car badges ordered to repay ill-gotten gains
Smirking Blackpool burglar jailed after being caught on CCTV
He said: "He admits taking cannabis because he suffers from arthritic back pain.
“However, he denies ever using cocaine the derivative of which was found.
“However that may have come from the codeine he also takes.”
Sinclair appeared in court on Tuesday, June 28 and was banned from driving for 23 months.
Blackpool magistrates also told him that he must pay £419 in costs and fines.