Viscosity measurement has wide ranging applications from oil industry to pharmaceutical industry. However, measuring viscosity in real-time is not a facile process. This paper provides an elaborate mathematical model and study of viscosity measurement in real-time using pressure sensors. For a given flowrate, a change in liquid viscosity gives rise to a change in pressure difference across a particular section of the pipe. Hence, by recording the pressure change, viscosity can be calculated dynamically. A mathematical model as well as a finite element analysis model has been presented to determine viscosity from flowrate and pressure difference. A set of pressure sensors can be placed at a fixed distance from each other to get the realtime pressure change, while flowrate can be obtained using a flowmeter. For the finite element analysis, the pressure sensors were placed 60 mm away from each other. The radius of the pipe was 19 mm. A mixture of water and glycerol, with different ratios, was used to provide variable viscosity.