5-24V DC
5-24V DC
Reed Switch (Normally Open or Normally Closed)
Adjustable (up to 10mm)
<10ms
-20C to 80C
-30C to 100C
5-95% RH (non-condensing)
50mm x 25mm x 15mm (L x W x H)
50g
Applications
| The Magnetic Float Sensor FSH01 (Horizontal) is suitable for a wide range of applications, including |
Liquid level detection in tanks, containers, and reservoirs
Monitoring of fuel, oil, and chemical levels
Water level detection in industrial, commercial, and residential applications
Leak detection and overflow prevention
Automation and control systems in industries such as food processing, pharmaceuticals, and chemical processing.
Magnetic Float Sensor FSH01 (Horizontal) DocumentationOverviewThe Magnetic Float Sensor FSH01 (Horizontal) is a non-contact liquid level sensor that uses a magnetic float to detect the presence or absence of a liquid at a specific level. The sensor is designed to be used in horizontal mounting configurations and is suitable for a wide range of applications, including industrial automation, process control, and IoT projects.Technical SpecificationsOperating Voltage: 5V DC
Output: Digital (High/Low)
Sensing Range: Up to 5mm
Response Time: 10ms
Operating Temperature: -20C to 80CPinoutThe Magnetic Float Sensor FSH01 (Horizontal) has a 3-pin interface:VCC (5V Power Supply)
GND (Ground)
OUT (Digital Output)Code Examples### Example 1: Basic Usage with ArduinoThis example demonstrates how to use the Magnetic Float Sensor FSH01 (Horizontal) with an Arduino board to detect the presence or absence of a liquid.
```c
const int sensorPin = 2; // Digital input pin for sensor output
int sensorState = 0; // Variable to store sensor statevoid setup() {
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}void loop() {
sensorState = digitalRead(sensorPin);
if (sensorState == HIGH) {
Serial.println("Liquid detected!");
} else {
Serial.println("No liquid detected.");
}
delay(500);
}
```
In this example, the sensor output is connected to digital pin 2 on the Arduino board. The code reads the sensor state and prints a message to the serial monitor indicating whether a liquid is present or not.### Example 2: Using with Raspberry Pi (Python)This example demonstrates how to use the Magnetic Float Sensor FSH01 (Horizontal) with a Raspberry Pi board using Python.
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
sensor_pin = 17 # GPIO pin for sensor outputGPIO.setup(sensor_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)while True:
if GPIO.input(sensor_pin):
print("Liquid detected!")
else:
print("No liquid detected.")
time.sleep(0.5)
```
In this example, the sensor output is connected to GPIO pin 17 on the Raspberry Pi board. The code uses the RPi.GPIO library to read the sensor state and print a message to the console indicating whether a liquid is present or not.### Example 3: IoT Application with ESP32 (MicroPython)This example demonstrates how to use the Magnetic Float Sensor FSH01 (Horizontal) with an ESP32 board using MicroPython to send data to a cloud-based IoT platform.
```python
import machine
import urequestssensor_pin = machine.Pin(32, machine.Pin.IN) # Sensor output pinwhile True:
if sensor_pin.value():
print("Liquid detected!")
urequests.post("https://example.com/iot-api", json={"sensor": "FSH01", "state": "true"})
else:
print("No liquid detected.")
urequests.post("https://example.com/iot-api", json={"sensor": "FSH01", "state": "false"})
time.sleep(10)
```
In this example, the sensor output is connected to pin 32 on the ESP32 board. The code uses the `urequests` library to send a POST request to a cloud-based IoT platform with the sensor state (true or false) as a JSON payload.Note: Make sure to modify the code examples to match your specific use case and hardware configuration. Additionally, ensure that the sensor is properly calibrated and mounted according to the manufacturer's instructions.