Skip to main content
3 of 4
added 893 characters in body
vicatcu
  • 22.9k
  • 14
  • 82
  • 157

I've contemplated this myself a number of times... but honestly I've never gone through with it because it's so cheap (albeit environmentally irresponsible) to just go out and buy a new strand.

At any rate, one way I could envision doing it, were I to design a DIY method, would be to transmit a very narrow pulse signal down the "neutral" input, and measure the time it takes to get a reflection of the pulse at the source.

I would generate the pulse with a general purpose I/O pin of a microcontroller which I would subsequently configure as a tri-stated input. I would "listen" for the pulse with an A/D input pin on the microcontroller. This could probably even be the same pin of the microcontroller. You might also want to put a current limiting resistor between the microcontroller pin and the strand of lights.

Knowing how long the pulse took to be reflected, it should be a relatively simple calculation to figure out how far down the strand the broken circuit is. I think it would actually just be (to a close approximation):

length = speed_of_light * measured_duration / 2

Now, this will probably only work if half your lights are functioning and the other half aren't. If all your lights are out, I would expect you'd get two (possibly) overlapping reflections, which would make the measurement kind of ambiguous. Interpreting the measurement would also require some knowledge of the circuit topology of your particular strand as well I would imagine, but it would at least give you something to go on.


Edit / Additions

The main problem here is being able to sample quickly enough. At the speed of light, 6 inches takes about half a nano-second by my calculations, so you need a timer running at almost 4GHz to sample quickly enough to narrow it down to 6 inches of length. This pretty much kills the idea of an A/D converter being your trigger, and you'd need some kind of high bandwidth Analog comparator set up with a low trip point to "amplify" the pulse and cause a pin change interrupt that you could use to capture a free running timer.

Lets say you're using an Arduino running at 16MHz. Your timer resolution is then is theoretically 62.5ns. That means you have a length resolution of 18.7 meters, ouch. OK, so we need a faster clock. If you had an FPGA running at 1 GHz, you could get it down to about 0.3 meters or just under a foot. But now we're starting to kind of push the limits of DIY-ability.

vicatcu
  • 22.9k
  • 14
  • 82
  • 157