Forum Software Ferduino code Float sensor inversed, how to change in code?

Float sensor inversed, how to change in code?  [SOLVED]


Post Number:#1 Post Thu Mar 22, 2018 2:46 am
Posts: 1
Topics: 1
Solve rating: 0
Joined: Mon Mar 19, 2018 2:11 pm
Topics: 1
Age: 38
Gender: None specified
National Flag:
Netherlands
Goodmorning everybody,

I've got an question, my float sensors are inversed and due to the construction of the sensors it isn't an option the turn the float sensor arround. So I have to change it in code.

I've found the code below:

void check_nivel() // Verifica o nível do reef e fish only.
{
  if ((myAnalogRead(sensor5) > 400) || (myAnalogRead(sensor6) > 400) || ((myAnalogRead(sensor2) < 400) && (bitRead(tpa_status, 1) == false)))
  {
    nivel_status1 = true; // Sinaliza nivel baixo em um dos aquários ou sump
  }
  else
  {
    nivel_status1 = false; // Sinaliza nível normal dos aquários e sump
  }



To inverse the signaling do I have to swap the nivel_status1 values true and false?


I was also wondering if there's a failsave mechanism if the float sensor in the reef is broken? I'm a little bit afraid that if the sensor is stuck the ATO will overflow the aquarium. Is it possible to set a max. runtime or another failsave option?

Regards!
Last edited by Fernando Garcia on Fri Mar 23, 2018 9:12 am, edited 1 time in total.
Reason: Please use tags [code][/code] to post any code here.

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!

Welcome Sidney!

To inverse the signaling do I have to swap the nivel_status1 values true and false?


Not, change the logic of < and >.

I was also wondering if there's a failsave mechanism if the float sensor in the reef is broken? I'm a little bit afraid that if the sensor is stuck the ATO will overflow the aquarium. Is it possible to set a max. runtime or another failsave option?


Not, in my system the level sensor is in redundancy with float valve. If the float valve fail the system will turn off a solenoid to prevent fill the thank with fresh water.

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




  • Similar Topics
    Replies
    Views
    Last post

Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron