Back before the days of Politically Correct, military instructors had lots of gimmicks for keeping the class awake and on task.
Since I taught electronics and usually had a schematic projected on the wall or chalkboard to trace signal flow, things could get really dull if you weren't the one doing the tracing. Additonally our classrooms usually were ovedrheated ans stuffy. I discovered that you could take pictures from magazines printed on glossy stock, like Playboy, stick the face to clear gummed plastic, like laminating plastic, and wash everything but the ink, and of course, the picture, off the plastic, leaving you a very eye catching slide for an overhead projector. This in the days waaaaay before color copying.
I used to have one or two of these pix in my box of overhead slides, and when things got a bit sleepy, I'd slap one on the overhead, wait for the inevitable gasp, and replace it with an authorized slide. Those sleeping would be awakened by the gasp, and wondering what they'd missed, stay awake for the rest of the period.
I have also been known to drop metal trash cans beside the desk of a habitual sleeper.
The most efffective trick was to get the whole class to get up as quietly as possible, and go for a break at the snack bar, leaving the sleeper in peace.