Hi all,
Firstly, sorry for the late reply. Secondly, thanks for all your responses!
mikronauts wrote:No, you need to use at least a transistor or a mosfet to switch a higher voltage to drive the relay.
Look at the relays data sheet to determine minimum acceptable (and maximum) coil voltage, and coil current needed.
24ga wire is also a potential issue, I'd use 18ga.
Likely to work: switch 12VDC via MOSFET or UNL2803, use that to control the distant relay.
Moe wrote:I agree; my gut reaction is this won't work. That's a long distance for such a small voltage and such thin wire, and volt drop isn't the only consideration here.
However, I would try it and see. If it doesn't work, add an intermediary stage. If you don't want to play with transistors, use another relay at the Pi end to switch a higher voltage, and an adjustable DC-DC converter like this to provide it. Just adjust the output to set the load-end voltage to whatever it needs to be.
My gut was it wont work either
I have a few TIP120G's hanging around from an LED project which I could use but that would require a second power supply for the 12V so I was trying to avoid that (aka cheat!).
The 24 gauge wire was what I have hanging around that is in one run. I have other gauges but that would involve soldering them together and I dont want the added resistance / failure points. Its also got to fit in some buried pipe thats 10mm wide and already has flex in at 7.5mm, hence the avoidance of running the 12V supply to the house and back again as i couldnt get two more lengths of flex in the pipe (this one is avoiding cost of laying more pipe or laziness if you want to go with that

).
Burngate wrote:Just as a matter of interest, your calculation in your first post might be wrong.
180 ft (90 ft there and back) of 24AWG wire will have resistance of 4.6 ohms, and with 16mA flowing there'll be a drop of 74mV (not 7mV)
But that doesn't take into account such things as contact resistance in any connectors at either end.
And the current may or may not be 16mA - that will depend on what's connected at the other end.
It's possible that the relay you're planning on using will want a separate (5v?) supply and only take a small current on its input. Or it could be that it requires a lot more than 16mA to switch.
The calculation was from an online calculator as I dont know how to calculate it myself yet (if anyone knows the formula then please let me know

). For clarity, I only need a single GPIO signal to the relay to switch it. The power for the relay itself is provided by the solar system using a buck converter (12 to 5). Lengths were never an issue when I set up my solar system as the voltages and currents involved made voltage drop negligible. The RPi low voltage and current and shear length makes it more of an issue to consider.
The 16mA is more than enough to switch the relay. Ive used it on the RPi already to switch a mains bulb on and off remotely. I cant be certain it was 16mA provided by the RPi but thats the only info I can gather about the GPIO power output. I just need to increase the objects separation from 90cm to 90ft and it will work fine and dandy.
Someone mentioned using wireless. If I was to go down this route I would put the RPi in the box with the solar charger and batteries as its waterproof. I already have a 5V supply in there to power the RPi and relay but from my test with my Galaxy S7, the box blocks the wifi reception. Im almost sure the wifi chip in the S7 is more powerful than my Edimax EW-7811Un so that rules out wifi and bluetooth options.
I will wire it up above ground and let you all know if it switches. Thanks again for your responses. Its always food for thought
