There are only two ways to get digital audio between your TV and soundbar, or your TV and receiver, or really between any piece of gear that transmits audio in a home A/V system: HDMI and optical.
Optical sensors are a broad class of device for detecting light intensity. This can be just a simple component for notifying when ambient light levels rise above or fall below a prescribed level, or a ...