Water sensor using Arduino based PLC
5 February, 2019 by
Water sensor using Arduino based PLC
Bernat Garcia


Introduction

In this case we are using a basic water digital sensor. This sensor is very useful to detect if its raining or if we have liquid water in some point of our installation. The sensor is digital and will provide us a logic 1 when it's dry and a logic 0 when the sensor detects liquid water.

Requirements

Ethernet PLC or 20 I/Os PLC:    Ethernet PLC       20 I/Os PLC

Water Sensor

Industrial Shields boards:  How to use the mapping pins of Industrial Shields boards

Connections

Odoo CMS - a big picture

Sensor PinM-Duino Pin
VCC5V
GNDGND
SIGPIN 2

Software

This software is very simple. We are just reading the value in our Pin 2 and displaying it in the serial monitor through the Serial functions. 

////////////////////////////////////////////////////////////////////////////////////////////////////
void setup(){
  Serial.begin(9600L);
  pinMode(2, INPUT);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void loop(){
  int water_level = digitalRead(2);
  Serial.print("Water level: ");
  Serial.println(water_level);
  delay(1000);
}

 
 
Water sensor using Arduino based PLC
Bernat Garcia
5 February, 2019
Share this post
Archive

Looking for your ideal PLC?

Take a look at this product comparison with other industrial controllers Arduino-based.

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>

Do you want more information?

Just fill the form!

Tell me more!