OpenSprinkler Forums OpenSprinkler Unified Firmware level sensor question

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #75270

    Eric Moran
    Participant

    I have done a few searches and I can find you a sensor/switch can be used to trigger a program. None of then indicate weather or not the program will continue to run if the sensor/signal stays engaged.

    Here is what I have and why I am asking.
    I have an Arduino that runs a program to fill a tank given a certain situation. This outputs high (5V) if filling is needed and low (0V) when to stop filling, as to not over fill.

    Is there an easy way for, say, sensor 2 is high turn on zone 8 and leave it on until the sensor 2 goes low? This would be regardless of the time, whether it be on for 20 seconds or for 24 hours.

    Kindly,
    Eric

    #75271

    Ray
    Keymaster

    The sensor/switch function is independent of weather algorithm. Sensor/switch controls whether a programs runs or not. The weather algorithm controls the water duration. Currently the firmware does not support what you need (i.e. program starts when sensor 2 turns on and ends when sensor 2 turns off). You can certainly implement this function yourself, the entire code is open-source.

    #75278

    Eric Moran
    Participant

    Ray,

    Thank you for the quick response.

    When you say “Sensor/switch controls whether a programs runs or not”. Does that mean that if a program is set to run for 30 seconds, and that program is triggered by a toggle switch, and that switch is activated, the program will continue to re-run until the switch is deactivated? Or does that mean that once the switch is activated the program runs once and needs to be reactivated to run the program again?

    I do appreciate that the code is opensource, and the work that has gone into it. With that said, I am not that good with coding. Most of what I do is either copy and paste or 30 lines or less. I wouldn’t know where to begin to edit your code.

    So what I guess I a trying to say is, if a switch being activated will continue to trigger a program (as long as the switch stays active), then I can work with that. If a switch being active will only trigger the program once, regardless of the switch still being active, thent would be easier for “me” to modify my code to send 2 second pulses instead of a steady on or steady off.

    Again, thank you for your time and efforts.

    Kindly,
    Eric

    #75279

    Ray
    Keymaster

    1. The sensor/switch only triggers a program to run once and the duration depends on the program’s duration multiplied by the weather adjustment if weather adjustment is selected for that program. After the program finishes running, if the sensor/switch is triggered again it will run again.

    2. I checked the code
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/OpenSprinkler.cpp#L1314
    I am pretty sure the program only triggers when the sensor/switch goes from high to low (or low to high if the reverse logic is selected). So unfortunately the program does NOT continue to run if the sensor remains activated. It’s only triggered when the switch has a status change.

    The main reason we made everything open-source is so that users can customize the firmware for their own need. Many users have all sorts of different need and it’s impossible to design one firmware to fit everyone’s need. I understand not everyone has coding skills, but there is only that much we can do. We can’t possibly address everyone’s need.

    To modify the program to fit your need, that ‘detect_programswitch_status’ function is basically what you need to modify. So instead of detecting sensor status changes, probably just detect if the sensor remains in one state.

    This line is where that function is being used to trigger a program to run:
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/main.cpp#L686

    #75282

    Eric Moran
    Participant

    Ray,

    Thank you again for your time and it is greatly appreciated. Especially with tracking down the lines of each file to start at. You have answered my questions, for where to start. I will reach out if I run into any roadblocks.

    Thank you again.

    Kindly,
    Eric

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware level sensor question