2017-03-04, 11:10 AM
It can be implemented but it isn't so far.
On one I2C bus you can connect up to 4 ads1115. The hardware addresses are 48,49,4A,4B. You have to set the hardware address. You should check that with "i2cdetect -y 1".
A quick and dirty way is to make a copy of the python files with different names for the addresses 49,4A and 4B.
Copy the file ads1115.py to ads1115_49.py
and edit in the new file
line 21 from "class Ads1115():" to "class Ads1115_49():".
line 26 from "self.ADS1115_address = 0x48" to "self.ADS1115_address = 0x49".
line 64 from " ADS1115='ADS1115_' " to " ADS1115='ADS1115_49_' ".
Copy the file analog_ads1115.py to analog_ads1115_49.py
and edit in the new file
line 20 from "from classes.ads1115 import Ads1115" to "from classes.ads1115_49 import Ads1115_49".
line 35 from "ads1115=Ads1115()" to "ads1115=Ads1115_49()".
line 47 from " ADS1115='ADS1115_' " to " ADS1115='ADS1115_49_' ".
In openplotter_analog.conf you have to add the settings [ADS1115_49_0]....
To integrate it into OpenPlotter menu you have to edit openplotter.conf section [TOOLS]
py = py = [['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115.py', '0'], ['Analog ads1115_49', 'put analog values to SignalK', 'analog_ads1115_49.py', '0'], ['Analog Firmata', 'put analog values to SignalK', 'oppymata.py', '0'], ['SignalK Simulator', 'change values with sliders and send values to SignalK', 'SK-simulator.py', '0'], ['Auto Setup', 'configure basic system', 'autosetup_tty.py', '0']]
I haven't test this. But I think it should work.
Tips:
You can also try anykind of Arduino with firmata and you will have many adc inputs with 12 or 16 bits (teensy 3.2 or lc).
Have you thought about isolation? https://www.elektormagazine.com/labs/uni...ter-150089
A connection example to messure 12V to 3,3V with an mcu can be found on page 3 "Analog1" https://github.com/sarfata/kbox-hardware...x-revC.pdf.
On one I2C bus you can connect up to 4 ads1115. The hardware addresses are 48,49,4A,4B. You have to set the hardware address. You should check that with "i2cdetect -y 1".
A quick and dirty way is to make a copy of the python files with different names for the addresses 49,4A and 4B.
Copy the file ads1115.py to ads1115_49.py
and edit in the new file
line 21 from "class Ads1115():" to "class Ads1115_49():".
line 26 from "self.ADS1115_address = 0x48" to "self.ADS1115_address = 0x49".
line 64 from " ADS1115='ADS1115_' " to " ADS1115='ADS1115_49_' ".
Copy the file analog_ads1115.py to analog_ads1115_49.py
and edit in the new file
line 20 from "from classes.ads1115 import Ads1115" to "from classes.ads1115_49 import Ads1115_49".
line 35 from "ads1115=Ads1115()" to "ads1115=Ads1115_49()".
line 47 from " ADS1115='ADS1115_' " to " ADS1115='ADS1115_49_' ".
In openplotter_analog.conf you have to add the settings [ADS1115_49_0]....
To integrate it into OpenPlotter menu you have to edit openplotter.conf section [TOOLS]
py = py = [['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115.py', '0'], ['Analog ads1115_49', 'put analog values to SignalK', 'analog_ads1115_49.py', '0'], ['Analog Firmata', 'put analog values to SignalK', 'oppymata.py', '0'], ['SignalK Simulator', 'change values with sliders and send values to SignalK', 'SK-simulator.py', '0'], ['Auto Setup', 'configure basic system', 'autosetup_tty.py', '0']]
I haven't test this. But I think it should work.
Tips:
You can also try anykind of Arduino with firmata and you will have many adc inputs with 12 or 16 bits (teensy 3.2 or lc).
Have you thought about isolation? https://www.elektormagazine.com/labs/uni...ter-150089
A connection example to messure 12V to 3,3V with an mcu can be found on page 3 "Analog1" https://github.com/sarfata/kbox-hardware...x-revC.pdf.