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
Logging battery amps
#21
Many thanks!
Reply
#22
(2019-04-02, 06:46 PM)PaddyB Wrote:
(2019-03-16, 08:31 PM)baltika_no_9 Wrote: Hi

I'd be keen to try this but cannot find a link to the code, could someone please give me a pointer?

Many thanks

Haven't touched this for a while, and forgot I even uploaded this Smile

Might work, give it a go Smile

https://github.com/boatybits/ConstantCurrent

Many Thanks for the code! Smile It shows up on the Arduino Serial Monitor, and it shows it connected to the OP Local broker, but I cannot for the life of me get the info to be displayed in OP/SK Diagnostic? I have gone through the code several times, but I am stumped - any help would be greatly appreciated Smile

Thanks and apologies for being stupid in advance if it turns out to be......

(PS I am running OP on a RPI2 because the 3 is installed on the boat
Reply
#23
Hi, well must be close, do you have a serial input set up in data providers? Can't remember if that was a default or if I added it >
[Image: oMMjL60.png]

[Image: 0rxAtut.png]

I'll have a look at the code later, been a little while so won't remember how it works straight away Smile

EDIT - Don;t think it works!! Can't see anything sending signalk so no wonder sigk isn't receiving anything Smile
Gimme day or 2, I'll have a dig.
Reply
#24
(2019-04-13, 04:46 PM)PaddyB Wrote: Hi, well must be close, do you have a serial input set up in data providers? Can't remember if that was a default or if I added it >
[Image: oMMjL60.png]

[Image: 0rxAtut.png]

I'll have a look at the code later, been a little while so won't remember how it works straight away Smile

EDIT - Don;t think it works!! Can't see anything sending signalk so no wonder sigk isn't receiving anything Smile
Gimme day or 2, I'll have a dig.


I don’t have a serial input set up, I will do but I think it’s manually added as it wasn’t showing up in my signalK list on V1.2 Smile

Thank you Smile
Reply
#25
Oops, not sure that code will work, I think that github is actually for something else..

I'll have  dig later, must be close though Smile
Reply
#26
I’ve managed somehow to get amps and bolts showing in signalK using a combination of ESPEasy and Nodered, however it poses a new question....

How do you get the INA219 to log the amps/volts from the negative side? Every code out there predominantly uses the positive side to measure but for solar panels, etc you need both measures...I found a site that explained there was a bug in the INA coding which doesn’t allow it, but I wondered if anyone had worked around it?

Thanks! :-)
Reply
#27
(2019-04-18, 08:32 PM)AliceJ21 Wrote: I’ve managed somehow to get amps and bolts showing in signalK using a combination of ESPEasy and Nodered, however it poses a new question....

How do you get the INA219 to log the amps/volts from the negative side? Every code out there predominantly uses the positive side to measure but for solar panels, etc you need both measures...I found a site that explained there was a bug in the INA coding which doesn’t allow it, but I wondered if anyone had worked around it?

Thanks! :-)

I've been having a play with platformio and visual studio code which was a bit of a struggle to get going on, more because of the Arduino IDE not really being totally C++. Platformio is, IMHO, well worth having a look at. The libraries used can be stored with the code so no more problems from updated libraries breaking the code in the future. Anyway, work in progress but it's here and working on a wemos lolin32 board should anyone want to have a play. Probably inefficient as I tend to cut and paste then fiddle til it works rather than actually be a clever coder Smile  
https://github.com/boatybits/DATA_SENDER

Just tried measuring current low side and it made no difference, though you won't be able to read the voltage high side.
Reply
#28
(2019-04-23, 02:11 PM)PaddyB Wrote: Probably inefficient as I tend to cut and paste then fiddle til it works rather than actually be a clever coder Smile  

....guilty here too! [emoji23]

(2019-04-23, 02:11 PM)PaddyB Wrote: I've been having a play with platformio and visual studio code which was a bit of a struggle to get going on, more because of the Arduino IDE not really being totally C++. Platformio is, IMHO, well worth having a look at. The libraries used can be stored with the code so no more problems from updated libraries breaking the code in the future. Anyway, work in progress but it's here and working on a wemos lolin32 board should anyone want to have a play. Probably inefficient as I tend to cut and paste then fiddle til it works rather than actually be a clever coder Smile  
https://github.com/boatybits/DATA_SENDER

Thanks for this, I will give it a bash tomorrow :-) I was thinking about trying PlatformIo but the install seemed a bit complicated to me but I’ll crack it eventually.

Is this using the onboard shunt (0.01) or the boat shunt you mentioned further up?

(2019-04-23, 02:11 PM)PaddyB Wrote: Just tried measuring current low side and it made no difference, though you won't be able to read the voltage high side.

Sorry for me being a clampit* but is:

High side - positive measuring
Low side - negative measuring?

(*glaswegian name for numpty)

Thanks! :-)
Reply
#29
(2019-04-23, 02:41 PM)AliceJ21 Wrote:
(2019-04-23, 02:11 PM)PaddyB Wrote: I've been having a play with platformio and visual studio code which was a bit of a struggle to get going on, more because of the Arduino IDE not really being totally C++. Platformio is, IMHO, well worth having a look at. The libraries used can be stored with the code so no more problems from updated libraries breaking the code in the future. Anyway, work in progress but it's here and working on a wemos lolin32 board should anyone want to have a play. Probably inefficient as I tend to cut and paste then fiddle til it works rather than actually be a clever coder Smile  
https://github.com/boatybits/DATA_SENDER

Thanks for this, I will give it a bash tomorrow :-) I was thinking about trying PlatformIo but the install seemed a bit complicated to me but I’ll crack it eventually.

Is this using the onboard shunt (0.01) or the boat shunt you mentioned further up?



(2019-04-23, 02:11 PM)PaddyB Wrote: Just tried measuring current low side and it made no difference, though you won't be able to read the voltage high side.

Sorry for me being a clampit* but is:

High side - positive measuring
Low side -  negative measuring?

(*glaswegian name for numpty)

Thanks! :-)

I think high side is between the load and positive while low side is between the load and neg. As it's measuring current I don't think it matters - AKAIK it's just measuring the voltage drop across the built in 0.1Ohm resister, I just tried this and the current was the same both times. 

[Image: Pulp3Da.png]


Platformio is worth a little time, it was easy to add on to visual studio code. https://docs.platformio.org/en/latest/ide/vscode.html
Will probably save more time with spotting code which doesn't work as you go along instead of waiting for the compiler to return an error message like the arduino IDE does.
Reply
#30
(2019-04-23, 03:53 PM)PaddyB Wrote:
(2019-04-23, 02:41 PM)AliceJ21 Wrote:
(2019-04-23, 02:11 PM)PaddyB Wrote: I've been having a play with platformio and visual studio code which was a bit of a struggle to get going on, more because of the Arduino IDE not really being totally C++. Platformio is, IMHO, well worth having a look at. The libraries used can be stored with the code so no more problems from updated libraries breaking the code in the future. Anyway, work in progress but it's here and working on a wemos lolin32 board should anyone want to have a play. Probably inefficient as I tend to cut and paste then fiddle til it works rather than actually be a clever coder Smile  
https://github.com/boatybits/DATA_SENDER

Thanks for this, I will give it a bash tomorrow :-) I was thinking about trying PlatformIo but the install seemed a bit complicated to me but I’ll crack it eventually.

Is this using the onboard shunt (0.01) or the boat shunt you mentioned further up?



(2019-04-23, 02:11 PM)PaddyB Wrote: Just tried measuring current low side and it made no difference, though you won't be able to read the voltage high side.

Sorry for me being a clampit* but is:

High side - positive measuring
Low side -  negative measuring?

(*glaswegian name for numpty)

Thanks! :-)

I think high side is between the load and positive while low side is between the load and neg. As it's measuring current I don't think it matters - AKAIK it's just measuring the voltage drop across the built in 0.1Ohm resister, I just tried this and the current was the same both times. 

[Image: Pulp3Da.png]


Platformio is worth a little time, it was easy to add on to visual studio code. https://docs.platformio.org/en/latest/ide/vscode.html
Will probably save more time with spotting code which doesn't work as you go along instead of waiting for the compiler to return an error message like the arduino IDE does.


Having borrowed a section of your code (the MQTT part) and put a new calibration section in the Adafruit_INA219 library to take a larger shunt (in this case a 100a, 75mV one) and modified the “getcurrent” code that comes with the Arduino library, I have managed to get a ESP8266 recording Volts and Current via MQTT into OP and then giving me SignalK values [emoji16]

Thanks for all the pointers PaddyB and co [emoji1303][emoji1303][emoji1303]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)