Tijekom pandemije COVID-19, e-radionica.com nastavlja s normalnim radom. Sve mjere opreza se redovno poduzimaju te su naručeni paketi sigurni. Opcija dostave uslugama Hrvatske Pošte i osobno preuzimanje privremeno su onemogućeni iz sigurnosnih razloga.

  • Worldwide Shipping

  • 24/7 Customer Support

  • FAQ
  • Worldwide Shipping

  • 24/7 Customer Support

  • FAQ

Float sensor

You are a beginner with Croduino. Or electronics? A specific module caught your eye, but you do not know how to use it? Do not worry, HUM is here for you! How to Use Module (HUM) is a blog tutorials series by e-radionica where you will find all you need in order to begin working with your favorite module. Tutorials include technical characteristics, work principles, instructions on how to connect the module with Croduino and the basic code. Everything else is left to your imagination.

DESCRIPTION

The float sensor is a device used to determine the fluid level in a tank. There are many applications in real life, such as flood detection in an area where a river spills, a sewer overflow, a barrel filled with oil, and many other useful uses. Because the current that the switch can handle is very low (maximum 0.5A), the switch must be used in a combination with a relay or a contractor when connected to a load greater than 0.5A.

SPECIFICATIONS

Wire length: 37cm
Input diameter: 8mm
Netto weight: 70g

TYPES OF MATERIALS

It is very important that we choose a float sensor made of the type of material suitable for our needs.

Nylon: suitable for almost all types of oils, diesel, organic chemicals
Polypropylene: suitable for a wide range of acids, detergents, chemicals, oils, and water
Polyphenylene sulphide: suitable for more aggressive chemicals and operating at higher temperatures, up to 120 °C
Stainless steel: suitable for medical use, use in food processing, hydraulic oils, fuels and applications at higher operating temperatures, up to 135 °C

HOW DOES IT WORK

The float sensor is connected via a contractor or relay, but it can also be connected to Croduino as an input (switch or push button) for the required project. The float sensor has 2 basic work principles: when the water reaches the sensor, i.e. the float sensor is above the water level and the water will activate the sensor as the level increases, and when the float sensor is underwater, i.e. when the sensor reads the water level drop below some predefined levels.
Therefore, the float sensor has two work principles:
•Above water; water reaches the sensor
•Underwater; water lowers under the sensor's level

The image shows the Float sensor above water and how water turns it on as it rises.

The image shows the Float sensor underwater and how the water drop turns it on.

CONNECTING


The image shows a simple connection between the Float sensor and Croduino. The float sensor is connected to Croduino as a standard switch. We will use a built-in pull-up resistor in the program to read the logical unit, i,e. logical zero. After you have connected everything as indicated in the scheme, it's time to test our connection by uploading the code. Open the Arduino IDE, find your Croduino, i.e. to which port it is connected and switch the board to the Arduino Nano. As an indicator that the float sensor is turned on, we will use the LED on pin 13 that is built-in on each Arduino.

void setup(){
pinMode(13, OUTPUT);
pinMode(12,INPUT_PULLUP);
}
void loop(){
bool buttonState = digitalRead(12);
digitalWrite(13, buttonState);
}

Transfer the original code to Croduino.

When the float sensor switch is pulled up, the LED will be on. The circuit opens when the switch is not pulled, the circle closes when the switch is pulled. The float sensor uses a magnetic reed switch that consists of two contacts enclosed in polypropylene. An internal magnet will pull the two contacts together if the switch is pulled and vice versa.

Leave a Reply