An optoelectronic device includes a semiconductor substrate and a first stack of epitaxial layers, which are disposed over the semiconductor substrate and are configured to function as a photodetector, which emits a photocurrent in response to infrared radiation in a range of wavelengths greater than 940 nm. A second stack of epitaxial layers is disposed over the first stack and configured to function as an optical transmitter with an emission wavelength in the range of wavelengths greater than 940 nm.