Design Project Report
Design Project Report
Design Project Report
For an electric vehicle, we need to monitor the voltage and current in real time. Design a
digital voltage and current sensor. Assume that this circuit should sit close to the motor
(Hint: need to sustain temperature of up to 110 deg c and should be small in size). This
circuit should measure voltage up to 48V with precision better than 10mV. And the
maximum power of motor is 750W. To enable interfacing of this with processor, the ADCs/
sensor should support I2C protocol. Design the relevant circuits including proper part
numbers and values.
INTRODUCTION:
Precise voltage and current measurements in the case of electric motors is the most
essential thing for implementation of motor control systems. It can be implemented
successfully by the use of sensor circuits besides Arduino or Micro controller. Sensors are
the electronic devices that sense current, voltage, etc. and provide signals to the inputs of
control devices or visual displays. Electrical sensors often rely on Hall Effect detection but
other methods are used as well. These sensors are also required in many other applications
like switching mode power converters, safety circuits, currents sources, supervisory circuits
and many other applications.
Basic voltage and current measuring sensor circuits using Arduino UNO:
Measuring DC voltage with a microcontroller or any digital data device requires the use of
an Analog to Digital converter (ADC). Many microcontrollers, like Arduino UNO have an in
built ADC, makes the measurement of voltage and current a bit easy.
Voltage measurement: the voltage divider is a circuit used to create a voltage less than or
equal to the input voltage. The two resistor voltage divider is one of the most common and
useful circuit. The primary purpose of this circuit is to scale down the input voltage to lower
value based on the ratio of the two resistors.
Where:
#define ANALOG_IN_PIN A0
float adc_voltage = 0.0;
float in_voltage = 0.0;
float R1 = 40000.0;
float R2 = 4500.0;
float ref_voltage = 4.096;
int adc_value =0;
void setup() {
analog reference(EXTERNAL);
Serial.begin(9600);
Serial.println(“DC Voltage Test”);
}
Void loop() {
adc_value = analogRead(ANALOG_IN_PIN);
adc_voltage = (adc_value * ref voltage)/ 1024.0;
in voltage = adc_ voltage / (R2/(R1+R2));
Serial.print(“Input Voltage = ”);
Serial.Printin(in_voltage, 2);
dealy(500);
}
Current measurement: ACS712 Hall effect sensor can be used with both DC and AC current,
this device operates on a 5 volt power supply and outputs a voltage proportional to the
current it is measuring. The input connection is isolated from the output, making it safe to
use for high voltage applications.
In the above circuit the sensor can be set to measure 20 Amperes of current. ACS712 gives
an output voltage of 2.5 volts when there is no current is detected or no current flowing
through it. The scale factor for this sensor will be 100mV/Ampere.
Whenever current is detected by the circuit then the equivalent voltage is given to the adc
and it is again the voltage is converted into current by the Arduino and displayed on LCD
display.
Program for Arduino operation:
double Vout = 0;
double Current = 0;
const double scale_factor = 0.1;
const double Vref = 5.00;
const double resConvert=1024;
double resADC=vRef/resConvert;
double zeroPoint=vRef/2;
void setup( ){
serial.begin(9600);
}
Void loop ( ){
For (int i =0;i < 1000; i++ ) {
Vout=(vout + (resADC *analog Read( Ao ) ) );
delay( 1 );
}
Vout=vout /1000;
Current=(vout - zeroPoint)/ scale_factor;
Serial.print(“vout= ”)
Serial.print(vout,2);
Serial.print(“ volts”);
Serial.print(“\t Current = ”);
Serial.print(current,2);
Serial.println(“ Amps”);
delay(1000);
}
Draw backs of voltage and current measurement using Voltage Divider & Hall Effect current
sensor are the accuracy of measurement is not much high, as long as the voltage fed to
Arduino is in between 4.75V to 5.25V the Arduino circuit will work properly but that much
variation in voltage can affect the accuracy of analog to digital converter when its is used as
reference to the circuit.
By using current sensor which converts the current flowing to voltage may not give that
much precise value because the conversion of voltage to current is mainly based on the
value of scale factor of the circuit.
Voltage and current sensing using INA236:
Features:
• Current monitoring accuracy: 16-bit ADC resolution – 0.1% gain error (maximum) – 5 µV
offset (maximum)
The easiest way to measure the current is to insert in the test system supply rail, a resistor
of a small value. The current passing through the resistor produces a slight voltage drop in
accordance with Ohm’s law: VSENSE = RSHUNT * ILOAD. In most cases, voltage drop is too small to
be directly used for further processing. Therefore, it is often required to use some
amplification. Here the shunt resistor is grounded at one side, so that we can use simple
operational amplifier in non-inverting configuration in order to amplify small voltage drop
proportional to the measured current (it should be also mention that non inverting
configuration is in this case the only one solution – we assume that we have a single power
supply voltage, and we want to reduce the impact of shunt input amplifier resistance on
current measurement).
This has some major drawbacks that cannot be ignored. The first one results from the
presence of voltage drop between the ground and tested system. Consequently, the ground
of the system is at non zero potential (at floating potential if the current is variable in time).
This can cause incorrect work especially of analog circuits, where the output of the amplifier
is taken with respect to ground. Another important drawback is the inability to detect a
short circuit in the system under test. If such a condition occurs, the short-circuit current
flow from the power supply voltage through the test system to the ground. No current will
pass through measuring resistor, so this circuit will not even notice a serious failure in the
system.
The second approach without the disadvantages of the previous method is to place shunt
resistor at the side of power supply voltage. In this case the system under test is at a
constant ground potential. This does not disturb proper work of even sensitive analog
circuits. Also, the possible fault short circuit to ground current will flow through the
measuring resistor, which will be immediately noticed by the supervisor circuit.
In this system however, there is significant drawback. While in previous method the
measuring resistor was grounded at one side, here both ends of the shunt resistor are at the
potential close to the supply voltage (supply voltage can be high in case of power electronic
systems, motors, etc.). This creates two serious problems. Firstly, it becomes necessary to
use differential amplifier. Secondly, this amplifier must accept high common mode voltage
at their inputs.
Internal block diagram of INA236:
1. Integrated Analog-to-Digital Convertor (ADC): The INA236 integrates a low offset 16-
bit delta-sigma (ΔΣ) ADC. This ADC is multiplexed to process both the shunt voltage
and bus voltage measurements. Bus voltage measurements are made with respect
to IN and GND. The shunt voltage measurement is a differential measurement of the
voltage developed when the load current flows through a shunt resistor as measured
between the IN+ and IN– pins. The shunt voltage measurement has an maximum
offset voltage of only 5 µV and a maximum gain error of 0.1%. The low offset voltage
of the shunt voltage measurement allows for increased accuracy at light load
conditions for a given shunt resistor value. Another advantage of low offset is the
ability to sense a lower voltage drop across the sense resistor accurately, thus
allowing for a lower-value shunt resistor. Lower-value shunt resistors reduce power
loss in the current-sense circuit and help improve the power efficiency of the end
application.
2. Power Calculation: the current and power are calculated after a shunt voltage and
bus voltage measurement. Power is calculated based on the previous current
calculation and the latest bus voltage measurement. If the value loaded into the
calibration register is zero, the power value reported is also zero. The current and
power values are considered intermediate results and are stored in an internal
register. Following every measured sample, the newly-calculated values for current
and power are appended to this accumulation register until all of the samples have
been measured and averaged.
3. Low Bias Current: When performing a current measurement, the INA236 features
very low input bias current which provides several benefits. The low input bias
current of the INA236 reduces the current consumed by the device in both active
and shutdown state. Another benefit of low bias current is that it allows the use of
input filters to reject high-frequency noise before the signal is converted to digital
data. In traditional digital current-sense monitors, the addition of input filters comes
at the cost of reduced accuracy. However, as a result of the low bias current, the
reduction in accuracy due to input filters is minimized.
In measurement of voltage and current using INA236 circuit initially the voltage is given to
Analog to Digital converter by low voltage side shunt or high voltage side shunt there it is
converted to digital form then by using voltage register the voltage is measured and then it
is fed to I2C SMBus compatible interface, finally the measured signal is given to Arduino by
SDA, SCL pins, from there the measured value will be displayed on LCD display which is
connected with Arduino.
Circuit calculations:
The shunt voltage stores the circuit shunt voltage reading. The output data can be
converted directly into voltage by multiplying digital values by its resolution size.
The term current LSB is the chosen LSB step size for the current register when the current is
stored.
The minimum value of current LSB is based on maximum expected current and it directly
defines the maximum resolution of current register.
RSHUNT is the value of resistance value of external shunt used to develop differential voltage
across IN+ and IN- pins.
Current register: High accuracy, Low temperature coefficient, surge protection, low power
consumption, ramp generation temperature sensing.
Current register is used to calculate the current from input voltage and shunt resistor values
(VINPUT/RSHUNT).
Conclusion: Finally I conclude that current and voltage measurement using INA236 has
several advantages as compared with basic method of measurement of voltage and current
because its accuracy is more and the value is measured precisely as compared with basic
method of measurement. By using both the methods the measurement of 48V and 15A
(assumed motor power is 750W so the current will be equal to (750W/48V)) is possible but
the construction is simple in case of basic measurement circuit whereas as efficient working
condition is possible with INA236 measurement circuit.
Submitted by,
21335A0230,
Group – 14,
EEE 2nd year,
B section,
MVGR CE.