555 timer based anti cable theft system

Dear team kindly assist me on how i can get my circuit & / code to work to achieve the objective of displaying distance at which the cable is in open circuit after being cut by thieves. for my laboratory prototype i will use a twisted pair stripped from an ethernet cable to detect theft in ranges of 0,5m to 12m

i am using a capacitor to rep open circuited twisted pair cable in the simulation (using the fect that length and capacitance are directly proportional and the esd effect). On proteus the simulation is running fine , with some longer delay in outputing the freq and distance for 100pf or below.

transfering the simulation to the breadboard circuit i have attached is giving me this “inf” error for my frequency value. i am here for your assistance

DISTANCE_CALCULATOR_with_Formula.ino (1.08 KB)

FREQ_DISTANCE CONVERTER.zip (65 KB)

It’s your code! What conditions can give you an “inf” message?

Paul

from the research i jus did the "inf" error means duration of pulse (HIGH & LOW ) is close to zero

Then increase the pulse width, until it can be measured with sufficient resolution by the Arduino.

Why don't you use the CapSense circuit and code to determine the cable capacity?

Your image shows a frequency of 125 kHz, that's 8 µs wavelength or 4 µs per pulse (either high or low). This is going to require a bit more sophistication than the pulseIn() function which has a 1 µs resolution.

You'll going to need interrupts and/or the input capture function of the timers. That way you can go down to 62.5 ns resolution for your pulse. This way you can also quite easily build a frequency counter that gives high resolution measurements of frequencies up to a few MHz (a modern 555 maxes out at about 3 MHz, which is getting close to the limit the Arduino can handle - if that's really an NE555 you're already over its limits with 125 kHz).

DrDiettrich: Then increase the pulse width, until it can be measured with sufficient resolution by the Arduino.

Why don't you use the CapSense circuit and code to determine the cable capacity?

hey there , i have seen some preamplifier circuits that are quite huge and incoporating stuff that is not readily available in my lab that can ensure my pulse width is big enough to be captured.

kindly advise on how i can use the capsense circuit and if you have the code please do forward

wvmarle: Your image shows a frequency of 125 kHz, that's 8 µs wavelength or 4 µs per pulse (either high or low). This is going to require a bit more sophistication than the pulseIn() function which has a 1 µs resolution.

You'll going to need interrupts and/or the input capture function of the timers. That way you can go down to 62.5 ns resolution for your pulse. This way you can also quite easily build a frequency counter that gives high resolution measurements of frequencies up to a few MHz (a modern 555 maxes out at about 3 MHz, which is getting close to the limit the Arduino can handle - if that's really an NE555 you're already over its limits with 125 kHz).

thanks for the insight , how do i incoporate the input capture function in my code as well as the interrupts . if i can twerk myu code around the better other than dealing with hardware variations.

Capsense is the capacitive sensing library.

One example of timing the discharge of a capacitor that I've written is for my EC sensor: https://github.com/wvmarle/Arduino_ECSensor It's using timer1, not the input capture method.

wvmarle: Capsense is the capacitive sensing library.

One example of timing the discharge of a capacitor that I've written is for my EC sensor: https://github.com/wvmarle/Arduino_ECSensor It's using timer1, not the input capture method.

hello there , thanks for the code , i have gone through the code and i cant get how this will eventually help me to measure the lenth of my twisted pair copper cable in open circuit. if you could assist on this on

It measures the discharge time of a capacitor using an RC circuit.

For your application you can simplify it as you don't have to worry about the second phase (steps 4-6 of the cycle), like when measuring the EC. One phase is enough. The other difference is that in my code the R is the unknown, in your case the C will be the unknown. That doesn't change the method.

Your cable has a capacitance, how much depends on the length. Cut it, and the capacitance goes down. The capacitance will be low, much lower than the 22 nF I'm normally using, so you need a large resistance, I guess somewhere in between 100k-10M, to get useful discharge times.