Forum Software Ferduino code Signal from level sensor and usage with Ferduino

Signal from level sensor and usage with Ferduino  [SOLVED]


Post Number:#1 Post Sat Nov 11, 2017 6:22 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Hi guys,

I'm building my super incredible multi-tank system..obviously managed with Ferduino...as you probably most of you well know...
Some question for Fernando about level sensors.

In Ferduino code they are used as analog signals, doing things on the basis of the fact that their reading is >400 or <400. For my understanding I have a couple of questions:

- >400 is when the contact is closed (so green led switched ON near its related plug on Ferduino)? or it is exactly the opposite?
- I saw the scheme you published here in the forum for the TPA, where it is possible to see where you have sensors from 1 to 4. my question is: all your sensors are installed in the same way? I mean: when water is over the sensor the contact is closed and when it is below the sensor the contact is open? or some sensors are installed in the opposite way?

thank you so much, as usual.

Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Try this example to learn how it works.

const byte sensor1 = 54; // A0;       
const byte sensor2 = 55; // A1;       
const byte sensor3 = 56; // A2;       
const byte sensor4 = 57; // A3;     
const byte sensor5 = 58; // A4;
const byte sensor6 = 59; // A5;   

void setup()
{
  Serial.begin(9600);
  while(!Serial)
  {
    ; // Wait for serial.
  }
  pinMode(sensor1, INPUT);
  pinMode(sensor2, INPUT);
  pinMode(sensor3, INPUT);
  pinMode(sensor4, INPUT);
  pinMode(sensor5, INPUT);
  pinMode(sensor6, INPUT);

}

void loop()
{
  int Value1 = analogRead(sensor1);
  int Value2 = analogRead(sensor2);
  int Value3 = analogRead(sensor3);
  int Value4 = analogRead(sensor4);
  int Value5 = analogRead(sensor5);
  int Value6 = analogRead(sensor6);

  Serial.print("Sensor 1: ");
  Serial.println(Value1);
  Serial.println();
  Serial.print("Sensor 2: ");
  Serial.println(Value2);
  Serial.println();
  Serial.print("Sensor 3: ");
  Serial.println(Value3);
  Serial.println();
  Serial.print("Sensor 4: ");
  Serial.println(Value4);
  Serial.println();
  Serial.print("Sensor 5: ");
  Serial.println(Value5);
  Serial.println();
  Serial.print("Sensor 6: ");
  Serial.println(Value6);
  Serial.println();
  Serial.println("*******************************");
  Serial.println();
  delay(5000);
}


The initial status is different between sensors in default code but it doesn't matter.

In default code the normal status is:

Image


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Fri Nov 17, 2017 9:54 pm
Posts: 50
Topics: 13
Solve rating: 0
Joined: Wed Sep 06, 2017 7:45 pm
Topics: 13
Age: 40
Gender: None specified
National Flag:
Italy
Got it. I tried your code and I understood. thanks




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron