Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ESP01 Relay Boards #16

Open
GregFrost opened this issue Dec 27, 2021 · 0 comments
Open

Add support for ESP01 Relay Boards #16

GregFrost opened this issue Dec 27, 2021 · 0 comments

Comments

@GregFrost
Copy link

GregFrost commented Dec 27, 2021

I have been able to get the OpenSprinkler firmware (with some modifications) to work on an ESP-01 controlled relay board like the ones shown at these link:
AliExpress Link
Amazon Link

The trick with these boards is that the relay is controlled by sending a 4 byte binary code on the serial line 115200/8/n/1 from the ESP module (there is another non-reprogrammable MCU on the board that listens to the serial commands and controls the relays). e.g to turn on relay 1 on you send the 4 byte hex code a0, 01, 01, a2. To turn it off you send a0, 01, 00, a1 (so it looks like the first byte a0 is a delimiter, then the second byte is the relay number, the third is on or off, and the last byte is a checksum).

I have also found that I need to add a 20msec delay between controlling different relays for them to reliably switch.

There are many other boards like this, with differing numbers of relays (I have seen single channel relays and 2 channel relay boards).

With these boards, all you likely need to add is a full bridge rectifier with a buck converter to power the board from the solenoid 24V relay line, and you have a very inexpensive headless WIFI sprinkler controller (no display or buttons, you need to rely on the phone/browser interface).

I would love it if support for this type of board could be added to OpenSprinkler. I got mine working by hacking the switching logic for the RF station type in OpenSprinkler::switch_rfstation to send the appropriate serial command. To do it properly, you would have to add a new station type (perhaps named Serial Binary, or something like that), where you specified the binary sequence to send to turn the relay on and the sequence to turn it off. That would require updates to the ui code which is out of my league (hence I only co-opted the RF station type in my copy of the code).

Is this something that you would consider adding?

PS: the forum seems to be broken, as that may have been a more appropriate place to post this, but whenever I am logged in, the forum links give me Page Not Found error, preventing me from being able to post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant