P45 (Liquid Level Sensor) with Arduino

Imagine the situation you need to detect if a container with some liquid, such as a beer keg, is full, or is dry. There are sensors of the most varied types, and several of them are very ingenious, but very simple. One of them is the liquid level sensor, and it is the one we will learn how to connect to the Arduino.

Figure 1 - P45 Liquid Level Sensor with Arduino

The sensor

For our practice we will use the P45, a vertical liquid level sensor made of PP plastic, which supports a maximum voltage of up to 100 V, a maximum current of up to 1 A and a maximum operating power of 50 W. This sensor is a magnetic switch, and when in contact (closed) it has a resistance of 0.4 R. See how it works:

Figure 2 - P45 states

As shown in Figure 2, just invert the sensor vertically to use in Normally Open (1) or Normally Closed (2) mode, depending on the application. And because it is a magnetic switch (3 - Floating float with a magnet), as the liquid under analysis, changes its volume, it will naturally change the state.

The circuit

In order to eliminate reading noise, we will add a 10 kR resistor, and thus create a reference voltage, in this case, known as the Pull-Down Resistor. Items:

  • 1x - P45 Liquid Level Sensor
  • 1x - 10 kR resistor
  • 1x - Arduino
Figure 3 - The assembled circuit
The code


The logic is simple, we consider that the sensor is connected vertically downwards, that is, Normally Open, which leads to a LOW reading when the container in which it is located is full, and HIGH when the level is below the line measurement.

P45 (Liquid Level Sensor) with Arduino P45 (Liquid Level Sensor) with Arduino Reviewed by AJ Alves on quarta-feira, abril 17, 2013 Rating: 5

Nenhum comentário:

Tecnologia do Blogger.