Jump to content
  • 0

Project with LabVIEW [Linx and I2C] Two accelerometer [Adxl345] with Arduino Nano and TCA9548A


jmch

Question

Hello (sorry for my bad English) I am doing a project that consists of showing two graphs of the data of two adxl345 sensors, through LabVIEW and using an Arduino code. For this I use Linx and I2C in LabVIEW to be able to show the two graphs, however when I show the information I only see the data of one sensor in both graphs, the sensors are connected to the Arduino using the TCA9548A extender using the SC3 + SD3 pins for the Sensor B, which is the one that can be seen, and SC2 + SD2 for Sensor A, which cannot obtain its data. In my Arduino code, I don't have any problem when displaying my data, I use Wire.beginTransmission 0x70 to do it, sorry but these sensors and Arduino board are new to me I've only had experience with the Arduino Mega, I share my codes from Arduino and LabVIEW I hope someone can explain to me how to do it to able to place more of these sensors, thanks for taking the time to read.

Spoiler

 

 

SWADXLl3458NA.vi Multiplexor.ino

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @jmch,

Digilent hasn't worked with the TCA9548A or Arduino boards and LINX support in LabVIEW was moved to NI (https://forums.ni.com/t5/Hobbyist-Toolkit/bd-p/linx-toolkit) a number of years ago, but I will see if I can provide some helpful troubleshooting steps for you to try.
I am not familiar with the any of the libraries in your Arduino code (aside from Wire.h) nor do I have LabVIEW installed to be able to look at your VI, so I won't be able to offer much help on those details.

I do not know how the TCA9548A is configured, but if the hardware inputs A2, A1, and A0 are tied to a logic low level, then the slave address of 0x70 will be correct as per section 8.5.2 in the datasheet: https://www.ti.com/lit/ds/symlink/tca9548a.pdf. The rest of Arduino code (presuming the included libraries work as intended) does not look like it has any glaring issues.

It sounds like you can successfully get data from the two accelerometers when using the Arduino code directly, but not in the VI? What I would be doing then is using the built in LabVIEW debugger to see the flow of data. Confirm the data from the second (non-reading) sensor is successfully being received by LabVIEW in first place; if so, see if the two separate graphs are being separately fed data from their individual sensors. Because you said that only sensor B on SC3 and SD3 is showing, this makes me wonder if the data from the Arduino is being fed to both graphs, overwriting the data from Sensor A before the graph is updated.
To be clear, I do not know if this is the case as I do not have LabVIEW installed to check the VI directly.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

As per my knowledge, there may be an issue with the I2C communication between your Arduino and the two ADXL345 sensors. As per you, it appears that the data from Sensor B is being displayed correctly in both graphs, but the data from Sensor A is not being displayed at all.

One possible explanation for this is that the I2C address for Sensor A is not being properly communicated to the Arduino. When using the TCA9548A extender, each individual sensor will have its own unique I2C address, which needs to be specified in the Arduino code. It's possible that the address for Sensor A is not being set correctly, which is preventing the Arduino from retrieving its data.

Well, to troubleshoot this issue, I would recommend checking the I2C addresses of both sensors and making sure they are properly configured in your Arduino code. You can also try swapping the sensors to see if the issue persists with the same sensor or if it follows the I2C bus.

Another possible issue could be with the wiring of the sensors or the TCA9548A extender. Double-check your wiring connections to ensure they are correct and secure.

It's also possible that there may be an issue with your LabVIEW program. Make sure that the code is properly configured to receive data from both sensors, and that the data is being properly assigned to each respective graph.

So just try this, may be it can work.

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...