This is my arduino code to measure current and voltage across a circuit on breadboard which is connected to the external mobile battery of 3.8V. I am trying to measure the power consumption.I dont understand why my raw values are not getting converted to proper voltage and current values with correct decimal places. It is rounding up to nearest integer . I am attaching the screenshot of the serial view. please help me out
#include "arduino.h"
const int x=A5;
const int y=A2;
int Rawvalue=0;
int Rawvalue1=0;
float voltage;
float voltage1;
float current;
float power;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Rawvalue=analogRead(x);
voltage=(Rawvalue *5)/1023;
Rawvalue1=analogRead(y);
voltage1=(Rawvalue1*5)/1023;
current=(voltage1/0.20);
Serial.print("Raw value= ");
Serial.println(Rawvalue);
Serial.print("Raw value1=");
Serial.println(Rawvalue1);
Serial.print("voltage= ");
Serial.println(voltage,3);
Serial.print("voltage1= ");
Serial.println(voltage1,3);
Serial.print("current= ");
Serial.println(current,3);
power=(voltage*current);
Serial.print("power=");
Serial.println(power,3);
delay(60000);
}