03-23-2021 11:20 AM
Hi,
I'm completely new to using I2c in LabVIEW and I'm currently trying to connect up a ADT7420 temperature sensor (this is on a mikroe 3636 dev board) to an Arduino Uno. I'm trying to create a user interface for my project but I'm really struggling to find help on how-to hook up this specific temperature sensor. Ive attached my block diagram so far, its incredibly basic but i hope I'm sort of on the right tracks
Any help would be greatly appreciated
Solved! Go to Solution.
03-23-2021 04:48 PM
Hi Yepmop,
The toolkit that you are using simply sends the arduino serial comands and reads them back. For it to work you need to deploy the firmware that comes along with the toolkit. You should find the firmware at this path on your PC:
C:\Program Files (x86)\National Instruments\LabVIEW 2020\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base\LIFA_Base.ino
You can then open it up with the Arduino IDE and deploy it to your device. By default it uses a baud rate of 115200. It is defined in the LabVIEWInterface.h file in the same directory, in case you need to change it. Looking at regular Arduino examples online, everyone is using some open source libraries to communicate with the ADT7420. For example this thread:
https://forum.arduino.cc/index.php?topic=157330.0
So you will likely have to write a bit of code to get it working how you want it. You should also be using the following connections (toolkit default):
Uno Pin A4 - ADT74020 SDA
Uno Pin A5 - ADT74020 SCL
Uno Pin 3.3V - ADT74020 Vdd
Uno Pin GND - ADT74020 GND
Based on the data sheet of the ADT7420, you will likely want something like below to get you started. You will likely want to pull A1 and A0 to GND as well, to result in an address of 0x48. Page 19 of the data sheet shows exactly what you need to send to the ADT7420 to read back the temperature as a 16bit number:
1. Write 1 byte. Address: 0x48. Data: 0x00 (specifies to read MSB of Temperature value)
2. Read 2 bytes: Address: 0x48. (You will receive the MSB first and then the LSB)
Data sheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adt7420.pdf
03-23-2021 05:11 PM
Thank you for your help, that makes a lot more sense. ill crack on with that tomorrow!