A scientist at IBM Zurich has built a Lego microscope that captures images using a Raspberry Pi and a PiCam. There’s a YouTube video here: https://www.youtube.com/watch?v=PBSYnk9T4o4, an article in IEEE Spectrum here: https://spectrum.ieee.org/geek-life/hands-on/build-a-sophisticated-microscope-using-lego-3d-printing-arduinos-and-a-raspberry-pi and the actual instructions here: https://github.com/IBM/MicroscoPy
This instrument can be built with off-the-shelf components and a few parts 3D printed using a classroom 3D printer. Do note that there’s about $300 of parts and equipment and a certain amount of precision is needed. Such a project may be more suitable for high school students than for lower grades.