Most of us have had the problem of running out of battery while we're out and about.

Remembering to carry a phone charger is the first challenge - the next is finding somewhere to plug in.

London train passenger Robin Lee was arrested on suspicion of abstracting electricity on Friday, after using a plug socket to charge his phone in a carriage.

He was de-arrested soon afterwards, but re-arrested for unacceptable behaviour.

Robin told Newsbeat: "I got on the train. There was a plughole next to the door. A community support officer said, 'Do you know you're stealing electricity?'

"I said something along the lines of, 'I'm getting off in a minute.' She said, 'This is a crime, you can get arrested.'"

Robin said he got off and some police officers happened to be on the platform.

"She called to them, 'You need to arrest this man, he stole electricity.'

"They asked me if this was true, and they arrested me for abstracting electricity."

Robin said he was taken in a van to the police station, where he was de-arrested and then re-arrested for inappropriate behaviour on the platform, before being let go.

"The whole thing was ridiculous," Robin said.

British Transport Police says officers responded "to a report of a man becoming aggressive when challenged by a PCSO about his use of a plug socket onboard an Overground train".

Where can you charge up?

Ed Smyth, criminal lawyer at Kingsley Napley, told Newsbeat there are "no hard and fast rules" when it comes to using plug sockets in public areas such as cafes and cinemas.

"In order to be absolutely safe you should always ask, unless a plug is clearly marked for public use, which it usually is.

"But, that said, the risk of getting into trouble is likely to be very small. If you do choose to use it and you're asked to stop then the best approach is to stop.

"I don't see that failing to ask someone would get you into trouble. But failing to stop when asked to is a different matter."

Abstracting of electricity

The offence of abstracting of electricity is part of the Theft Act 1968 in England and Wales, and carries a possible prison sentence.

It says: "A person who dishonestly uses without due authority, or dishonestly causes to be wasted or diverted, any electricity shall on conviction on indictment be liable to imprisonment for a term not exceeding five years."

Ed says the most common cases of abstracting of electricity are people bypassing an electricity meter by rewiring it, or cannabis factories tapping into a nearby electricity supply. Another is powering sound systems at illegal raves.

Using 'dishonestly'

Ed says the key word is "dishonestly". But what does it mean?

"Using it dishonestly means using it when you know you're not entitled to it," Ed explained.

"In law, dishonesty has two parts to it - would the ordinary person in the street think you were being dishonest? And would you realise that the ordinary person in the street would think you were being dishonest?

"If you're being asked to stop and you don't, then it's more likely you'd be found to be acting dishonestly."

The other important part is "due authority".

"If you ask someone in good faith then you can claim due authority defence.

"If there's a sign saying 'Not for public use' then you don't have due authority, and while it's unlikely any action would be taken, you may have difficulty persuading people you weren't acting dishonestly."

If you unplug something without asking then Ed says you're asking for trouble.

When it comes to electricity, Ed thinks people have a slightly different attitude.

"If you're in the cinema and you fill up a big tub of popcorn and walk away with it, that would be theft, but we have a slightly different attitude to electricity.

"Probably because we recognise the value is so small, and chargeable devices are so integral to our lives now."

Follow @BBCNewsbeat on Twitter, BBCNewsbeat on Instagram, Radio1Newsbeat on YouTube and you can now follow BBC_Newsbeat on Snapchat