This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
openplotter-i2c 3.x.x released
#31
(2022-10-18, 11:22 PM)RichFind Wrote: Also
Working on installing a multiplexor.
Will let you know how things go.
Will be able to test with BPE688, INA218 and ADS115 (when available).

TIA

I expect a nice step by step guide if you were successful  Smile
Reply
#32
Sorry for the delay. New openplotter-i2c 3.2.0 released. It contains support for ADS1115 and ADS1015 sensors. We have also tested multiplexing multiple sensors using a TCA9548A module and it works like a charm.

Most sensors are already tested so we will go to stable soon. Translations are already available in Crowdin.
Reply
#33
There must be something I don't understand.
I can not figure out how to use the multiplexer.
I am using an adafruit PCA9548
https://www.adafruit.com/product/5626
adafruit states
"In case you're wondering why this uses the PCA9548A not the TCA9548A, the PCA9548 is the 'fraternal twin sister' of the TCA9548 but is easier to get during the great chip shortage of 2022. It works exactly the same, just can't go down to 1.8V power which is OK because QT boards are 3V or 5V only anyways. You can still use any example code or library for the TCA9548"

For testing I am using a BME688.

With the BME688 at address 0x77 connected directly to the PI everything works.
Inserting the multiplexer in between the Pi and the BME688 and scanning the bus I get 0x70., the address for the multiplexer as expected.
I add the BME688 at address 0x70 because that is the only thing I can choose. I pick channel 0 because that is where the BME688 is plugged in.
Everything works.
But the address of the BME688 is now shown as 0x70
Now I want to add a INA219 to channel 0 at address 0x40.
I can't figure out how to do that since a scan of the bus only shows address 0x70.
I can add the ADS1115 on a different channel.

Is this the intended functionality?
I was hoping the attached could be accomplished.


.pdf   I2C Conceptual.pdf (Size: 523.08 KB / Downloads: 108)

(2022-10-21, 02:16 AM)RichFind Wrote: I am having trouble getting an INA219.
I believe I have connected it correctly. (see attached) The top portion shows my connections. The bottom half is from the chip supplier's spec sheet.


These are the settings:

This is the result:


Why am I getting null values?

(2022-10-19, 09:52 AM)nebosa Wrote:
(2022-10-18, 11:22 PM)RichFind Wrote: Also
Working on installing a multiplexor.
Will let you know how things go.
Will be able to test with BPE688, INA218 and ADS115 (when available).

TIA

I expect a nice step by step guide if you were successful  Smile

Working on setting up the wiring for the individual sensors before going for multiplexing.
Just posted an issue I am having.
Reply
#34
You are connecting multiple sensors to the same PCA9548A/TCA9548A channel and that will not work. You have to connect just 1 sensors by channel like this picture:

[Image: 5626-06.jpg]



You can connect sensors in line only when they are connected directly to the I2C bus and you identify them by address but using the multiplexer the address will always be the multiplexer address (0x70) and you identify each sensor by channel.

More about you schema:

- Using LTC4311 terminators is a good idea when using long I2C cables.

- I may be wrong but the ISO154 isolator needs to be powered from both sides and you are only powering it from the Raspberry. If I am not wrong again the INA219 does not provide power to the I2C bus:

EDIT: sorry, I see that you are already powering the isolator by (vessel to 5v PS). Unless you have many sensors, I think you can power them from the Raspberry and you can omit the isolators

   
Reply
#35
More thoughts:

If you are powering the raspberry and the I2C sensors from the same battery bank you do not need the isolator even if you are using a INA219 sensor to measure the battery bank.

You will need the isolator only if you are measuring a second battery bank using a second INA219 connected to the Raspberry I2C bus. In that case you need a dedicated 12v-5v PS to power the isolator.
Reply
#36
Thank you for replying.

Great work on the entire OpenPlotter project.

I had the impression multiple sensors were allowed from the Texas Instruments spec sheet. 

   

   

However, I can't find any examples of using it that way.

So, I was WRONG.

So now the plan looks like:


.pdf   I2C Conceptual_2022_11_06.pdf (Size: 516.53 KB / Downloads: 102)


With an actual branch based on Plan B-2 like this:


.pdf   Bow Sensors_2022_11_06.pdf (Size: 478.54 KB / Downloads: 130)

I will still need to tweak some Settings in the INA219. Is there somewhere I can get a list of the available settings?
Reply
#37
You are right, those pictures are clear. Maybe this feature is not implemented in the adafruit python library we use for this.

INA219 settings are not implemented. what settings do you need?

this is the code we use: https://github.com/adafruit/Adafruit_Cir..._ina219.py
Reply
#38
Here is a link to an adafruit forum. 

INA219 shunt calculation validation - adafruit industries

The subject is misleading, there is download in the post titled "INA219-config.html.zip" from ada_fruit_mike.

It generates the code necessary to configure the INA219.

For example:

   

The item circled in green actually has an entry of 0.020, because I am planning to use it with a 4 to 20 mA sensor.

At the bottom it outputs the configuration.

Note that it calculated shunt resister for a higher resolution.

Is there a way to incorporate this into your code?
Reply
#39
I think I could add these settings:

set_calibration_32V_2A
       """Configures to INA219 to be able to measure up to 32V and 2A of current. Counter
       overflow occurs at 3.2A.
       .. note:: These calculations assume a 0.1 shunt ohm resistor is present
       """
set_calibration_32V_1A
       """Configures to INA219 to be able to measure up to 32V and 1A of current. Counter overflow
       occurs at 1.3A.
       .. note:: These calculations assume a 0.1 ohm shunt resistor is present"""

set_calibration_16V_400mA
       """Configures to INA219 to be able to measure up to 16V and 400mA of current. Counter
       overflow occurs at 1.6A.
       .. note:: These calculations assume a 0.1 ohm shunt resistor is present"""
    
set_calibration_16V_5A
       """Configures to INA219 to be able to measure up to 16V and 5000mA of current. Counter
       overflow occurs at 8.0A.
       .. note:: These calculations assume a 0.02 ohm shunt resistor is present"""

The default is set_calibration_32V_2A. The last one seems the most useful for boats (set_calibration_16V_5A). Do you know what is the default shunt resistor present?
Reply
#40
Those are not going to work. Cant explain now. Battening down for hurricane.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)