I2C with ADS1115 | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
I2C with ADS1115
May 4, 2020
7:52 am
Avatar
rpscd
Member
Members
Forum Posts: 7
Member Since:
April 8, 2020
sp_UserOfflineSmall Offline

This is my first time using I2C. I am trying to read from an ADS1115 using this board

The datasheet for for the ADS1115 can be found here: http://www.ti.com/lit/ds/symli.....8379250984

The DS1307 Realtime Clock example helped quite a bit but I have still not successfully read voltages from my ADS1115.

Page 35 of the ADS1115 datasheet shows a quickstart guide. I followed the steps but don't get what I expect. What I see when opening the Serial Monitor is

Bytes Available: 2
Data: 33540

 

Any idea what I'm doing wrong?

May 4, 2020
5:33 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

It looks like in your config register setting you are selecting a differential conversion across channel AIN0 and AIN1.  The conversion result is signed so you could definitely get a negative value depending on your hardware setup, 33540 is signed -31996.  Do you intent to do a single ended conversion?  You didn't post any schematic but, if so, you need to change the channel in bits 14:12 to 0x04-0x07 for single ended.

channel.pngImage Enlarger

sp_PlupAttachments Attachments
May 5, 2020
12:46 am
Avatar
rpscd
Member
Members
Forum Posts: 7
Member Since:
April 8, 2020
sp_UserOfflineSmall Offline

Capture-1.PNGImage EnlargerI changed bits 14:12 from "000" to "111" to read between AI3 and GND and I am now getting readings! I originally wasn't using resistors or capacitors but now my schematic very closely resembles their example (picture attached) except my VDD is 5V and AI3 is connected to the 3.3V on the arduino. Is I2C very sensitive and need these resistors and caps to function?rnI am confused about why I seem to need a Write Byte inside the while loop. When I put it before the loop, my serial output alternates between "Bytes Available: 2" and "Bytes Available: 0". rnNew code attached showing the behavior I am describing.

sp_PlupAttachments Attachments
May 5, 2020
6:54 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

For I2C you always need pull up resistors.  I suggest taking a look at the I2C specification. See here.  Decoupling caps are always recommended.  From the ADS1115 datasheet the conversion register is register 0, so I would expect you would have to write the conversion register address before each read of the register, but I have never worked with this A/D before.

July 28, 2020
6:49 am
Avatar
Balaji
New Member
Members
Forum Posts: 1
Member Since:
July 28, 2020
sp_UserOfflineSmall Offline

rpscd said
This is my first time using I2C. I am trying to read from an ADS1115 using this board

The datasheet for for the ADS1115 can be found here: http://www.ti.com/lit/ds/symli.....8379250984

The DS1307 Realtime Clock example helped quite a bit but I have still not successfully read voltages from my ADS1115.

Page 35 of the ADS1115 datasheet shows a quickstart guide. I followed the steps but don't get what I expect. What I see when opening the Serial Monitor is

Bytes Available: 2

Data: 33540

 

Any idea what I'm doing wrong?

  

hi..

how to read ADS1115 analog value in arduino compatible compiler in LV

I just tried every example but i can't read the analog value..

August 26, 2020
7:14 pm
Avatar
rpscd
Member
Members
Forum Posts: 7
Member Since:
April 8, 2020
sp_UserOfflineSmall Offline

Attached is a basic VI that allows you to read voltages on the ADS1115. It measures voltage on each analog input with reference to ground (can't read negative). Make sure you follow the hookup diagram in the datasheet  (or see Figure 43 attached). Note that you can only read up to the voltage supplied to Vdd. It shows as 3.3V on the diagram but can be up to 5.5V max. Also the 0.1uF capacitor is not mandatory.

Once you upload the code to the arduino, open the serial stream and it will show you the four analog input voltages about twice per secondFigure-43.PNGImage Enlarger.

sp_PlupAttachments Attachments
Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
26
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356