Miniature photoelectric sensor detects fill level during secondary packaging operations