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

More of a Question #79

Closed
lorddaren opened this issue Nov 20, 2014 · 7 comments
Closed

More of a Question #79

lorddaren opened this issue Nov 20, 2014 · 7 comments

Comments

@lorddaren
Copy link

I have a Raspberry Pi B+ and a Sainsmart 5v 8 Channel relay module. Is it possible to use OPSi with this setup?

@Dan-in-CA
Copy link
Owner

Yes it is possible. You would need to re-assign the pins on the Pi to switch the relays. This can be done with a plugin.

@lorddaren
Copy link
Author

Meaning I need to create a plugin or there is one? If I need to create one would you be able to point me in the right direction? Thanks.

@Dan-in-CA
Copy link
Owner

I know of one user who has worked on such a plugin. I have tried to contact him and asked if he has anything to share. Stay tuned.

@Dan-in-CA
Copy link
Owner

Good news.
The user who has been working on this sent me the files for the relay board plugin. He says that there may be bugs but it is a good start. I have tested and fixed a couple of small bugs but I don't have a relay board.

You can download the files from:
http://1drv.ms/1zSf7MB

The relay_board.py file goes into the plugins directory under OSPi and the relay_board.html goes into the templates directory. Once the files are in place, reboot the pi then you can access the relay board setup page from the plugins dropdown menu.

See the Wiki for some info on plugins especially the part about "To debug your plugin":
http://rayshobby.net/mediawiki/index.php/Python_Interval_Program_for_OSPi#Plugins

Please let us know how it works for you. Ask questions here if you run into problems.

@lorddaren
Copy link
Author

This is great news. I will load it up and test it out. Thank you very much.

@lorddaren
Copy link
Author

I have the plug in loaded up. But have another question. And maybe I need to read through the docs on OpenSprinkler more but how would I handle the common with the relay?

@Dan-in-CA
Copy link
Owner

First, there is a new set of files in the original download location for the plugin that I think will work better for you.

Also there is an image file "P1 Header w nums.svg" which shows the pin numbering for the Pi. You should be able to double click the file and have it open in your web browser.

Look in the relay_board.py file under pin defines to see which pins are used for the relays (use the black numbers).
Check out this you tube vid for more info.
https://www.youtube.com/watch?v=oaf_zQcrg7g

As far as the wiring for the relays:
You should have 2 wires from the 24V power adapter for the sprinkler valves. Let's say you have a 4 wire cable that will run from your controller (relay board) to your valves.

Connect one wire from the 24v adapter to one of the wires in the cable (usually a white wire)
Connect the other wire from the 24v adapter to one side of each relay.
Connect one free wire from the cable to the other side of a relay.
So when a relay is activated it will make a connection from the 24v power source to one of the wires in the cable.

On the valve end you connect the common (white wire) to one wire of each valve.
Connect one of the other wires in the cable to the other wire of one of the valves.

With a 4 wire cable you can control 3 valves. (one wire is common and the other three control one valve each.)

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

2 participants