In this post below, there is a note on how to connect a Neato LIDAR distance sensor to a VEX cortex using a 4 wire UART cable. How would you connect this distance sensor to VEX V5 brain since it only has 3-Wire ports?
Continuing the discussion from Alternative Distance Sensor:
So the way I would do it is with a cheap raspberry Pi or arduino (NOTE needs to have USB host shield).
The V5 3 wire ports are not useful in this scenario.
The V5 smart parts are not very easy to interface with. This could be done with a bit of soldering, and buying a little IC to wire between the smart port and the LIDAR. If that is the direction you want to go we can help you with that too. (Materials: chip, wire to destroy, soldering iron)
However there is a USB port on the V5 brain that can be used for anything you want. 10 lines of arduino/raspi code that reads in data over UART and sends it over USB should do the trick. (Materials: arduino/raspi, usb cable, arduino host shield if arduino)
@tabor473
Thanks for the options. I appreciate it.
I looked at the arduino and the Raspberry Pi. I’d like to first try the V5 Smart port. I’ve already purchased the Smart Cable Crimping Tool, Smart Cable Stock, and Smart Cable Connectors . I also have a soldering iron. I’m not sure about the “IC”.
Talking to the V5 over a smart port really isn’t that difficult at all. They use UART over RS-485, so all that’s needed is a RS-485 transceiver. Each port is half duplex (meaning it can only send data in one direction at once, this is perfectly normal for RS-485), so if you want a normal full duplex UART connection, you need to use two ports and thus two transceivers. The way around this would be to have your own microcontroller (like an Arduino) to sit in-between the V5 and LIDAR sensor, but this will require a bit more work on your part (though it’s also not terribly difficult). Do note that the power coming from a smart port is straight from the battery (somewhere around 12V), so you will need to regulate it before doing anything with it.
This is a rough schematic of what you’ll need to do using two SN65HVD1782 transceivers, the RS-485 transceiver that I’ve used before (and that the V5 uses internally). It’s available from both Digikey and straight from TI in both SOIC and PDIP packaging (you’ll probably want PDIP unless you’re surface mount soldering it to a PCB, in which case also check the datasheet for an example as to how to do proper static protection which my schematic doesn’t include). I also included an L7805 voltage regulator, which is just a common 5V linear regulator, but any decent 5V or 3.3V regulator should work fine.
The pinout of the smart port is labeled in the schematic counting from left to right looking at the bottom of the plug (as is standard for modular connectors), the following image might make it a bit more clear.
As for the software side, I don’t recall how to do it in VEXcode and I’m not sure if it’s implemented in RMS, but for PROS you can take a look at serial.h and serial.hpp for all the relevant functions and their documentation. I believe you have to include apix.h in your program to use them. You’ll have to enable serial mode on the smart ports and then set their baud rate, and then you can send and receive whatever data you want. You’ll be sending data through one of the ports (the bottom one in my schematic) and receiving data from the other.