22 July 2007

tested the logic buffer. With a 5.04V input, the output is 8.76V with a 8.76V supply, which provides a larger voltage that could switch on the mosfet completely and may also supply larger current (need to be tested out)

The output of the logic buffer depends on the Vdd supply (information of this needed to be found out or ask roshan where did he see this). When we supply 8,76V, the Vds is close to 0.3V, while when we supply the buffer with 5V, the output is close 0.4V which is slightly higher than 0.3V which might also mean the mosfet is still not fully switched on. So we decided to use the 9V for buffer supply. And in future as the bluetooth needs the 3.3V from the PIC as serial signal, we might have to change the voltage regulator to 3.3V, but this needs to be checked out whether the current PIC16F77 can be used under 3.3V.

The line for rs232 has to be commented out because we are using portC, and its output use the protocol for rs232 will keep the RC6 and RC7 high.

#include <16F77.h>
#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT
#use delay(clock=20000000)
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

long t1, t2;
int cnt;
void calcTemp(){
cnt = 0;
while(input(pin_B4)){;}
while(!input(pin_B4)){;}
while(input(pin_B4)){
cnt = cnt + 1;
delay_ms(1);
}
t1 = cnt;
cnt = 0;
while(!input(pin_B4)){
cnt = cnt + 1;
delay_ms(1);
}
t2 = cnt;
output_d(t1);
output_c(t2);
}
void main()
{

set_tris_d(0x00); //output pins
set_tris_c(0x00);
set_tris_b(0xFF);

output_d(0b00000000);
while(true){
delay_ms(1700);
calcTemp();

}
}

ONI went to the power lab with Roshan, used the oven there. The oven they used can only caliberate for temperature above 30ºc, and the reaction time is very slow (10-15min), with an error of 1-2ºc. We tried for temperature 40ºc, 35ºc, but none of them seem to be very accurate. The method we might be using is to buy a temperature gun, and place the temperature sensor with the heating element. When it is heated up, we will use the temperature gun to point at it to get the temperature and read the PWM wave output from the temperature sensor also. In this way, we might have a much faster way of getting the behavior of the temperature sensor.

The values we tested out with the oven is
1. t1=8.92, t2=17.84ms => temp = 35ºC, when oven temp is 36ºC
2. t1=8.91, t2=17.79ms => temp = 34.66ºC, when oven temp is 35ºC

After taking into consideration if error in temp that the oven has, we think we can just use the behavior of the temperature sensor provided in the datasheet.

page revision: 1, last edited: 31 Jul 2007 08:21