Direct current measurement - Arduino

14/08/2020

Today I will present some available sensors for Arduino that can be used in projects for measuring direct current. This means with a nominal supply voltage of 5V with a max. 5V output.

Current measurement

ACS712

The ACS712 sensor, also referred to as ACS712ELC-XXA - XX, indicates the value of amers, can be used to measure direct current (including alternating current). The sensor uses a hall sensor to measure the flowing current.

Versions for 5A, 20A, 30A are available. For all versions, the nominal output voltage is 2.5V at 0A. The sensor has an analog output with a range of 0 to 5V.

Module 5A 20A 30A

Supply voltage (Vcc) 5V 5V 5V

Measuring range -5 to + 5A -20 to 20A -30 to 30A

Voltage at 0A Vcc / 2 -> 2.5V Vcc / 2 -> 2.5V Vcc / 2 -> 2.5V

Unit step 185mV / A 100mV / A 66mV / A

Chip designation ACS712ELC-05A ACS712ELC-20A ACS712ELC-30A

The module contains a terminal block for connecting a conductor through which current flows in series. The module does not contain a hole for mounting a PCB. There are versions from other manufacturers that also include mounting holes, but the price is higher.

INA219
Another popular current sensor is the INA219. The sensor works on the I2C bus and can be used to measure direct current, even symmetrical. Maximum current range 0 to + -3.2A at voltage up to + -26V. The sensor measures a voltage drop of 0.1ohm on the principle of voltage drop. The advantage is the possibility of using several modes, while it is possible to reduce the parameters of voltage and current range, which can dynamically increase the resolution of the measurement

.

The best resolution has the third mode, which works at 16V, 400mA with a resolution of 0.1mA. The sensor also contains areas A0, A1 on the PCB, which can be soldered, which can emulate another address, it is suitable in case of using several sensors with one Arduino, which eliminates the need to use an I2C multiplexer. The advantage is simple addressing on the I2C bus. In total, up to 4 INA219 sensors can be operated. The base address is 0x40, with area A0 0x41, with area A1 0x44, with areas A0 and A1 0x45.

INA3221
Another available I2C sensor from the INA family is a module equipped with an INA3221 chip, which allows, in addition to current measurement, also voltage measurement - but not until next. The module is equipped with up to three channels on which it is possible to measure current. A power supply for these three channels is also connected to the module, on which we will perform measurements, the power supply range is 0-26V. The measurement is again based on the principle of voltage drop across the shunt, where the measurable current is limited to 1.1A. The supply voltage of the module is 2.7 to

5.5V.

A huge advantage of the module with the INA3221 chip is its consumption at the level of 350μA. Suitable for battery-operated applications. On the other hand, the disadvantage is that the module is supplied without terminal blocks for CH 1 to 3 channels and power supply connection. The module is also equipped with surfaces A0, A1, so it is again possible to emulate up to 4 modules on one I2C bus. The individual CH channels contain the CH and GND terminals. This means that the appliance on which the voltage is measured is connected to the module in parallel - as a voltmeter, not in series as for an ammeter.

WCS1700
For non-invasive measurement method, it is also possible to use current sensors with a hall sensor, for example WCS1700, which can be used for both direct and alternating current. In addition to the analog output, the sensor also contains a digital output, which can be set with a potentiometer - trimmer. In a particular application, it can serve as an identifier of exceeding a certain current limit

.

In the software implementation, the sensor must be calibrated. The calibration value can be obtained by reading the values ​​from the sensor empty to reach a value of 0mV. Based on the measured analog value from the analog output of the sensor, this value can be converted to millivolts, for example by a map function from 0-1023 (ADC) to 0-5000mV and then converted to amperes in 32mV / A steps. Interesting are the current values ​​that can be measured. For direct current, the measuring range is 0 to + -70A. As the ADC converter with a range of 0-1023 for measuring current up to 70A is small, the measurements with this sensor are rather indicative.

For more accurate measurements from individual sensors, it is possible to sample measurements and average them. When using these sensors with voltage sensors, it is also possible to calculate the power of the appliance.

Overview of projects implemented by me: https://arduino.php5.sk

Use in applications:

  • Measuring the current of appliances connected to the battery
  • Measuring current from a solar panel
  • Current measurement from MPPT controller
  • Current measurement in electronics, modules and other sensors

Example of visualization in the final application:

© 2021 Martin Chlebovec - Arduino Blog - . All rights reserved
Powered by Webnode Cookies
Create your website for free! This website was made with Webnode. Create your own for free today! Get started