Density sensor adopts differential pressure principle to measure drilling fluid density. When the sensor is placed vertically in the drilling fluid, the pressure on the surface of the two flanges with corrugated diaphragm is different due to their different depth in the drilling fluid, while the central distance between the two corrugated diaphragm is a constant, so their differential pressure is only related to the density of the liquid.