Author Topic: Hello New Here and Off grid battery monitor using INA240  (Read 2602 times)

0 Members and 1 Guest are viewing this topic.

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12753
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #25 on: April 12, 2021, 09:28:38 pm »
There would be no problem running a few metres of screened twin core cable between the shunts and the INA238 boards so you can keep the I2C bus nice and short.  Ground the screen at the Arduino end only.   *IF* you are using high side shunts put a 100R 1/4W fusible resistor in series with each sense wire at the shunt end to protect the wiring if it ever gets shorted to ground.

Are you also going to monitor battery voltage? 
« Last Edit: April 12, 2021, 09:32:25 pm by Ian.M »
 

Offline Robert Smith Eco WarriorTopic starter

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #26 on: April 12, 2021, 09:49:17 pm »
Yes.
It seems that the INA238 / 240 devices can have a supply voltage at battery voltage, in my case around 48 - 60v and it also gives a battery voltage signal as part of the output.

I think I am going to go......  2 x Shunts.... 2 x INA240 (creating two amplified voltages) .... Arduino .... Arduino RS485 shield...... Bourns protection thing..................................long wire..................... Bounes protection thing...... Arduino RS485 shield..... Arduino ..... Displays of some sort.

I did think about using two INA238 devices with an I2C output and then using an arduino to convert that to RS485 but I can see that being more trouble to figure out than a voltage to RS485.

I have a list of RS and Farnell part numbers and now I am going to bed  :=\
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12753
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #27 on: April 12, 2021, 10:07:16 pm »
The problem with your proposed hookup is the Arduino doesn't have enough ADC resolution to be useful for reasonably accurate energy monitoring applications.  At best you get three decimal digits from its internal 10 bit ADC *if* you get all the analog wiring and filtering pretty much perfect and do enough averaging to get the LSB stable.  Just hook it up 'maker style' and you would be doing quite well to get two and a half digit resolution.  Therefore its likely you'd need external differential 16 bit ADCs to get four decimal digits of resolution. 
 

Offline Robert Smith Eco WarriorTopic starter

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #28 on: April 14, 2021, 09:42:30 am »
Hi Ian,
I think we shall get it going 'maker style' and see what we come up with. You may be right but my son has this project to do in a short timescale and I have a million of my own projects. Today I have to plough next years vegetable plot and a million other jobs so if we get something working that will be a start point to work from.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12753
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #29 on: April 14, 2021, 10:20:35 am »
No problem.  If you are unsatisfied with the results you can easily add an ADS1115 16 bit ADC breakout board between your INA240 instrumentation amps and the Arduino and replace analogRead() in your sketch with calls to Adafruit's easy to use Arduino library. 

It will use Arduino Uno/Nano pins A4 and A5 as those are the I2C bus so keep those available (either free or used for analog signals that will be transferred to the ADS1115).   We can discuss how to hook it up to minimize noise and offset errors when you decide you need it.  Ask in this thread, as it will 'bump' it for me, and I might miss it if you started a new one.  If its been a while, you can find this thread again by looking in the 'Show Posts' section of your profile, and selecting 'Topics', which will show you the first post of any threads you originate.

The only essential right now is to make sure there is enough room in the box (or on the board if you are using an Arduino Nano on stripboard) to mount the ADS1115 breakout if/when you need to add one
« Last Edit: April 14, 2021, 10:30:24 am by Ian.M »
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #30 on: April 14, 2021, 02:46:26 pm »
It seems that the INA238 / 240 devices can have a supply voltage at battery voltage, in my case around 48 - 60v.
No, of course not.
It can sense up to 85 V but it runs on 2.7 - 5.5 V

I did think about using two INA238 devices with an I2C output and then using an arduino to convert that to RS485 but I can see that being more trouble to figure out than a voltage to RS485.
Considering that you'll probably be using libraries for everything I don't see how this is really so.

Bear in mind that the INA238 has 0.5 mm pin spacing.
The INA240 has 0.65 mm pin spacing.
You're probably going to need to make/buy a break-out board.
A quick look shows that there seems to be only expensive "evaluation" boards.
 

Offline Robert Smith Eco WarriorTopic starter

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #31 on: April 19, 2021, 08:02:17 am »
Hi Renate,
Yes. I figured out the supply voltage after reading the spec sheets while more awake.

The problem with using the RS485 was getting the mV shunt readings into a form to go across RS485, not so much using RS485 itself.

I have some INA238 chips on their way here and got some VSSOP size device to DIP adapter boards to bring the tiny pin spacing upto something I can more sensibly work with. I shall have to solder the chips on to the little boards but hopefully they will be far easier to handle once that is done.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16510
  • Country: us
  • DavidH
Re: Hello New Here and Off grid battery monitor using INA240
« Reply #32 on: April 19, 2021, 04:46:13 pm »
Sending the analog signal 30 meters after amplification is very feasible with some attention, however I would be very cautious about the lightning and safety situation:

1. The negative side is grounded at the inverter but the current shunts are in series with the negative side which does not strike me as ideal.  Even if a shunt did not fail open, there are now more connections in series on the protective ground circuit.

2. There is a ground loop through the USB connection to the computer's chassis ground.  At the very least, the USB connection should be of galvanically isolated to protect the computer from damage in the event of a fault.  An Ethernet connection would be even better; see below.

I have some other commends about the general design:

1. It is not shown in your diagram, but instrumentation amplifiers have another input in the form of the reference input which serves as the reference for the output voltage.  So there are *three* analog signals if the two reference inputs are combined to travel 30 meters to the Arduino.  When used this way, the reference input removes noise between the amplifier output and the load.  It is important to show the reference input connections to properly understand how the circuit works and what is going on.

2.  Placing the current shunts on the positive side may be desirable but creates complications with using the instrumentation amplifiers as I expect you found.  The alternative I would try before using instrumentation amplifiers is high side current mirrors using operational amplifiers shown in figure 10 here.  The voltage range of the output is only limited by the voltage rating of the external transistor so it can be quite high.  Counterintuitively however, this requires the load to share a ground for the return currents, which means it would *not* work with galvanically isolated USB without other provisions to share a ground, but I would still prefer to do it this way if acceptable, which it should be since using instrumentation amplifiers has the same disadvantages in regard to grounding and return currents and more.  It is just something to think about; if you are more comfortable with instrumentation amplifiers, then use them.

Operational amplifier current mirrors can also be used on the negative side but this may present difficulties on the measurement side because the signal will be referenced to a positive voltage and go negative.  I would still do this rather than use instrumentation amplifiers.

3. The safest configuration is to move all of the measurement circuitry to the remove location and connect via Ethernet because it is inherently galvanically isolated at both ends.  This also allows the easy option of using Ethernet over optical fiber or Ethernet to WiFi bridges.
 
The following users thanked this post: Robert Smith Eco Warrior


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf