A cannon is a piece of artillery typically used as a weapon, although they are also commonly used for ceremonial purposes.
In 1991, while the Dursley family and Harry Potter were hiding out at the Hut-on-the-Rock following Vernon Dursley's taking the family on the run from wizards, Dudley Dursley stupidly commented "Where's the cannon?" when Rubeus Hagrid knocked loudly on the door. Later that year, Harry pulled a Christmas cracker with Fred Weasley and it "went off with a blast like a cannon."
A cannon was used at the start of each of the three tasks during the 1994 - 1995 Triwizard Tournament. Hogwarts Caretaker Argus Filch fired it, signalling the contestants to proceed to the task. On several occasions, he accidentally fired the cannon before it was time for the champions to proceed to the task.
- Harry Potter and the Philosopher's Stone (First mentioned)
- Harry Potter and the Goblet of Fire (film) (First appearance)