Miniature photoelectric sensors