7

Here's what I'm looking to do and I'm having a hard time wrapping my head around the electrical/wiring part of this:

I have a 1" PVC pipe. I want to put a valve inline with this pipe and with my Raspberry Pi 2 I want to be able to open and close this valve. I'm guessing the type of valve I'll want to use is something like this.

Obviously that takes 110 volts, so the power source wouldn't be the pi. I have 120 volts run to the same area which I imagine I would use to control the valve (for the power source).

How does the pi fit in this place? How exactly could I wire this up so that a signal from a GPIO could switch this valve on/off?

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
Thomas Stringer
  • 183
  • 1
  • 2
  • 7

4 Answers4

4

Use a Solid State Relay for 10 bucks like: This here You control it from Rpi GPIO ports and is isolated from the outlet and is compatible with Rpi outputs. Has also a LED which shows the status of the relay. enter image description here

jet
  • 379
  • 2
  • 9
2

The Raspberry Pi is the brain.

The relay is the muscle.

The brain sends low voltage signals (5v) to the relay, which trigger it to contract (by using a coil) - This flips a mechanical switch (which isolates 120VAC to 5V) and turns on the 120VAC to the valve.

You must always isolate high voltage from low voltage by using relays, octocouplers, transistors, etc.

Connecting 120VAC to the brain equals death.

*Don't mean to be sarcastic with the answer but this is great way to understand the basics. Another way is to find a book about basic electronics, basic home automation, embedded circuits and similar. You can find allot of free books but spending a few bucks on a well rated book or two, is knowledge that will stay with you for the rest of your life. Priceless.

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
1

Controllable 4-outlet power relay, driven by a very low current 12VDC line. Perfect for the job if you're using a 120V valve. https://www.adafruit.com/product/2935

However, there are 12VDC water valves that will eliminate the need for the intermediate 120V relay and you can then use a smaller relay HAT, a GertBoard, or something like that to switch it on and off. Like this: https://www.adafruit.com/product/997

1

Here is something that may be more directly usable.. already has an optoisolator for protection:

goldilocks
  • 60,325
  • 17
  • 117
  • 234
Rx7man
  • 29
  • 1
  • 4