A system for detecting bubbles within a liquid flowing in an interior of a pipe. The system includes a transmitter emitting directed light through the liquid flowing through the pipe and a receiver for receiving the emitted directed light from the transmitter. The transmitter and receiver are affixed on opposite sides of the pipe. The system also includes a microcontroller having a modulator. The microcontroller communicates with the transmitter and receiver. The microcontroller sends a modulation protocol for emitting the directed light with a specified modulation protocol to the transmitter and receiver. The transmitter emits the directed light as modulated light based upon the modulation protocol and the receiver filters out all unmodulated light, correlates information on modulated light received from the transmitter and sends correlated light information to the microcontroller. The microcontroller determines a presence of bubbles in the liquid based on the light information received from the receiver.