EEE305 ASSINMENT1 19321037 Mumtahina Tasnim Purno.
EEE305 ASSINMENT1 19321037 Mumtahina Tasnim Purno.
Project Overview
∙ We change Celsius values to Fahrenheit values for this
temperature box experiment
∙ We consider 78.8°F as low temperature and 98.6°F for
high temperature. We note down output voltage for each
1.8 degree Fahrenheit change
∙ We calibrate the LM35 sensor twice and take the average
voltage value for more precise result
Sensor calibration
Data = voltage change with respect to Graph = Voltage vs
temperature Temperature(F)
Temparature (C) Temparatue(F) Voltage(V)
26 78.8 .269
27 80.6 .2785
28 82.4 .2878
29 84.2 .2945
30 86 .301
31 87.8 .306
32 89.6 .3105
33 91.4 .315
34 93.2 .321
35 95 .3268
36 96.8 .331
37 98.6 .3365
LM35 analogue circuit
DS18B20
Scale and Shift Circuit
● Shifting portion inverts the input voltage from a positive value to a negative value
In initial condition relay is in normally close mode. That mean relay will allow
the current to flow and turn the light on.
When the VT > VH relay will switch to normally open mode which will
disconnect the circuit and cause the light to turn off. And when VT < VL relay
will again switch back to normally close mode and the light will turn back on.
Complete circuit with LM35 temperature sensor
When temperature is 28°C i.e. VT<VL<VH and Lamp turns On
When temperature is 32°C i.e. VL<VT<VH and Lamp should remain like its previous state but it becomes
off.
When temperature is 36°C i.e. VL<VH<VT and Lamp become off
Complete circuit using DS18B20 temperature
sensor
Temperature increased but no voltage is generating from
DS18B20
ARDUINO CODE FOR LM35
int sensor = A0, relay = 7, if (temp >=35){
adc_in=0; digitalWrite(relay, LOW);
float temp=0; Serial.println("Relay off");
void setup () { }
Serial.begin(9600); if (temp <=30){
pinMode(relay, OUTPUT); digitalWrite(relay, HIGH);
} Serial.println("Relay on");
void loop() { }
adc_in=analogRead(sensor); delay(1000);
temp=
((adc_in*5000.0)/1023.0)/10.0;
Serial.println(temp);
}
ARDUINO CODE FOR DS18B20
void loop(void)
#include <OneWire.h>
{
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 5
sensors.requestTemperatures();
temp=sensors.getTempCByIndex(0);
OneWire oneWire(ONE_WIRE_BUS);
Serial.println(" C ");
Serial.println(temp);
DallasTemperature sensors(&oneWire); if (temp >=35){
int relay=7; digitalWrite(relay, LOW);
float temp=0; Serial.println("Relay off");
}
void setup(void) if (temp <=30){
{
digitalWrite(relay, HIGH);
Serial.begin(9600);
Serial.println("Relay on");
pinMode(relay,OUTPUT);
}
sensors.begin();
delay(1000);
}
}
Conclusion
● Helps to know about close loop control configuration and feedback
system which can enhance understanding of control course material.