Thomas Ball, 30, planted the device at the North Yorkshire school he was working at in 2018.
When the camera was recovered he initially denied responsibility but police were able to prove he had purchased and placed the device.
Ball, from Atherstone, Warwickshire, was jailed on Wednesday having admitted a series of child sex offences.
North Yorkshire Police’s Det Con Adam Fenwick said: “Thomas Ball was in a trusted position of responsibility which he has blatantly abused for his own gratification.
“He is a cold and calculating individual who carefully planned and premeditated his actions.
“He clearly poses a significant risk to young people and we hope his sentencing will give some closure to the victim and their family.”
Ball pleaded guilty at York Crown Court to voyeurism, three counts of making indecent images of children, one count of taking indecent images of children and one count of possessing indecent images of children.