A Nova Scotia man tweeted a photo of his completed election ballot to challenge what he says is an "unconstitutional" ban in the Canada Elections Act.

Parker Donham, who blogs at Contrarian.ca, sent out this tweet Monday afternoon.

.<a href="https://twitter.com/ElectionsCan_E">@ElectionsCan_E</a> I just voted. Here's how: <a href="http://t.co/KLaMlX0pnP">pic.twitter.com/KLaMlX0pnP</a> —@kempthead

"To the extent that the Canada Elections Act bans the tweeting of a ballot, I think the act is unconstitutional and the only way to get that question before the courts is to break the rule," he told CBC News.

"I certainly don't want to encourage Elections Canada to prosecute me, but if that is the result, it will give them and those of us who feel the other way an opportunity to get the issue tested in the courts. If the courts find it is constitutional, I'll take my punishment."

A spokeswoman for Elections Canada said it is illegal to share a photo of your ballot and it expects to see the law enforced. She pointed to Section 164 of the Canada Elections Act, which states:

(1) Every candidate, election officer or representative of a candidate present at a polling station or at the counting of the votes shall maintain the secrecy of the vote.

(2) Except as provided by this Act, no elector shall

(a) on entering the polling station and before receiving a ballot, openly declare for whom the elector intends to vote;

(b) show his or her ballot, when marked, so as to allow the name of the candidate for whom the elector has voted to be known; or

(c) before leaving the polling station, openly declare for whom the elector has voted.

Section 2 (b) covers the ban on sharing a photo of your ballot.

Protected by charter

Donham calls that pointless overreach. He argues the Charter of Rights and Freedoms lays out the right to freedom of expression, including taking such a photograph and sharing it online.

"Moreover, when you're doing it about a ballot, you're exercising political speech, which the courts have found is at the very heart of the free speech right."

He knows he could just have tweeted whom he voted for, but he compares that to a newspaper writing about a police shooting rather than showing a photograph of it.

Donham argues Canada doesn't have a problem with voter coercion or vote buying — "other than governments buying people's votes with political promises" — but it does have a problem with people not voting at all.

"This is a vivid way that people can engage in political expression about an election. I say that instead of pretending they can punish people for that, Elections Canada should be celebrating and encouraging that," he said.

Donham tweeted a similar photo in Nova Scotia's 2013 provincial election. That sparked a year-long RCMP probe, but Donham was never charged. Nova Scotia has since added Clause 99 to its act, which makes it an offence to take a photograph of a ballot. That law comes into force in January.

Donham, who votes in Cape Breton's Sydney-Victoria riding, says he's voted for every major political party at some point.

If you're wondering why we always see photos of the leaders casting their ballots, Elections Canada says that's a special circumstance. Each party leader arranges media access to record the scene, and that's the only exception, the spokeswoman said.