Notifications
Clear all

Help with high current Hall Effect sensor (HSTS016L)

7 Posts
2 Users
1 Reactions
216 Views
Inq
 Inq
(@inq)
Member
Joined: 3 years ago
Posts: 1929
Topic starter  

I'm working on a little project that involves monitoring 12V LiFePO4 and Pb-Acid batteries.  To monitor current, I've purchased some HSTS016L Hall Effect sensors.  I have gotten it to work and retrieving good looking data on an ESP8266 (3.3V logic). 

As with many commodity products more commonly used in other products out of China, the datasheets are a little thin on information.  For instance there is only one model number for these sensors that have the same external casing, but are made with internals that range from 10A up to 200A.  Fortunately, they do say what version is on the casing.

HSTS016L

 

 

The data sheet is a little thin, but it was enough for me to get it working using the red, black and yellow wires.  There is also a white (Vref) wire and a braided shielding mesh around the 4 wires.  My question are related to these two wires not described in the datasheet.  

Vref - On Arduinos and ESP's Vref often is used in conjunction with the Analog pins to reference a voltage in case it is different than the supplied voltage (Vcc).  I'm currently using the red wire connected directly to the 3.3V pin of the ESP.  Are there other definitions of Vref that might apply here?  Should I also connect this Vref wire to the 3.3V pin?

Shielding Mesh - This isn't even described/shown in the datasheet.  Would it be advisable to connect this to ground?  Although I have it working with just 3 wires, I haven't explored it in "noisy" environments and wondered if connecting this to ground might reduce noise on the signal.

I have not currently tried these ideas as these are coming from China and I'd rather not burn them out and have to wait another month for replacements.

I have scoured the Internet and have left a message to the manufacturer, but am hoping someone here might have generalized Hall Effect sensor knowledge that might apply to these questions.

Thanks,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Quote
Inq
 Inq
(@inq)
Member
Joined: 3 years ago
Posts: 1929
Topic starter  

I have the sensor currently working with no added components and the Vout connected to an analog to digital pin using their drawing from their datasheet (supplied in OP).

image

I have received a reply and a document from the manufacturer (attached below).

Ground Wire  

I had also asked about the braided shield in the cable, if it would reduce noise if grounded.  The reply to that was in the email and simply stated - "the shield can be grounded."  I'm not sure if that is definitive to what I asked, but I'm assuming grounding it might help reduce noise or at the very least not hurt.  😉 

Concerning the Vref Wire

The document is far more technical than the datasheet and is entirely about the Vref wire.  I was very impressed that they replied at all, much less with such a well translated document.  This may be helpful to others, but I'm struggling to understand what it is trying to tell me and whether this may or may not have a relation to my other thread - Shifting, Magnifying Voltages

At first, I thought that it was telling me that if I connected it to ground, it would shift the output from 2.5 +/- 0.625V to 0 +/- 0.625V  Reading a second time through, I'm not so sure.  The fact that their schematics include Op Amps and resistors is what I'm trying to learn about in the other thread, so I'm not too sure about myself.  I might need @davee to help translate this into simple, Inq language.

 

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1959
 

Hi @inq,

   Do you design crossword and Sudoku puzzles in your spare time?   😉

  This particular sensor seems to delight in being made available in numerous variations (I have even found 1 data sheet variant with +/-15V power requirements!), all with the same part number. Clearly, there must be a shortage of different part numbers, as well as requirement that data sheets shall be cryptic, in the manufacturer's part of the World, which is making this a tricky device to analyse from afar. But here goes, for a kick-off.

Braided shield, made of good conductor like copper or aluminium, of any cable can be required, to do two functions:

  1. Return conductor for a transmission line. Transmission lines consist of a pair of conductors, which must maintain the "same" physical construction in terms of conductive and insulating elements, throughout their length. A common example being a co-axial cable for a 'traditional' TV aerial. In this case, the shield forms half of the electrical wiring, and must be connected at both ends, to enable the signal to be transmitted from one to the other.
    • This use applies to higher frequency signals, say 1MHz and above. I don't think it applies to this sensor.
  2. A shield covering one or more wires, to attenuate external electric field signals from propagating from both the external environment to the inner wires, or from the inner wires to the external environment. The output signal from a Hall-effect probe will be very small, and hence the shield will be intended to reduce the pick up of stray electric fields, such as 50/60 Hz mains hum, by the inner wires, which would 'contaminate' the voltage output signal.
    • Normal advice would be to connect this to mains ground or chassis.
    • In an electrically 'quiet' environment, the observed sensor output will probably be the same, regardless of whether it is connected or not.
    • In rarer cases, with a lot of 'electrical noise' sources, connecting to a 'noisy' ground could actually increase the pickup, but this is less likely to occur. However, a boat or vehicle environment will be different from a house or workshop, so it is worth being aware that one solution may not fit all.
  3. Shields made of aluminium or copper offer almost no protection from stray magnetic fields. These are usually less pervasive than electric fields, but passing cables near transformers, etc. can obviously be unwise!

So in summary, I suggest the shield is connected to ground, or 0V if there is no meaningful ground connection available. It probably won't make any difference if it is left unconnected, but in it may help a little in providing a 'clean signal'.

NB Some shielded cables perform both 1. and 2. functions, and must have the shield connected at both ends, to enable the signal to be received.
Shields only performing 2. function should NOT normally be connected to ground at both ends, because it will form a 'ground loop' and typically inject a 'mains hum' signal onto the signal wires. As the shield enters the plastic enclosure of the sensor, it is impossible to connect the shield at the sensor end to ground, precluding this possibility.

-------------

I think the 0V line is fairly self-explanatory ... this should be the same 0V connection as for any ESPxxxx, Arduino, A/D converter, etc. that forms part of the circuit.

RE: I'm currently using the red wire connected directly to the 3.3V pin of the ESP.

gives me more concern, although not of the 'magic smoke concern' type, merely that it might give the 'wrong answer (wrong voltage) type'.

I have already mentioned the data sheets confusion, but taking the 200A variant one labelled HSTS016L-200A-2.5±0.625V.pdf, I note the following snips:

image

and

image

 This says the red wire is the +5V (supply) line, so connecting it to 3.3V is giving it short rations.

Also, the output range, assuming the current it measures may actually go from -200A to +200A, from time to time, is (2.5 - 0.625) V = 1.875V to (2.5 + 0.625V) = 3.125V.

As the precise internals of the sensor are still a mystery to me, I cannot be sure that it will not cope with only having 3.3V as a supply, but I would not be surprised if it 'struggled' to provide the expected output voltage, especially if the current pushes the required output towards and above 3V.

Whilst prototyping the circuit, I think you should provide the full 5V supply, and have a calibration test covering the required current range. If later, you would find it convenient to see if it can cope with only 3.3V, without distorting the data, then that is an experimental question for you to answer.

Note that this sensor is not being directly connected to the ESPxxxx, so the usual concerns of 5V sensor and 3.3V ESPxxxx GPIOs do not apply at this stage. Outputs from an A/D must of course be considered.

----------------------

The yellow wire is the analogue output, which, as just discussed, would be expected to show a voltage between 1.875V and 3.125V, depending on the current being sensed.

Vref as a 'name' without explanation, is ambiguous, because the same name might be an input to the sensor, implying the user should provide an external voltage source of 2.5V, or it might be an output of 2.5V from the reference within the sensor, in which it is used to offset the output voltage to 2.5V, when the current is zero, and is being provided to the external circuit, for comparison.

You have managed to locate a more descriptive document, which provides some enlightenment, although the language used appears to be semi-ambiguous. Clearly there is an internal Vref source of 2.5V, whose output is visible on the Vref pin, but there is also a suggestion that an external reference could be connected, which may override the internal reference. Perhaps it supports both options, or perhaps the manufacturer makes yet more options of the sensor, presumably all with the same part number, that are internally wired differently. I can't be sure!

So why would there be so much confusion? Basically, high precision voltage references that are not affected by temperature, etc. are tricky to make, and easily become expensive. The same data sheet says:

image

implying Vref should be between (2.5 - 0.015) = 2.485V and (2.5 + 0.015) = 2.515V

Now 0.625V (625mV) change from 2.5V is equivalent to 200A, implying a scale of 625 (mV) / 200(A) = 3.08mV/A

So that if the A/D sees an error offset of 15mV, then this will correspond to almost 5A current.

(Furthermore, this parameter requires the temperature to be 25degC. Change the temperature, and it may change more!)

To minimise this potential error, it is necessary to ensure that the actual Vref is effectively the same as that perceived by the A/D. 

The text provided 'discusses' two options:

  1. Feed the Vout and the Vref signals from the sensor to the non-inverting and inverting inputs of an operational amplifier, so the op-amp intrinsically subtracts the actual Vref reference voltage from the Vout signal, leaving a voltage that can range from -0.625V to +0.625V (for currents of -200A to +200A respectively), assuming the op-amp is configured for a gain of unity, and no other offsets are applied.
    • This is the option implied by :
    • image
  2.  Either leave Vref unconnected, or connect an external Vref or maybe"correction control" signal, whose specification is unclear, and measure Vout, assuming/knowing that the effective Vref is exactly 2.5V, at least to the precision required for the application.
    • This is the option implied by:
    • image

The first of these options should be fairly straightforward, and will hopefully meet your needs. I am still somewhat unclear about the second option. I am presuming it is for a designer who is constrained in choice of op-amps, A/Ds or whatever.

------

So, in the absence of any further information or insight, I suggest the "principle" discussed in the first option is pursued.

Note that 'algebraically', the first option in its simplistic, literal form implies a voltage range of -0.625V to + 0.625V. Clearly, this would require an op-amp, and A/D that is supplied with, and can deal with, negative voltages. I would generally aim to avoid this situation, by modifying the op-amp circuit to provide outputs that stay within a positive voltage range which is compatible with the A/D input. I haven't properly read the information you have provided in another thread, so I'll leave that for another time, and possibly put it on the other thread.

Best wishes, Dave


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 3 years ago
Posts: 1929
Topic starter  

Posted by: @davee

Do you design crossword and Sudoku puzzles in your spare time?   😉

Nah... sailboats and model airplanes. 

Render 2
Front

Posted by: @davee

I have even found 1 data sheet variant with +/-15V power requirements!), all with the same part number.

Ain't that special!? 😏 

Posted by: @davee

A shield covering one or more wires, to attenuate external electric field signals from propagating from both the external environment to the inner wires, or from the inner wires to the external environment. The output signal from a Hall-effect probe will be very small, and hence the shield will be intended to reduce the pick up of stray electric fields, such as 50/60 Hz mains hum, by the inner wires, which would 'contaminate' the voltage output signal.

  • Normal advice would be to connect this to mains ground or chassis. 
  • In an electrically 'quiet' environment, the observed sensor output will probably be the same, regardless of whether it is connected or not.
  • In rarer cases, with a lot of 'electrical noise' sources, connecting to a 'noisy' ground could actually increase the pickup, but this is less likely to occur. However, a boat or vehicle environment will be different from a house or workshop, so it is worth being aware that one solution may not fit all.

This was my assumption when I asked them the question.  The sensor seemed to work fine  un-connected in my room.  Since this project is going in my boat, I'll do some tests with it un and connected with it next to a sine-wave inverter pushing 150 Amps and see if there is a difference.

Posted by: @davee

Whilst prototyping the circuit, I think you should provide the full 5V supply, and have a calibration test covering the required current range. If later, you would find it convenient to see if it can cope with only 3.3V, without distorting the data, then that is an experimental question for you to answer.

Supposedly, they make ones that supports 3.3V and I thought I had ordered those.  But, as you pointed out, I have no way of telling what I actually have since all have the same model number. 

image

I have (3) 200A and (1) 150A versions. Supposedly, I can measure AC current also and will use two for measuring my house incoming current to correlate with the electric company's bills and to fulfill my curiosity of what some of the devices in my house use.

 I did see a Redit comment saying even the 3.3V ones like 5V better.  I'll also experiment with that, but I'd rather avoid 5V if I can.  About the best I can do is pulling 150 amps out of the battery.  The BMS kicks out above that.  I didn't explore the full range of amperage, but it was giving very good data compared to the shunt in the BMS... up to 100 Amps.

Posted by: @davee

You have managed to locate a more descriptive document, which provides some enlightenment, although the language used appears to be semi-ambiguous.

Well that is unsettling - I was thinking it was thick as mud.  The fact you see any ambiguity, even a little, turns mud into bricks. 😥 

Posted by: @davee

or perhaps the manufacturer makes yet more options of the sensor, presumably all with the same part number

You crack me up!!!  🤣 

Posted by: @davee

So that if the A/D sees an error offset of 15mV, then this will correspond to almost 5A current.

This is very interesting.  For the 150A version, the theoretical linear equation using the sensor output becomes:

y = mx + b   =>   Amps = 240 V - 600 

When comparing to my BMS's current output, I finally determined the equation should actually be:

Amps = 251.8629V - 628.925

I assumed it was merely manufacturing differences of either the BMS shunt or the Hall Effect sensor.  I have no way of telling which is mostly correct.  But now, I might need to exercise it and run it in more conditions and see if the variation changes.  But again... I won't know which - BMS or Hall is varying.   Hmmm... must ponder.

Posted by: @davee

Note that 'algebraically', the first option in its simplistic, literal form implies a voltage range of -0.625V to + 0.625V. Clearly, this would require an op-amp, and A/D that is supplied with, and can deal with, negative voltages. I would generally aim to avoid this situation, by modifying the op-amp circuit to provide outputs that stay within a positive voltage range which is compatible with the A/D input. I haven't properly read the information you have provided in another thread, so I'll leave that for another time, and possibly put it on the other thread.

I haven't read your other reply in the other thread and am seeing these two threads quickly merging into the same problem.  To my understanding the A/D I'm using ADS1115 handles +/- voltages.  I have the gain set to 1 (+/- 4.096V) to handle the max output of the Hall sensor's max value of 3.125V... thus I'm only using about 15% of the 16 bit A/D range... thus prompting the other thread.  However, if I can get the Hall to output +/- 0.625, I could use the gain = 4 (+/- 1.024V) and would improve to 61% of the A/D - A significant resolution improvement.

I've had my glass of wine and I'm getting a little bleary eyed.  I had class today.  I'm taking a TIG welding class at the local community college.  I'll have to tackle your other response in the other thread tomorrow.

VBR,

Inq

 

 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1959
 

Hi @inq,

  Just a quick addition to the last few paragraphs of your reply immediately above. Personally, although it is arithmetically trivial, it still leaves my ageing grey cell with a non-intuitive doubt, so apologies if I have overdone the explanation below.

--------------

  As I already mentioned, voltages are like heights, in which the height of a mountain depends on the choice of the foot of the mountain ... the voltage at a particular point in a circuit is relative to another point in the circuit. For convenience, there may be point or wire labelled something like 0V or Gnd, which act as a kind of 'sea level' in the height analogy, but in some circumstances, this is irrelevant. 

e.g. If someone claims to have climbed Everest, do they need to start at sea level? If not, if they managed to get flown to a point 100 feet below the summit, and then climbed the last 100 feet, could they still claim to have ascended it?

Sorry, if the above is labouring the point, but my suggestion is to try using the ADS1115 in differential mode, which is a bit like the climber who gets a lift to a point just below the summit, because reaching the summit was the only important thing to them, and they didn't care how they got there.

In the case of the measuring the output from the sensor, the 'information' is contained in the difference in the voltage between the Vout pin and the Vref pin, not the difference between the Vout pin and 0V. Hence, it makes sense to measure the voltage between the Vout pin and the Vref pin.

If you only had the sensor and a voltmeter, you could simply measure the voltage between the Vout and Vref wires, by attaching the probes to those, and read the voltage directly knowing 0V = 0A current, 0.625V = FSD current (200A say) and so on, without caring that Vref was at 2.5V relative to the 0V/Gnd line.

The aim of my suggestion is to attempt the same trick with an ADS1115 instead of the voltmeter, but because the ADS1115 has an implicit connection to the 0V line as a power source, it is necessary to be a little more careful.

So we can have a gotcha and/or it can be a bit confusing. This is the time to make sure you are sitting comfortably, beverage or two, to hand.

--

Firstly, although the 'lazy/smart' climber is only ascending 100 feet, they are doing it at 29,000+ feet above sea level, so they still need to be able to cope with the reduced air pressure.

The analogy to this, is that the ADS1115 chip is connected to a power source via the same 0V point as the sensor, with the ADS1115, being powered via its Vdd pin, which will be connected to 3.3V (relative to the 0V), to be compatible with the ESPxxxx chip for the digital output and control I2C links. Furthermore, all of the analogue input pins of the ADS1115 pin must never be connected to a voltage that is more than 0.3V below 0V or more than 0.3V above 3.3V, (range is -0.3V to 3.6V), with the threat of magic smoke, or at least degraded part, if this rule is broken.

This voltage range may give the impression that the chip could not cope with (say) -0.6V sensor output when the current was near full scale in the 'negative' direction. But, if the Vref pin is at 2.5V, relative to the 0V line, then the Vout pin will be at (2.5 - 0.6) = 1.9V relative to 0V. Since both Vref and Vout pins are connected to the ADS1115 analogue inputs, voltages of 1.9V and 2.5V, both with respect to 0V, are well within the magic smoke range of -0.3V to +3.6V.

In differential input mode, the ADS1115 applies those incoming voltages to a differential amplifier, which from a 'functional viewpoint', will subtract the voltages, so that it 'looks' like the incoming voltage is 1.9 - 2.5 = -0.6V.

Hence, you can pick the +/- 1.024V range, which chooses a voltage gain by the differential amplifier to best match the A/D range, knowing that the sensor output range is -0.625V to +0.625V, relative to the Vref voltage.

Furthermore, if the sensor's Vref voltage is slightly different from 2.5V, say 2.514V, then the '0.014V error', with respect to 0V, will also be added to the Vout voltage (with respect to 0V), so that its output will be (2.5.14 - 0.6) = 1.914.

So by sending both Vref and Vout to the inputs of the differential amplifier inside the ADS1115, the effective input becomes 1.914 - 2.514 = -0.6V   ... i.e. the 'true' sensor signal.

----------

NB Confusingly, the ADS1115's Vdd voltage can be chosen to be greater than 3.3V, as the chip itself can be powered by up to 5.5V, and exceptionally to 7V, but this will mean the I2C outputs will also be 5.5V or more, which will be magic smoke territory for the ESPxxxx. Some parameters in the data sheet refer to the Vdd is 5.5V situation, so care is needed in interpreting the data sheet.

----------

In summary:

It appears that the ADS1117 can provide the differential input to subtract the Vref offset, and amplify the resulting signal to make good use of the A/D resolution. The disadvantage of using this mode, is that you will need two ADS1117s to handle 4 sensors, but as discussed in previous message, up to 4 ADS1117s can be connected to the same I2C bus, so the ESPxxxx's electrical interface is unaffected by having more than one ADS1117, excepting there will be more I2C addresses referred to in the software.

When designing the interface between a sensor output and ADS input: 

The first rule/task is to ensure the sensor output voltages, relative 0V, never exceed 0 to Vdd power supply voltages to the ADS1115 by more than 0.3V, and I would recommend keeping them to within 0 to Vdd. This applies to ALL input options of the ADS1115.

If you want to use the differential input option of the ADS1115, which can be good choice when the sensor output voltage is with respect to some kind of reference voltage, instead of the 0V line, then providing the first rule is maintained, it is only necessary to consider the range of voltage DIFFERENCES between the signal voltage (Vout) and the reference voltage (Vref). Normally you would choose the most sensitive range that encompasses the expected voltage difference. e.g. +/-1.024V for expected range of -0.625V to + 0.625V

-----------

Hope that helps a little. Best wishes, Dave


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 3 years ago
Posts: 1929
Topic starter  

@davee,

You clearly saw through the murk of the whole project as I had laid out.  You took advantage of the two parts working together.  On the other hand I was bogged down in the individual pieces.

I've tried as you suggested.  I first tested the HSTS016L (150A Version) powered by 3.3V, and with nothing in the coil.  Both the Vout and Vred read ~2.5V.  With the wire in the coil running significant amperage, the Vref still read ~2.5 while the Vout changed.

I then hooked up an actual program running with the Adafruit ADS1X15 library.  The significant flow of the program:

  1. Measure the voltage on Vout alone.  The gain on the ADS1115 must be set on a full range of +/- 4.096 to account that the Vout runs from 1.875 to 3.125V.  This is what I have been using so far.  It only uses 15% of the A2D range.
  2. Measure the voltage of Vref alone.  Same gain reasons.
  3. Measure the differential of Vref - Vout.  Sure enough, the ADS115 outputs the difference of these and outputs a potential full range of -0.625 to 0.625.  I also run the gain to full range of +/- 1.024 and thus am now using 60% of the A2D range.  

Using this setup, this gives me a resolution of 0.0075 Amps / A2D step!!!

PXL 20250319 164521114

Source code for the test.

#include "ADS1X15.h"

#define TESTALL
ADS1115 ads(0x48);

void setup()
{
    Serial.begin(115200);
    Serial.println("");
    Serial.println(__FILE__);
    Serial.print("ads1X15_LIB_VERSION: ");
    Serial.println(ADS1X15_LIB_VERSION);

    Wire.begin();
    Wire.setClock(400000);   // No improvement at 1M.

    ads.begin();
    ads.setMode(1);    
    ads.setDataRate(7);    //  0 = slow   4 = medium   7 = fast

    //  trigger first read
    ads.setGain(4);
    ads.requestADC_Differential_0_1();
}

s32 cnt = 0;
s32 v0 = 0, v1 = 0, v01 = 0;
u8 pin = 0;

void loop()
{
    static u32 t0 = micros();

    if (ads.isBusy())
        return;

    switch (pin)
    {
    case 0:
        v01 += ads.readADC_Differential_0_1();
#ifdef TESTALL
        ads.setGain(1);
        ads.requestADC(0);
        pin = 1;
        return;
#else
        ads.requestADC_Differential_0_1();
        break;
#endif
    
    case 1:
        v0 += ads.getValue();
        ads.setGain(1);
        ads.requestADC(1);
        pin = 2;
        return;
    
    case 2:
        v1 += ads.getValue();
        ads.setGain(4);
        ads.requestADC_Differential_0_1();
        pin = 0;
        break;
    }
    cnt++;
    u32 t = micros();
    if (t - t0 > 1000000)
    {
        Serial.printf("[%d]\t", cnt);

#ifdef TESTALL
        // Set Gain at 1
        ads.setGain(1);
        v0 /= cnt;
        v1 /= cnt;
        float a = (ads.toVoltage(v1) - ads.toVoltage(v0)) / 0.625 * 150.0;

        Serial.printf("V0 = %d (%f)\tV1 = %d (%f)\t%f A\t",
            v0, ads.toVoltage(v0), v1, ads.toVoltage(v1), a);
        v0 = 0;
        v1 = 0;
#endif
        // Set Gain at 4
        ads.setGain(4);
        v01 /= cnt;
        float f01 = ads.toVoltage(v01);
        float b = f01 / 0.625 * 150.0;
        Serial.printf("V01 = %d (%f)\t%f A\n",
            v01, ads.toVoltage(v01), b);
        v01 = 0;
        cnt = 0;
        t0 = t;
    }
}

Sample Output at 0A and at ~7A

13:21:56.962 -> [161]	V0 = 19983 (2.497952)	V1 = 19978 (2.497326)	-0.150032 A	V01 = 12 (0.000375)	0.090003 A
13:21:57.941 -> [161]	V0 = 19982 (2.497826)	V1 = 19977 (2.497201)	-0.149975 A	V01 = 12 (0.000375)	0.090003 A
13:21:58.965 -> [161]	V0 = 19981 (2.497701)	V1 = 19976 (2.497077)	-0.149975 A	V01 = 12 (0.000375)	0.090003 A
13:21:59.939 -> [161]	V0 = 19983 (2.497952)	V1 = 19977 (2.497201)	-0.180016 A	V01 = 11 (0.000344)	0.082503 A
13:22:00.959 -> [161]	V0 = 19982 (2.497826)	V1 = 19978 (2.497326)	-0.119991 A	V01 = 12 (0.000375)	0.090003 A
13:22:01.985 -> [161]	V0 = 19982 (2.497826)	V1 = 19978 (2.497326)	-0.119991 A	V01 = 12 (0.000375)	0.090003 A
13:22:02.963 -> [161]	V0 = 19720 (2.465075)	V1 = 19978 (2.497326)	7.740211 A	V01 = -1047 (-0.032720)	-7.852740 A
13:22:03.985 -> [161]	V0 = 19882 (2.485326)	V1 = 19978 (2.497326)	2.880077 A	V01 = -390 (-0.012188)	-2.925089 A
13:22:04.959 -> [161]	V0 = 19803 (2.475451)	V1 = 19977 (2.497201)	5.220165 A	V01 = -702 (-0.021938)	-5.265161 A
13:22:05.986 -> [161]	V0 = 19747 (2.468451)	V1 = 19976 (2.497077)	6.870232 A	V01 = -923 (-0.028845)	-6.922712 A
13:22:06.963 -> [161]	V0 = 19744 (2.468076)	V1 = 19977 (2.497201)	6.990223 A	V01 = -936 (-0.029251)	-7.020215 A
13:22:07.986 -> [161]	V0 = 19746 (2.468325)	V1 = 19978 (2.497326)	6.960239 A	V01 = -935 (-0.029220)	-7.012714 A
13:22:08.964 -> [161]	V0 = 19745 (2.468200)	V1 = 19977 (2.497201)	6.960239 A	V01 = -933 (-0.029157)	-6.997714 A
13:22:09.986 -> [161]	V0 = 19745 (2.468200)	V1 = 19977 (2.497201)	6.960239 A	V01 = -931 (-0.029095)	-6.982714 A

 

The test program performing all of these steps is able to take 161 (3 readings) per second for each line item in the output.  When just doing the differential, it can do 330 readings per second for each line item.

 

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1959
 

Hi @inq,

   Just getting round to looking at the forum at past the end of my day, so my grey cell has switched offf, and the Serial Monitor output picture has the right side chopped off, but a first glance at your comments, etc it looks like:

  1. In single ended mode, as expected Vref is fixed at about 2.5V and Vout is a small deviation from Vref, when there is a small current flowing.
  2. the differential mode is working as expected, and making better use of the A/D

Of course, just because the resolution corresponds to 7.5mA/bit, don't imagine it is precisely accurate to about 10mA, because the gain of the amplifier, calibration of Hall Effect probe, etc will all be inducing scaling errors, but with a Sigma/Delta converter, providing the input signal isn't polluted with pickup of electrical noise, etc, (look out for pseudo random or cycling changes in consecutive readings, when the load is constant), and the temperature is stable so that the electronic components are not drifting, then it should be pretty good at indicating any real changes of current with time.

------

Hopefully, this is the basis of the system you intended. You will need a second ADS1115 to cope with 4 systems, but the data sheet description looked pretty straightforward.

The circuit example shows the wiring for up to 4 ADS1115s on page 31 of the TI data sheet I referenced. Note that the ADDR pin chooses which I2C addresses an individual ADS1115 device responds to.

If you only use 2 ADS1115s, to provide 4 current measurements, then putting the ADDR pin on one ADS1115 to Vdd, and the ADDR pin to Gnd on the other will be sufficient. This method is quite common with I2C chips.

However, the chip designer sneaked in two further choices to connect the ADDR pin to, namely SDL and SDA, with each chip realising which of the 4 choices its ADDR pin is attached to ... this devious little trick is shown in the example schematic, but maybe not so obvious from the text alone!

-------

So good luck with the next phase of your project. Please continue to keep the forum informed.

Best wishes, Dave


   
Wezwolf reacted
ReplyQuote