Many schools across Canada have banned cellphones from classrooms.

The battle between students and teachers over the use of cellphones in schools reached new heights in B.C. when a school principal installed an electronic jamming device to stop the ring tones, the chatter and the text messaging.

Steve Gray, the principal in Port Hardy Secondary School on the north coast of Vancouver Island, was frustrated that a cellphone ban in his school wasn't working.

"We banned them a couple of years ago and that doesn't seem to have stopped the problem," Gray told CBC News on Monday.

"When there are cellphones in use, there is a constant background of 'Please put your cellphone away. Please give me your cellphone,'" Gray told CBC News.

So about a month ago he went online and bought a device from China to jam the signals.

Electronic warfare

Last week the device, which Gray described as a little box with four antennas, arrived from China, and he plugged it into the wall in the school library.

"I thought we'd do a little experiment and see what happens," he said.

"It was astonishing how it worked.… Two-thirds of the school instantly shut down for cellphone use. The teachers were very happy. Students were wondering what was going on," he said.

"Many students said, 'Yeah, you have done the right thing,'" said Gray.

Many others, however, were irate, and on Thursday a group of students refused to return to class after lunch, claiming their rights had been taken away, said Gray.

The students informed the principal the jamming device was illegal in Canada, and Gray had to pull the plug.

Now he's back to the frustration of an ineffective cellphone ban.

"It's not easy to enforce, because, you know a cellphone in your pocket, it's impossible to know it's there, and it's always on, always ready to be used," he said.

Toronto has largest ban

In Toronto, school trustee Josh Matlow understands the principal's frustration, but he said with proper enforcement cellphone bans can work.

Matlow introduced Canada's largest ban two years ago across 560 public schools. He acknowledges that some students still break the rules, but says fewer are using phones inside the classroom.

"If they are caught using it in the classroom, the teacher is allowed to confiscate the cellphone. Certainly, in most cases they get a warning, and they are told to turn it off," he said.

In New York City schools, students are banned from having cellphones on school property, but Matlow said that violates their right to contact parents on the way to and from school.

Instead, he urges school boards in Canada to go as far as they can to ban cellphones in the classroom — without breaking the law.