Hello all,
is it possible to use two or more ADS1115 with ESPEasy?
At the descripption i don't see an "Address" field. The ADS1115 is able to use p to four different i2c addresses.
If not, would it be possible to add an address choice in a future release?
Background:
I'm using "Power Manager" Boxes, 8 switches in the front, 8 outlets at the rear side in a quite big steel case.
I want to switch them remotely using a PCF 8574 as a relay driver and check the current on the single outlets.
Greetings
Thomas
ADS1115 - multiple devices possible?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
ADS1115 - multiple devices possible?
Regards
Shardan
Shardan
-
- Normal user
- Posts: 71
- Joined: 05 Sep 2015, 18:09
Re: ADS1115 - multiple devices possible?
The port setting should be the offset to the default address (0x48)
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: ADS1115 - multiple devices possible?
I see..
Thanks, i'll do a breadboard test as soon as the ADS arrive
Thanks, i'll do a breadboard test as soon as the ADS arrive
Regards
Shardan
Shardan
-
- Normal user
- Posts: 39
- Joined: 14 Oct 2016, 11:32
- Location: Chemnitz, Germany
Re: ADS1115 - multiple devices possible?
How can one reflect this in ESPEasy? The datasheet gives these informations:Ger wrote:The port setting should be the offset to the default address (0x48)
Code: Select all
Table 5. ADDR Pin Connection and
Corresponding Slave Address
ADDR PIN SLAVE ADDRESS
Ground 1001000
VDD 1001001
SDA 1001010
SCL 1001011
In the source it seems, that 0x48 is hardcoded, but I might be wrong, as I'm not a programmer:
Code: Select all
uint8_t address = 0x48 + unit;

Wouldn't it be better to get a dropdown for device selection like for a DS18b20?
-
- Normal user
- Posts: 507
- Joined: 21 Nov 2015, 15:03
- Location: SW-Netherlands, NB
Re: ADS1115 - multiple devices possible?
The DS18b20 is a 1 wire protocol device which doesn't need any hardwired address selection because each DS18b20 has an unique 64 bit ID burned into chip.groovy wrote:How can one reflect this in ESPEasy? The datasheet gives these informations:Ger wrote:The port setting should be the offset to the default address (0x48)
which leads to the addresses 0x48, 0x49, 0x4a and 0x4b.Code: Select all
Table 5. ADDR Pin Connection and Corresponding Slave Address ADDR PIN SLAVE ADDRESS Ground 1001000 VDD 1001001 SDA 1001010 SCL 1001011
In the source it seems, that 0x48 is hardcoded, but I might be wrong, as I'm not a programmer:
What Is "unit" here? It seems to be added to the address? I'm a bit confusedCode: Select all
uint8_t address = 0x48 + unit;
![]()
Wouldn't it be better to get a dropdown for device selection like for a DS18b20?
So ID selection must solely be done in the software.
ADS1115 is a 2-wire I2C protocol device which can only have a selectable address of 4 possibilities. Each possibility has to be hardwire coded onto the chip/module itself by connecting the ADDR selection pin to VDD,GND,SCL or SDA.
In table 5 you see the 7bit address selection ranging from 1001000/48 up to 1001011/4B
For every I2C device ESPEasy uses the same uniform way for software address selection, which is done by a port number, usually a number smaller than 8.
So it seems, like you suggested, unlogical to use a ADS1115 device selection like for DS18b20
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: ADS1115 - multiple devices possible?
Hello Groovy,
i've tested some ADS1115 meanwhile.
I used two ADS1115-boards, wired to 0x48 und 0x49.
Just in the task setup i can select all 8 analog input via the "Port" field.
Did not read the sourcecode yet, but i guess the "0x48 + unit" just calculates the "unit" by dividing the port number by 4 and taking the integer result as "unit".
So as 0x48 is the lowest address, unit calculates to 1 if you select port 7 for an example.
7 / 4 = 1,75, interger is 1, so port 7 resides on 0x48 +1.
i've tested some ADS1115 meanwhile.
I used two ADS1115-boards, wired to 0x48 und 0x49.
Just in the task setup i can select all 8 analog input via the "Port" field.
Did not read the sourcecode yet, but i guess the "0x48 + unit" just calculates the "unit" by dividing the port number by 4 and taking the integer result as "unit".
So as 0x48 is the lowest address, unit calculates to 1 if you select port 7 for an example.
7 / 4 = 1,75, interger is 1, so port 7 resides on 0x48 +1.
Regards
Shardan
Shardan
-
- Normal user
- Posts: 39
- Joined: 14 Oct 2016, 11:32
- Location: Chemnitz, Germany
Re: ADS1115 - multiple devices possible?
Thank you booth for clarification. So then I will order some 

Who is online
Users browsing this forum: Ahrefs [Bot], Anthropic Claude Bot [bot], Bing [Bot] and 17 guests