Dear all,
I am using two sensor
- LM 35 sensor
- Hallsensor
Reference voltage 5v . Intially i tried code with 5v where i found LM 35 temprature sensor keep deviating output. When i check calibration process
as taking 1.1v The output of sensor get stabilized. But hallsensor reads 0A .
Can some one suggest me what exactly happening.
below code i get stabilized out for temperature sensor. if i uncheck internal voltage(use 5v as reference) keep fluctuating but i read hall sensor value properly.
float temp;
static int temp_int;
int temprature_reading;
float voltage=0.0;
float ANALOG_SCALING=0.004887585532746823;
int Current;
int Current_Reading;
int Take_Temp_Reading()
{
temp = float(analogRead(A5)) * 110 / 1024.0;
temp_int=(int)(temp*100.0);
return(temp_int);
// Serial.print("Temp"); Serial.println(temp);
}
int Hall_Sensor_Reading()
{
int val = analogRead(analogPin);
voltage=val*ANALOG_SCALING;
current=(int) ((voltage*12.5)-31.25);
return(current);
}
void setup()
{
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop()
{
temprature_reading=Take_Temp_Reading();
Serial.print("temprature_reading:");
Serial.println(temprature_reading);
Current_Reading=Hall_Sensor_Reading();
Serial.print("Current_Reading:");
Serial.println(Current_Reading);
Serial.println(".....................................");
delay(1000);
}