Parallax Laser Range Finder on Arduino I2c slave
jonathan_g
Posts: 2
I would like to use two Parallax laser range finders on a robot that also has an I2c LCD screen. The LRF communicates using Asynchronous serial and it takes a second to get a reading after pinging the sensor. because of the relatively slow refresh rate, I'd like to put the LRFs on separate Arduinos and report their results via I2c. (We are using the same approach for other sensors on the robot and wes have three slave Arduinos communicating successfully with a master Arduino via I2c.) To test the idea out with the LRFs, we put it together as a standalone system (ie no other I2c devices attached to the bus.) and it works well. The LRF slave Arduino sends the info to the master as expected. The problem is, that as soon as we connect other I2c devices to the I2c bus (e.g., an I2C LCD or a second LRF), the bus fails.
We were wondering if we might be doing something wrong. Does anyone know if it's possible to use the LRF on an Arduino I2c slave with other I2c devices connected to the bus? Thanks.
We were wondering if we might be doing something wrong. Does anyone know if it's possible to use the LRF on an Arduino I2c slave with other I2c devices connected to the bus? Thanks.
Comments
This generally isn't a problem if the I2C bus isn't actively driven high (which it should not be). The Propeller can tolerate a 5V I2C bus as long as the pull-up resistors are 3K ohm are more.
When using multiple I2C devices, you want to make sure not all the devices are not all pulling the line high. Multiple pull-up resistors will be in parallel and end up pulling the line so hard it can't be easily driven low. The parallel pull-up resistors may lower the combined resistance to less than the safe 3K ohm needed to protect the Propeller chip.
I also just realized, the Propeller is probably not connected to the I2C bus. Only the Arduinos are connected to the bus; the Propellers are connected to Arduinos via a asynchronous serial line. Right?
What's your power supply like? The extra devices may be causing power issues. Adding some extra capacitors near the various Vdd pins may help.
It works as long as only the nano is connected to the mega. As soon as I connect one other I2C device, the system fails. Also, note that, without the laser range finder Nano connected, the system works (ie all four devices on the I2C bus work). The Arduinos are powered via a 2 cell LiPo. Each sensor is powered via the 5v pin of the Arduino to which it is connected.
One threshold question that I have, which may have no bearing on the answer to the problem, is: assuming the LRF nano receives an I2C request to send data to the master when it is in the middle of getting data from the LRF (ie it is waiting one second for the data to arrive from the LRF via serial), what happens? Does the I2C line hang pending the nano's receipt of data from the LRF? Or, does, the I2C request interrupt the serial data retrieval?
Thanks again for the help.