Buzzer interval when waterlevel is low

Basic / Standard Reef Angel hardware
Post Reply
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Buzzer interval when waterlevel is low

Post by lmolenmaker »

Hi guys,

I would like some help from you.

I have my water-level sensor in my freshwater reservoir.

I would like to have my buzzer (connected to actinic channel) activated when the level reaches 20%. It needs to be an interval, not continuous, lets say every minute for 1 second at 100% loudness.

It also needs to switch off my fresh water pump (relay 3).

Can somebody please provide me with a piece code.

That would be much appreciated.

Thanks in advance.

Leslie
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Buzzer interval when waterlevel is low

Post by rimai »

Is it less or more than 20%?
What function are you using right now for port 3?
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Buzzer interval when waterlevel is low

Post by lnevo »

Its in ATO reservoir so I would assume alert if less than 20%
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Buzzer interval when waterlevel is low

Post by lmolenmaker »

Sorry, for replying so late and for not being clear.

I meant less than 20% and the power of my freshwater pump is connected to port 3.

My freshwater pump switches on when the float switch is activated in my sump. This float switch is a stand alone and not connected to the ReefAngel.

So basically it needs to switch Port 3 off when the level is lower than 20% in the fresh water reservoir and let a buzzer go with an interval. A continuous buzz will drive me and the rest of the family crazy.

Thanks for your help guys

Leslie
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Buzzer interval when waterlevel is low

Post by lmolenmaker »

Anybody?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Buzzer interval when waterlevel is low

Post by lnevo »

This should do it:

Code: Select all

if (ReefAngel.WaterLevel.GetLevel() < 20) {
  ReefAngel.Relay.Off(Port3);
  ReefAngel.PWM.SetActinic( (now()%60<1)*100 ); // Set 100 to the volume % you want. 
}
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Buzzer interval when waterlevel is low

Post by lmolenmaker »

Thank you Lee.

What does the %60<1 stand for?

Leslie
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Buzzer interval when waterlevel is low

Post by rimai »

% is a mathematical formula of modulo.
https://en.wikipedia.org/wiki/Modulo_operation
Basically it means one second out of every 60
Roberto.
Post Reply