1. An apparatus for generating light, comprising:a substrate;
a light source mounted on a top surface of the substrate, the light source generates output light;
a detector mounted on the top surface of the substrate, the detector detects light incident thereon; and
a waveguide consisting of a single body having a shape of a polygonal prism, a base of the polygonal prism consists of five sides so that the polygonal prism has five flat side surfaces, one of the five flat side surfaces including a first portion that is in direct contact with the light source and a second portion that is in direct contact with the detector, wherein a portion of the output light enters the waveguide through the first portion, travels through the waveguide and exits the waveguide through the second portion to the detector,
wherein the light source includes a top surface and emits the output light through the top surface and wherein a surface area of the light source where the first portion of the one of the five flat side surfaces directly contacts the top surface of the light source is less than an entire area of the top surface of the light source.