ST. LOUIS – A former Boy Scout volunteer was sentenced Thursday for hiding cameras in multiple bathrooms at a St. Francois County, Missouri, scout camp.

Prosecutors with the U.S. Attorney’s Office for the Eastern District of Missouri said David L. Nelson, 41, pleaded guilty in January to four felonies during a federal court hearing Thursday. His charges included two counts of production of child pornography and two counts of attempted production of child pornography.

Nelson, who worked as a volunteer chaperone, admitted in court to installing pinhole cameras in bathroom paper towel dispensers at the Bar F Ranch near Farmington, about 80 miles south of St. Louis.

Nelson was finally caught, thanks to his own cameras. He’d set them up to include a view of a shower stall, but the cameras recorded him in the process.

A scout leader and Boy Scouts discovered one camera while cleaning a restroom stall. They later found a second camera, then contacted the St. Francois County Sheriff’s Office to investigate.

A sheriff’s deputy questioned Nelson, who said he was looking for a cellphone charger that he left behind in the stall after a shower.

A U.S. District Court judge sentenced Nelson to 22 years in federal prison. Nelson was also ordered to pay $55,000 in assessments that will go toward a victims fund and prevention program, as well as $6,810 to pay for counseling for his victims. Whenever Nelson gets out of prison, he’ll be on supervised release for the remainder of his life.

At Thursday’s sentencing hearing, victims and their parents told the judge that Nelson’s crimes have made them fearful and uncomfortable when using a public bathroom, and have left them unable to trust others.