*** This question may be related to this topic ***
I believe I am having trouble with the distance of my cable.
I am simply wanting to take a measurement from my lidar lite through a 15m cable. The 15m cable is necessary.
I originally used i2c, but then I realised that 15m was too long and would require a lot of extra work to get i2c to work at that distance. Since the lidar also has PWM, I moved to using that.
I read that PWM MAY work at that distance, but the best thing was to try it. I did, and it doesnt work.
Through a 1m network cable, everything works fine. Plugging in a 15m network cable, the lidar returns a ‘1’. I could not find what it means when the lidar returns a ‘1’.
I checked the voltage, and there seems to be almost no voltage drop, the reading is 4.8 volts, .3 volts above the minimum for the lidar to work.
There are plenty of technologies available that cover such a range for cabled data connection. See below for more details (last answer).
If you read my answer here, you’ll notice that you can use I2C with ranges of well over 100 m!
Typically such a setup requires the use of a driver chip on both end of the long data cables, such as the dual bidirectional bus buffers linked to in the post above. Here’s a link to it: P82B96.
Do you have a reference of where you read this? I’d be curious to read the details.
Do you mean a binary “1”, a pulse length of 1 [insert time unit here] or a distance of 1 cm? If you meant a binary “1”, then that would indicate the signal always stays “high”. If you meant a pulse length of 1, it could mean the pulse is not being detected properly. If you meant 1 cm, then clearly there seems to be a problem reading the signal, since the LIDAR-Lite does not work at such short distances (< 30 cm) and would report varying responses, not just “1 cm”.
Is that the voltage of the VCC line or the data line (the one with the pulse)? Please note that with a 15 m cable composed of multiple wires, where you place your electrical components (resistances, capacitor, etc.) will have an impact. It should also be noted that it is very much possible the driver in the chip is unable to produce a signal that is detectable over such a long cable (without amplification).
As mentioned at the top, the best option would be to consider a communication method between your LIDAR-Lite and your microcontroller that supports the distance you need (15 m in your case). The simplest solution still seems to be to just amplify the I2C signal on both ends (sensor & microcontroller), as this will require only minimal extra components and no need to program anything else: you can use the I2C library and examples as-is without any changes. Here is an example of a product with ranges of up to 100 ft (~ 30 m): RB-Spa-1623. In the manufacturer’s example video, this board (a pair) is used with ~20 m of cable successfully.
Another option is to move to a different physical communication that supports longer distances, such as RS-232 ±12 V DC UART. These typically are used with cables up-to 15 m (regular cables) and longer for cables with lower capacitance. Since a Ethernet cat 5 cable as about 52 pF/m (@ ~800 Hz), you should be able to get away with dozens of meters using RS-232 communication since the typical maximum capacitance for such a system is ~2500 pF (2500/52 =~48 m).
You can find plenty of RS-232 converters here, such as the RB-Dfr-165 and RB-Cyt-190. Of course, using one of those means you’ll need to add a small microcontroller near the LIDAR-Lite to read its values (using I2C or PWM, I2C strongly recommended) and then transfer the data through the converter to your main microcontroller. That being said, it should be somewhat simple to implement, since most microcontrollers have both I2C and UART hardware peripherals available in their design.