In this letter, we demonstrate a miniature viscosity sensor based on GaN-on-sapphire optical device integrated with an inclined flow channel. The monolithic device, consisting of a pair of GaN diodes responsible for light emission and detection, can monitor droplet sliding. Without the need for external optical components, the proposed elegant design of a few centimeters in size is capable of distinguishing the liquid viscosities from 2 to 600 mPa•s in tens of seconds. The proposed optical sensor exhibits attractive features, such as compactness, low cost, ease of operation, and small liquid volume required, making it suitable for practical applications in liquid viscosity measurement.