Here's a first crack at adding low pass filtering to the current sensor. Based on the guidance in the ADS1115 data sheet about max filtering resistance value (NMT 1k), I started there. I fed both the Vref and Vout signals through 1k resistors, and then tried a bunch of different capacitor value on the signal line. The plot below shows the effect of filtering on the measured values (measurement interval = 133ms, single sample per measurement here, so no 'digital' filtering). EDIT: I should add that all measurements are taken with a 30A charge coming from a Growatt inverter.
All four of the capacitor values show below have a significant effect. I believe the 10uF cap (red points) corresponds to a low-pass of 16hz, while the 47uF cap (orange points) would be 3.4hz. Not sure what I should be using as my lower limit for frequency. I imagine that I want to avoid filtering out any real/meaningful spikes in the current? So maybe 22hz / 7.2hz is a good balance?
Another thought is to make sure you aren't creating a peak charge circuit by having too large a capacitor/resistor ratio. That would negatively effect the accuracy, by skewing it higher. I am not sure what the internal circuitry looks like on the current sensor, so it may not be an issue.
Anything else I should look at to make the RC filter more effective? I'm currently using cheep electrolytic caps. Would a different cap type behave differently?
By split in two I assume you mean a two stage filter?
My initial thoughts is that you don't need to get too deep into the weeds here. Anything in the ball park should result in a acceptable result. While trial and error isn't ideal, you can get pretty close that way. But I am not an expert by any means!
Sorry if this is a stupid question, but what exactly do we mean by 'Sampling Rate' in this context? The interval at which I'm collecting data, or the 'output data rate' of the ADS1115? My plan is to collect data at 1 sec intervals (possibly 500ms), but I may sample multiple times at each interval for smoothing purposes.First you need to know your sampling rate, because that will determine the limit you must be under to not alias. Then you need to know what is the highest frequency (or transient lowest duration since we're talking current measurement here) you want to be able to measure.
Sorry if this is a stupid question, but what exactly do we mean by 'Sampling Rate' in this context? The interval at which I'm collecting data, or the 'output data rate' of the ADS1115? My plan is to collect data at 1 sec intervals (possibly 500ms), but I may sample multiple times at each interval for smoothing purposes.
tried out the 'split' RC low-pass filter, and wow did that make a difference. I can basically run it with no digital filtering at this point the noise is so low. And that's with the cheep electrolytic caps. I've ordered a few ceramic caps. We'll see what those do when they come in.
First, based on the data sheet, the OPA198 can be used with a single supply, and it's 'rail-to-rail'. The recommended operating range for Vs is 4.5 to 36V. So, does that mean I can use +5V for V+ and ground for V-, as long as my input voltage is well within that range? Or do I need to plan for supplying the op-amp with >5V?
BiduleOhm, I noticed a circuit in your schematic that seems to produce a 'dual supply' of +12V and -12V. Is that for powering all the op-amps?
Makes sense. I'll likely keep averaging, but keep the sample size fairly small to minimize the total sampling time.However I still recommend to do some averaging to have a better resolution. It's almost free so why not.
Yup, that's a typo...I ordered a 189.NB: I recommended the 189, not the 198, so I'm not sure if it's just a typo or if you ordered the wrong one but you might want to check that.
So, I'm only planning to use this op-amp for the pack voltage measurement. If I assume the range I want to measure is 40 - 60V (2.5V - 3.75V at the cell level), I could use a divider with an R1:R2 ratio of 25:1, which would put my Vout (from the divider) range of 1.53 - 2.31V (which keeps me in the range of -Vcc to +Vcc - 2.5). With the 25:1 divider, and using the ADS1115 in the +/- 4.096 (1x Gain) range, my resolution would be 3.25 mV (0.125 mV/step * 26). That seems like it should satisfy my functional requirements. In that case, it sounds like I should be ok supplying the Op-amp with the same 5V supply that I'm using to power the rest of my components.It has a rail-to-rail output but the inputs only include ground, and they can only go up to (+Vcc - 2.5) V. So if you want to put 5 V in an input you need to power it with at least 7.5 V. Sorry, I forgot to mention that earlier.
If I've missed the mark on my calculations above, I'll look into adding another DC/DC converter (or linear voltage regulator) to power the op-amp.Yes, I use a DC/DC converter (U930 on the schematic) to take the battery voltage and generate the main +12 and -12 V rails, but since it's quite a nice converter it's also somewhat expensive. In your case it should be cheaper to generate a 9 or 12 V rail from the existing 5 V with a DC/DC converter, or to use another method depending on what power sources you already have in your system (just thinking that since you only need a few mA you could use a high voltage linear regulator fed from the battery).
Yup, that's a typo...I ordered a 189.
So, I'm only planning to use this op-amp for the pack voltage measurement. If I assume the range I want to measure is 40 - 60V (2.5V - 3.75V at the cell level), I could use a divider with an R1:R2 ratio of 25:1, which would put my Vout (from the divider) range of 1.60 - 2.40V (which keeps me in the range of -Vcc to +Vcc - 2.5). With the 25:1 divider, and using the ADS1115 in the +/- 4.096 (1x Gain) range, my resolution would be 3.125 mV (0.125 mV/step * 25). That seems like it should satisfy my functional requirements. In that case, it sounds like I should be ok supplying the Op-amp with the same 5V supply that I'm using to power the rest of my components.
If your objective is to just measure current and battery voltage then INA226 might be a great alternative. It contains a 16-bit adc, so current measurements are very accurate when using a shunt.
Understood. I really just bought it as a backup plan in case I can’t get all these separate circuits to work as needed. In that case, I may end up abandoning the Hall effect sensor and going with a shunt.Look up drag soldering tutorials
Well, the whole point of using a INA22x is to be able to use a simple and cheap shunt instead of something else.
Hi mnm1501. Your timing is perfect. I took my first crack at communicating with my Growatt (SPF 3000 LVM 48P) yesterday, and realized very quickly that I have absolutely no idea what I'm doing. I have no experience with CANBUS or MODBUS, and to be honest, I'm not even sure which one the Growatt uses for BMS communication. I had originally planned to use the UART to CAN module that came with my BMS, but I'm now thinking that the Growatt uses RS485 (the manual provides very little detail, but the cable detail shows RS485A and RS485B connectors (not CAN-L and CAN-H). So, maybe I need a UART to RS485 Module? And does the growatt use the CANBUS protocol transmitted via RS485? Or maybe I just don't understand the distinctions between CANBUS, MODBUS, RS485, etc.Hi, I am also looking into how to pass my battery info to my Growatt SPH5000 Hybrid inverter. Have you guys had a look at the DIYBMS (https://github.com/stuartpittaway/diyBMS), currently configuring these to replace the DALY BMS currently installed on my 4 x 48V packs & want to build a concentrator to monitor the 4 packs & push the data to the Growatt Inverter. I have a tonne of MODBUS experience having worked in the metering & software space for the last 12 years. I am now starting to play with Canbus hopefully using a ESP8266 or ESP32 as the brains to emulate the Pylontech parameters that seem to be the most generic Canbus for different inverters. Would love to see who out there is heading down a similar path.
I also need a dual channel amp, as the sensor has separate low and high range signals.
The LEM DHAB S/133 sensor that came with my BMS is a dual range sensor (0-75A, and 0-750A), so it actually has two completely independent signal output lines: one with a sensitivity of 27mV/A, and one with 2.7mV/A). That’s why I think I need a dual input op-amp. I’ll read through your linked info to make sure I’m not missing something on that.