Hi, I am using scheduled watering to fill capillary boxes. I have a floating sensor mounted and can connect and set it up as an interrupt, based on instructions in other responses.
I am however not sure how I can stop the watering immediately, when the switch flip? Any recommendations?
Brgds
Lars
Ciao Angelo, very helpful - grazie. I think I have a good understanding now and will test my setup as soon as I get a chance to go to the summerhouse.
Have I understood your comment "So until the Pin is to GND the pre-emptive status will be extended of the "duration of pre-emptive..." indefinitely" correctly, when I conclude that the pre-emptive condition will remain (valve closed) as long as the level is GND? My first edge is going from positive to GND and hence level will remain GND, I assume.
Brgds
Lars
Ciao Lars,
here some clarifications:
- When you set the interrupt PIN to neg, it configure it to stay in a pull-up configuration, so when the pin is not connected (floating) it stays at 3.3v level.
- The Actuator output takes different meaning depending on the type of actuator, in this case, should be "pulse" type, so when you set it to zero it will just switch off the actuator. if you set it to N it will generate a pulse on N seconds. This will override any previous command give to this actuator (so it is pre-emptive)
- The "duration of pre-emptive..." is the number of seconds that the actuator will be pre-empted after the interrupt is triggered, so it can not be used by other functions on the software.
For example let's assume that you set a pulse of 60 seconds to open the valve. The tank starts to fill and the interrupt from the float switch is triggered 30 sec after the start of the pulse, the actuator is then set to zero (Actuator output=0) and the valve is closed. The actuator cannot be re-enabled until the pre-emptive time is finished.
In case of your setting "first edge+Level" the "Level" means that when pre-emptive time is about to finish, the system will check the pin level and start the follow-up action which is set to "extend blocking state". So until the Pin is to GND the pre-emptive status will be extended of the "duration of pre-emptive..." indefinitely.
Normally I set the "duration of pre-emptive..." to 600 sec, so if the actuator have to be released it will be within 10 minutes.
Hope this was helpful.
Angelo
Ciao Angelo, thanks a lot for your answer. The article about interrupt is very good and helpful.
My setup is described here:
I have two rows of 5 capillary boxes, each string connected to a valve through a 15mm tube. Hence I control each string independently through a valve.
I have mounted a float switch in a box on each side. The switch is of this type:
It is mounted and connected so the GPIO is floating when the box is at low level and GRND when the box reach max level. This means that first edge goes to 0V.
I have set the HW up according to your instructions and it seems to work well. The HW settings are here (sorry about the difference in scale):
I have tried to set the interrupt handler up according to instructions, but have some questions - and would appreciate your QA :-)
I am specifically in doubt about what the value should be in the "Actuator output" field and the "duration of pre-emtive..." field. Is the last field in seconds or minutes? and should I set it to 1.440 minutes or 86.400 seconds if I want the next watering try to take place after one day? (I assume it will take days before the boxes are empty).
Your advice is much appreciated, thanks in advance.
Brgds
Lars
Hi Lars,
I suggest you to read this article:
Unfortunately the interrupt setting is quite complex, because it's made to be flexible and fit with several use case (push buttons, switches, wind sensor, flow sensor, level sensor).
If you can describe how the switch works then we can do the configuration together.
regards,
Angelo