Max Length of a wire run for a Photon

Hi guys,

First time posting. I was wondering if anyone knew how long a wire can I have running to a button for at Photon. I need approximately 5m for the button and another 7m run for another sensor. Is there a way of working out how long a cable i can run without damaging my Photon?

The risk of damaging your device with too long wires is minimal (unless you pick up exceptionally high induced voltages).

The main issue will be the signal quality that’ll suffer.

@ozdeadmeat, the bigger question is are you powering the sensor and button via the wires? What is the sensor and what type of communications does it use (or is it analog)? Long wires create several conditions which must be considered:

  1. Resistance causing voltage drop and reduction of signal rise time
  2. Inductance which can create voltage spikes and also affect signal integrity
  3. Antenna effect which can create undesired voltages on the signal lines
  4. Capacitance depending on the type of wires, again affecting signal integrity

The environment you are exposing your system to may affect all of the above. Bottom line is you will need to take all these factors into consideration when designing your hardware. This might include something as simple as adding a capacitor to the signal line to something as complex as adding clamping diodes, current limiting resistors and more. If you can explain more about your application, we can give better advice. :wink:

1 Like

I agree with both previous answers and there’s a lot to take into account. However, at the distances you describe, you will probably be fine. But don’t blame me if you destroy something.

I have switches connected by at least 40m of cable. It’s cat. 5 twisted pair, and the switch connects to circuit ground with an external 10K pull-up resistor. It’s not connected to a Photon, but it’s another micro controller with similar input circuitry. They’re door open sensors so the pulse lengths are long and a clean signal isn’t an issue there.

@peekay123 Thank you for your response. I am essentially creating a smart sensor that also has an activation button. The long length of wire is to a pair of separate buttons and possibly one of the sensors (depending on the advice received here). The Photon will be co-located with the main motion sensor, the expectation is to power everything from the Photon.

@ozdeadmeat, as @rickkas7 indicated, using twisted pair (shielded) cabling with very relaxed timing requirements for buttons is fine. I suspect he also uses 5v and not 3.3v to drive the pull-up to avoid to much voltage drop. In your case, using one twisted pair for 5v/GND and one other for the two buttons, that leaves you two pairs for your sensor.

However, for the sensor, timing may be important. Again, if you can indicate what the sensor is, we can give you better advice. :wink:

@peekay123 The sensor is this one.

@ozdeadmeat, since this is a digital (binary output) sensor, you should be fine. Using a Cat 5 cable is a great idea for both data and power. You could add an electrolytic cap (47uF for example) and a ceramic decoupling cap (0.1uF) across the power wires at the PIR to filter out any noise (unless the sensor has those already). You could also add a small 0.1uF cap at the Photon digital input pin to again filter out noise. Use the 5V (Vin) line to power the buttons (pull-ups) and the sensor. Have fun! :wink:

1 Like