switching a digital pin from 50 feet away

I'm working on a project where I need to put an LED-illuminated switch about 50 feet from the Arduino. Can this be done reliably?

There have been several posts along these lines but I think the difference has been that the other posters were intending on shuttling data across the wire. I simply need to light up an LED and get a stable read from the button press.

I was intending to use use two digital ports (one for the LED and one to read the button using a pull down resistor) and 4-conductor phone wire.

Can a digital pin/button press be read reliably over 50 feet of phone wire (if appropriately debounced) or do I need to worry about interference? Would cat-5 be a better choice for wiring?

An earlier post suggested possibly using an analog port, pull up resistor and cap to smooth out any noise. Is this necessary?

Any hints/tips would greatly be appreciated.

Background:

This is for a Pinewood Derby solenoid activated start gate project. Basically, we currently have a "pickle" switch (a prescription drug bottle with an small incandescent light bulb and a momentary push button switch) that when pushed, activates a solenoid to flip the latch on the start gate (i.e, a physical spring-loaded latch/gate not electronic one). The pickle and solenoid circuit are currently connected via 50' of 18-2 speaker wire.

During each heat, a person would place the cars behind the start gate and, when ready, press and hold a button to indicate that the cars were ready. This would, in turn, cause the light in the pickle switch to light notifying the racer that the cars were ready and that the pickle switch was "armed".

The "process" issue that we have is that the person placing cars on the track would do so and enable the pickle switch before the timing computer was ready.

To solve this, I'm intending to use an Arduino with Cutedigi rs232 shield to interface with the timing computer. When the timing computer is ready it can raise DTR (rs232 pin 4) or RTS (pin 7) for a configurable period of time. I'm using the rs232 shield to detect this condition. (note: I may need to tie pin 4 and 2 together to fake the rs232 shield into thinking that data is available).

There will be a momentary push button at the starting line that can be pushed when the cars are ready to race. When both the timer and starting-line are ready I was going to illuminate the LED and wait for the racer to push the button to activate the solenoid.

Should be a fun project.

Normally one doesn't recommend long, as in 50ft, runs for digital TTL level signals, but for case as switches and leds I think it would work fine. I would use a little lower pulldown resistor for the digital input pin, say 1k ohms, and perhaps a .1mfd cap from the input pin to ground to help filter noise. The digital output pin should work fine driving a led even at that length, just be sure to include a series current limiting resistor to keep current at the 20ma level or so.

Good luck, and may the best 'driver' win.

Lefty

Half of me says, yeah, the simple answer will work, don't worry.

The other half says that this is likely to all be happening at a big event, with kids, and if the equipment goes funny on you, there's going to be upset kids, which is a great pity, and upset moms which can be dangerous.

Will you be having lots of "pre-tourney" race nights, where the thing can be thoroughly de-bugged?

Plan for disaster. Yes... built the fancy version... but build in a way to change over to a system where the "gate loader" holds up a flag when the cars are ready, and someone near the other end, near where the circuits are, when he sees the flag up, can press a button which is electrically equivalent to the one you HOPE will work, 50' away.

Now... as to circuits...

I assume you're not trying to run all of this off of batteries? And besides the 5v in the Arduino, you have something higher available, like 12v? Something must be there for that solenoid?

Use 12v (or whatever the solenoid runs on... DC, I hope? (AC can be fixed, but more to sort out) to travel the 50'. If it is just "cars ready" and "operate solenoid", you only need 3 conductors in the cable... but make them thick(-ish)... not some feeble "speaker wire".

Switch at start, resistor, LED half of an "opto-isolator" (more on that in a moment). Switch closed= LED on. The other side of the opto-isolator will be very near the Arduino, and operating at the Arduino's Vcc (5v or 3.3v, depending on Arduino), and be part of a simple circuit to pull one of the Arduino inputs high or low.

Opto-isolator details....

Left side of diagram there: The 50' wire. The green blob on the right: Arduino.

PLEASE put a description of the finished racetrack on the Arduino Playground Exhibition page when done?? With photo? And you ARE going to time all of the tracks, aren't you, not just give the time of the fastest car?

Playground....

http://www.arduino.cc/playground/Projects/ArduinoUsers

===
Shameless self promo: This COULD be done wirelessly with the little modules the DCDW will be using... but it would be silly to do it that, or any other, wireless way when you're already running one wire from the Arduino at the finish line to the solenoid at the start. Especially as the track can be used to protect the wire from people and vice versa... but if you WANT to consider wireless, and so I can get the URL in...

http://DCDWireless.com :slight_smile:

(Sending data wirelessly for very little $)

You could probably get away with phone wire and a strong pullup (1K, or even 510) for the switch, but not certainly. A 50' cable is a big antenna. Not knowing what sorts of noise sources are in the vicinity, I'd play it safe: the 75179 RS-422 transceiver is cheap (a buck or so), and specifically designed for reliable transmission through long wires in noisy environments. And Cat5 is so popular these days you might even find it cheaper than phone wire in long lengths.

I'd wire it up following the Power-over-Ethernet standard to make it easier to remember which wire is which. And, since I happen to have a couple lying around, I'd seriously consider using a surface-mount Ethernet jack for the pickle switch and a "breakout" for connecting to the Arduino. Then I could use an off-the-shelf Ethernet cable for connecting the two ends. Maybe even one borrowed for the day. It looks more professional, makes the system more adaptable to different venues, and reduces the risk of wires getting damaged during transit/setup.

Be sure to put good power supply bypass caps (both a .1 and a several uF) in the pickle switch enclosure, and tie off the unused inputs of its 75179.

If you are running a 50ft wire to a computer pin it is going to pick up some interference signals. You better put some protection on both the inputs and outputs.
http://www.thebox.myzen.co.uk/Tutorial/Protection.html

I do not share the pessimism of other responders to this discussion.

You meant of course some of the other responders? I said it should work OK. :wink:

Lefty

back 100 years ago they sent digital signals for miles and miles over very primitive wiring

True but then they didn't send the signal into high impedance voltage sensitive circuits. And they picked so much atmospheric electricity that they sometimes stopped working. Even though there is not much to damage in a coil.

What I want to know is when 'God members' disagree or argue do lightning bolts start flying around?

Lefty

Defiantly. :wink:

Of course, in some cases, it creates an amusing change in meaning.

Indeed it does and at my age I am used to it.

I am what they call now dyslexic but when I was at school it was called being thick. I think it is something to do with the salary you are on. :wink:

back 100 years ago they sent digital signals for miles and miles over very primitive wiring

Yeah, but they had slaves or coolies to cheaply erect the poles needed to keep the 48V wiring out of the reach of inquisitive Cub Scouts.