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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] Battery monitor
#23
(2018-06-09, 02:45 PM)Opie91 Wrote:
(2018-06-09, 09:37 AM)Lazzz Wrote:
(2018-03-04, 01:01 AM)Opie91 Wrote: Here is the modified code for the INA3221 sensor. This is still pretty basic and only measures voltage, but it seems to work well.

I plan on making the configuration file work with OP sometime in the future, but not right now.

One important thing: Only use the positive inputs (INA1+, INA2+, INA3+) from your voltage source(batteries, solar, charger, etc...) for measuring voltage. The grounds from your voltage sources must be tied to a Pi ground for proper voltage reference. So do not use INA1-, INA2- or INA3- or your voltages will measure incorrectly.

Directions:

**First rename the .txt files to the file names below**
 
1.       Place files “Voltage_Code_1.0.py” and “SDL_Pi_INA3221.py” in folder “~/.openplotter/tools” on your Pi

2.       In the terminal while in folder ~/.openplotter/tools type “sudo chmod a+x Voltage_Code_1.0.py” to make the code executable

3.       To enable the tool open the OpenPlotter configuration file in ~/.openplotter/openplotter.conf. Go to section [TOOLS] and add:  “,['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'Voltage_Code_1.0.py', '1']” to py.

Mine looks like this (You can cut and paste this into your config file if you have no other special tools):

[TOOLS]
py = [['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115.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', '1'],['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'Voltage_Code_1.0.py', '1']]

4.       Reboot or start the tool in the Openplotter menu. The sensor should start automatically at each boot.
 
For more info about the adding tools see the Openplotter manual. OP Manual

Good luck. Ill answer any questions I can.


I tried this with V1.0 but OP doesn't recognize the INA3221 and when I click on settings nothing happens.

Do you know if it works with the new version or is it easier to get a ADS1115???

Yes, the code still does work with V1.0, but the installation is a little different. OP V1.0 seems to handle add on tools a little differently and now requires a separate folder for each tool. I have it working on my pi now and will post new instructions in the next day or two.

For now you can start it manually by going to the folder "Voltage_Code_1.0" is in and type "python Voltage_Code_1.0". That should start the code and it will show up on the SignalK bus.

As far as the settings go, They are all in the code for now. When I get some time ill get that working.

Good luck!



Thanks in advance Opie91 Smile
Reply


Messages In This Thread
[solved] Battery monitor - by Luckbert - 2017-09-01, 07:38 PM
RE: Battery monitor - by PaddyB - 2017-09-02, 10:30 AM
RE: Battery monitor - by Luckbert - 2017-09-02, 12:42 PM
RE: Battery monitor - by PaddyB - 2017-09-02, 12:56 PM
RE: Battery monitor - by tocan - 2017-09-02, 01:54 PM
RE: Battery monitor - by e-sailing - 2017-09-02, 02:33 PM
RE: Battery monitor - by Luckbert - 2017-09-03, 01:58 PM
RE: Battery monitor - by Luckbert - 2017-09-23, 04:16 PM
RE: Battery monitor - by tocan - 2017-09-23, 05:51 PM
RE: Battery monitor - by Luckbert - 2017-09-26, 09:30 AM
Battery monitor - by Alpenskipper - 2017-09-28, 02:26 PM
RE: Battery monitor - by Opie91 - 2018-02-27, 02:54 AM
RE: Battery monitor - by Lazzz - 2018-02-27, 08:17 AM
RE: Battery monitor - by Luckbert - 2018-02-27, 10:21 AM
RE: Battery monitor - by Opie91 - 2018-02-27, 11:48 PM
RE: Battery monitor - by Opie91 - 2018-03-01, 04:18 AM
RE: Battery monitor - by Opie91 - 2018-03-04, 01:01 AM
RE: Battery monitor - by Lazzz - 2018-06-09, 09:37 AM
RE: Battery monitor - by Opie91 - 2018-06-09, 02:45 PM
RE: Battery monitor - by Lazzz - 2018-06-09, 10:24 PM
RE: Battery monitor - by Lazzz - 2018-03-04, 04:59 AM
RE: Battery monitor - by Luckbert - 2018-03-04, 02:51 PM
RE: [solved] Battery monitor - by Luckbert - 2018-06-09, 09:47 AM
RE: [solved] Battery monitor - by Opie91 - 2018-06-10, 02:34 AM
RE: [solved] Battery monitor - by Lazzz - 2018-06-10, 05:12 AM
RE: [solved] Battery monitor - by Alethediver - 2018-07-28, 08:21 AM
RE: [solved] Battery monitor - by Opie91 - 2018-07-29, 01:55 PM
RE: [solved] Battery monitor - by tjmack - 2020-05-27, 02:36 PM
RE: [solved] Battery monitor - by SARASTRO - 2021-02-24, 08:09 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)