Go Down

Topic: Low voltage switch: distance from Arduino? (Read 247 times) previous topic - next topic

Johnbednarski

Hello folks, this is my first post to the forum.  I'm renovating an existing koi pond with waterfall setup.  I will use an Arduino as a timer, to control the submersible pump that provides the water flow.  Due to the layout of the property, the electronics is best sited at the top of the waterfall area.

This property was once owned by my father, who built the pond about 15 years ago.  I know of at least two instances during that time where the waterfall flow was interrupted and caused the water to divert elsewhere on the property.  The pump continued to operate, which drained the pond before discovered. 

To mitigate this problem, I would like to monitor the water level of the pond, and if it drops beyond a certain depth, to stop the pump.  I can think of two ways to do this.  My first idea is to monitor the depth via a low voltage reed float switch, electrically connected to one of the Arduino digital pins in the usual fashion.  The distance the low voltage wire connecting the float switch to the Arduino will need to be about 30-40 feet, as I have to go around property obstructions.

The second method I can think of is to interrupt the power to the pump via a mains voltage float switch.  This approach can be done independently of the Arduino setup, i.e even if the Arduino is calling for water flow, the mains float switch can stop the flow under this circumstance, by killing the pump power.

I'm not sure how much distance a low voltage signal can travel reliably, so I'm not sure whether my first idea is feasible.  I have to trench the mains power loop anyway, so the effort of burying the low voltage wire in a code-compliant way (separately from mains wires) is probably not significant.  I just don't know if the low voltage signal over that distance is reliable enough to make it worth the effort.  I suppose a wireless signal could be done, but I'm pretty new to the Arduino world and don't want to go too far into complexity until I have more experience.   I'd appreciate any input.  I've opened this question under the general electronics forum, but if you feel this is better suited to "new project" guidance, please feel free to move.  Thank you for your input and time.

Paul_KD7HB

For example, the wire from my anemometer to the Arduino nano display unit in the kitchen is about 50 feet. The wire is very tiny shielded wire. There is a reed switch in the anemometer and that closing causes an interrupt in the Arduino controller. Has worked flawlessly for two years or so.

There are some very nice float switches on Ebay. I bought two to use with my irrigation water storage tank. They can indicate when water reaches a set level, or the opposite, when water gets below the float level.

I don't see you having a problem with the distances you indicated.

Paul

Grumpy_Mike

#2
Mar 19, 2018, 09:05 pm Last Edit: Mar 19, 2018, 09:06 pm by Grumpy_Mike
Quote
I'm not sure how much distance a low voltage signal can travel reliably, so I'm not sure whether my first idea is feasible.
Only a few feet, you might have to look at line driver buffers, like discussed here:-
https://www.oshpark.com/shared_projects/kM1DRLS1

Paul, I have experienced trouble at well under 50'

DVDdoug

A low-voltage low-current signal can go a long-long way!      With higher currents you'll get a voltage drop across the resistance of the wire...  The longer the wire, the more resistance, and the more the voltage drop (Ohm's Law).

However, long wires and high impedance/resistance connections are prone to noise pickup.

Assuming a closed-switch pulls-down the voltage, start with the optional-internal pull-up resistor.    If you get noise/unstable readings, try adding a capacitor (maybe 0.1uf) between the digital input and ground.   If it's still noisy try an external 1k pull-up resistor.

Johnbednarski

Thank you for the detailed responses.  I'm encouraged.  If I have the same experience as Paul, i.e. flawless performance, then I'm good to go.  Similarly, if the signal turns out to be suboptimal, as can be the case from Grumpy_Mike's background, both he and DVDdoug have given me a few concepts to correct the possible erratic results.  This is great!  Thank you.

One follow up.  Do you feel the Arduino-supplied 5 VDC voltage should provide adequate voltage for my situation?  Or should I consider a different (higher) DC voltage?  I'm unfamiliar with the true gauge, but I imagine I would run "speaker wire" as the main conduit between the arduino and the switch, to lessen any impact that might occur with a tinier gauge wire - unless you wave me off from using that approach.

Appreciate your expertise and thoughtful replies

John

Paul_KD7HB

Thank you for the detailed responses.  I'm encouraged.  If I have the same experience as Paul, i.e. flawless performance, then I'm good to go.  Similarly, if the signal turns out to be suboptimal, as can be the case from Grumpy_Mike's background, both he and DVDdoug have given me a few concepts to correct the possible erratic results.  This is great!  Thank you.

One follow up.  Do you feel the Arduino-supplied 5 VDC voltage should provide adequate voltage for my situation?  Or should I consider a different (higher) DC voltage?  I'm unfamiliar with the true gauge, but I imagine I would run "speaker wire" as the main conduit between the arduino and the switch, to lessen any impact that might occur with a tinier gauge wire - unless you wave me off from using that approach.

Appreciate your expertise and thoughtful replies

John
Most important wire parameter for you is weatherproofing. How will the insulation respond to water, sunlight, UV, ozone, etc.

Paul

ted

#6
Mar 20, 2018, 12:57 am Last Edit: Mar 20, 2018, 01:10 am by ted
this type cables are designed to reduce interferences, easy 100', with differential amplifiers up to 5km

https://www.google.ca/search?q=twisted+pair+cable&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjp8v-Ay_nZAhUsjK0KHXhCBaAQ_AUICigB&biw=1440&bih=787

Johnbednarski

Excellent, thanks Paul and Ted.

Since I will need to lay conduit in order to bury the mains wires by code, I will probably lay a second, smaller conduit through which I will run the low voltage wire for the float switch.  I'm guessing that approach will mitigate the environmental stressors Paul mentions, at least for the portion of the cable that's buried. It sounds like no one has any concerns about using the Arduino board's 5 volts to run this 30-40 feet distance?  I intend to supply power to the Arduino Mega via a 1.5 amp 9 volt wall wart.  I will be running two high voltage relays, an LCD display, clock chip, and two sensors including this one, under current design prototype.  From what i've read of these devices' specs, I am within the power capability of the wall wart I have in mind.  So, I think I will just use the 5 volts through this cable, if we think it will perform adequately.

ted

By code; You can't run high voltage cable (220v ? ) and low voltage in one conduit.
use PVC pipe  bury it 1'  deep or more.

Johnbednarski

Agree, Ted.  Thank you.  I intend to use a one inch diameter pvc conduit to run the 120 volt AC 12 gauge conductors as I believe I have in place  a 20 amp circuit; and a second, separate PVC conduit, probably half inch, to run the 5 volt DC conductors for the float switch.

ted

#10
Mar 20, 2018, 01:58 am Last Edit: Mar 20, 2018, 02:04 am by ted
 Romex 14/2 I think can handle 20A, check it.
half inch = ok for both cables
In some areas local code allows to use 2X4 on the top of the cables instead  conduit.

Grumpy_Mike

 E aware if you have a motor, like your pump this will generate interference itself which will be picked up by a high impedance input. I would suggest you use an external 1K pull up resistor at the Arduino end.

Johnbednarski

Grumpy_Mike:  Thank you.  I hadn't considered the motor interference.  Good tip; I will use the external 1k pull up resister as you've suggested.

Ted, from what I understand of the NEC code, I'm required to use 12gauge conductors when extending a 20 amp circuit, so I will go with that.  Since I plan to use PVC conduit to extend the circuit, I think I will fish non-sheathed, individual insulated conductors, rather than Romex.  I believe there's no restriction against using Romex (sheathed cable) inside a conduit, but this is not required and I think pulling sheathed cable through conduit would be much harder than necessary.

Yes, I could possibly use type UF sheathed cable under a 2X4, rather than the conduit approach, however our local codes require that to be buried deeper.  Since I'm not too sure what lies beneath the topsoil, I'd rather not have to dig any deepr than necessary, bringing me back to the PVC approach.

Thanks everyone!  - John Bednarski

ted


Grumpy_Mike

Quote
from what I understand of the NEC code, I'm required to use 12gauge conductors when extending a 20 amp circuit, so I will go with that.
That only applies when you plan to either draw 20A from the cable or put a socket on the end that is capable of supplying 20A.

Their is no way what you are doing is going to be subject to NEC code, unless you connect the other end directly into the mains and not through a plug.

Go Up