Saturday, August 11, 2018

WEEK 4 (FYP 2)


Activity: Hardware Parts

So, i have purchased the component needed from electronics online shopping and some in Jalan Pasar, Kuala Lumpur. 



the electronics shop

online shopping 




Mostly i founds all the the component that needed for my project except for the mask. i plan to use a plastic glass first as a mask.

So,  i need to start the project based on the simulation .





Activity: Study the Simulation and Coding


First of all, he want to see the circuit diagram that have been construct  based on the simulation that has been done in order to start the hardware project. Then he want us to searching and understand the coding for the project and try it.

After done some research about the coding, i found a coding to measure a temperature. The coding for this circuit also has been done by do some study in the Arduino website. This is because, to measure the respiration rate via temperature sensor, we need to measure the temperature first. So, the connection for the temperature sensor have been done in Proteus using 100k NTC thermistor. The circuit is function well as we increased the temperature sensor, the temperature displayed in the LCD also increase. 

This is the connection that i have been done in Proteus 8.



The connection of the temperature measurement


When the 100k NTC thermistor was set 25 Celcius, the temperature measurement is 24.53 Celcius


The coding use when run the program was:

#include <LiquidCrystal.h>
int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
}
void loop() {
Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
T = T - 273.15;
T = (T * 9.0)/ 5.0 + 32.0;
lcd.print("Temp = ");
lcd.print(T);
lcd.print(" F");

delay(500);
lcd.clear();
}




Activity: Testing the construct circuit.

Since the thermistor is a variable resistor, we’ll need to measure the resistance before we can calculate the temperature. However, the Arduino can’t measure resistance directly, it can only measure voltage.


The Arduino will measure the voltage at a point between the thermistor and a known resistor. This is known as a voltage divider. The equation for a voltage divider is:
V_{out}=V_{in} \times (\frac{R2}{R1+R2})
In terms of the voltage divider in a thermistor circuit, the variables in the equation above are:
V_{out}: \ Voltage \ between \ thermistor \ and \ known \ resistor\\  V_{in}: \ V_{cc}, \ i.e. \ 5V\\  R1: \ Known \ resistor \ value \\  R2: \ Resistance \ of \ thermistor
This equation can be rearranged and simplified to solve for R2, the resistance of the thermistor:

R2= R1 \times (\frac{V_{in}}{V_{out}} - 1)
After done construct the circuit diagram, i test the function of the temperature sensor. The sensor can detect same as in the simulation. So this is the circuit. 


The testing to measure temperature

Plastic glass a mas and power bank as a power supply


After testing, i meet my supervisor to shown my little progress of the temperature sensor measured. The temperature measurement have been test with him. It work but the temperature not very accurate because we are doing this under cold temperature which is in their office.



No comments:

Post a Comment