Light barriers in a compact design