Jan 24, 2018

Water Level Sensor of Washing Machine (STM32F103C8T6)

Typical work principle of water level sensor of a washing machine shown on the picture. Sensor is located above the water level and connected by an air tight tube to the bottom of the tub. When the water level increase, the pressure in tube increase as well due to gravitational force.

The sensor convert pressure to frequency by placing an ferrite bead on a diaphragm in an inductor. The variation of inductance then converted to frequency by a chip and some passive components.
The frequency has a quite linear correlation to water level. In the curve, 26 kHz generated when water level 0mm, and 23 kHz when water level 200mm. In practice, 400mm water level will generate 20kHz.

The sensor looks like the picture  at left side. There are three pins which are GND, OUT, VCC or sometimes VSS, OUT, VDD (5VDC). If you are not sure, you can check the forward voltage of the pins since there is a protection diode between VDD and VSS. When the forward is about 0.4-0.6V meaning the plus lead of multimeter is VSS and minus lead is VDD because the protection diode is installed in reverse polarity.

Two pin type sensor is not usable for this project because it contains only inductor without L to Fconverter. Two pin type is suitable for the system which converter located in the washing machine controller.

I made 10 sampling per second so the pulse count range is 2627 down to 2000. You can convert the range of reading to 0-100% or 0-400mm depending on your application. Connect a plastic tube to the sensor, blow the tube with your mouth to simulate the water level change.

You can get the code here https://drive.google.com
It was compiled using Coocox CoIDE and GNU Tools ARM Embedded however other compilers will do.

Wifi Display (ESP8266 STM32F103C8T6 P4.75)

This Display will receive text from PC or phone through wifi. It can work as access point or station. Access point means you can connect ...