Saturday, April 24, 2010

Preparing for the final draft and hardcover report

Preparing the final draft that include all 5 chapter from the beginning. After get the approval from the supervisor, the hardcover will be made. The hardcover must do 2 copies. One for the FYP committee and the other one is for my self. For my supervisor, he only want a softcopy. So I need to burn it to the cd using pdf format.

Monday, April 19, 2010

viva..

Demo day that been held on 12th April 2010 at Multipurpose Hall with all degree final semester student. Each student get 2 accessors to access them.. Below is some of the situation in the hall and my prototype..









Picture below is my prototype that I do by using the A4 box and for the decoration I using the recycle paper and calendar.


















Monday, April 5, 2010

Finalize the Circuit and Prototype

The circuit is almost done, so need to finalize it and do the prototype.. My prototype is most likely a living room part that have light and bulb. The prototype is done by using the A4 box and some colour paper and recycle calendar.

Wednesday, March 31, 2010

Do the PCB fabrication and Drilling process

Even though I already make the circuit using the strip board, the circuit cannot be function as usual.. The light cannot be dim.. It can only on and off.. So, I decided to try to do the circuit using PCB and test whether the circuit can work as planned or not..

And this is a few step in etching and drilling the board..


This is the PCB UV board when we open the cover of the board


The circuit is printed by using laser jet printer on the transparency paper. The circuit is tab on the UV board an seal it with the tape but make sure the tape doesn't cover the circuit..


Put the UV board that already tab with the transparency into the UV box to print the circuit by using the UV technology on the board.


This box is to remove the green layer of the board and only left the layer of the circuit.. To make this box function, need to put the circuit inside the net given and push both green button on the left of this box..


After about 3 minutes, take it out from the box and the result you can see as in the picture above..


Then wash the circuit using a water to make sure that the chemical from the box is totally removed..


Place the board to the etching net carefully and make sure that it not cover the circuit that printed on the board..


Place the board inside the etching box and close the cover of the etching machine..


Set the etching machine to 5 minutes and press the yellow button for start the machine.. Then wait for 5 minutes.. But please make sure that ON the etching machine by switch ON the power supply and push both green button on the machine..


After wait about 5 minutes, the machine will stop and place it out from the etching net and wash it again..


That's the result when the copper are gone..


This me with my circuit.. But there still have one more step.. You need to dip the board into the tinner to remove the green layer.. If not, you cannot solder the component on your board...


Then, the next state, we all go for drilling the PCB to make the hole so that it can place the component on this board.. And for your information, this is my first time in drilling things so I need to read a manual and ask for help in using this drilling device.. hehehe... Its quite fun you know..


This is my picture in drilling the board.. My hand is shaking badly because of the drilling device so I need my friend to hold the PCB..

Monday, March 29, 2010

Program for Receiver

#include <16f877a.h>
#use delay(clock=20000000)
#fuses hs,nowdt,protect
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,PARITY=N)

//initialize port
#byte PORTA=5
#byte PORTB=6
#byte PORTC=7
#byte PORTD=8

int receive1=0;
int receive2=0;
int receive3=0;

//receive data
#int_rda
void serial_isr()
{
receive1=getch();
receive2=getch();
receive3=getch();
}

void main()
{
//set io for pic
set_tris_a(0b11111111);
set_tris_b(0b00000000);
set_tris_c(0b10000000);
set_tris_d(0b00000000);
setup_port_a(NO_ANALOGS);
setup_adc(ADC_CLOCK_INTERNAL);

//set interrupt
enable_interrupts(int_rda);
enable_interrupts(GLOBAL);

//set pwm
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_PWM);
setup_timer_2(T2_DIV_BY_1, 255, 1);

//test output
output_high(pin_d1);
output_high(pin_c4);
set_pwm1_duty(255);
set_pwm2_duty(255);
delay_ms(2000);
output_low(pin_d1);
output_low(pin_c4);
set_pwm1_duty(0);
set_pwm2_duty(0);

do
{
//blink led
output_high(pin_c4);
delay_ms(250);
output_low(pin_c4);
delay_ms(250);

if(receive1=='a') //on relay
{
output_high(pin_d1);
}
else if(receive1=='b') //off relay
{
output_low(pin_d1);
}

set_pwm1_duty(receive2);
set_pwm2_duty(receive3);

}while(1);


}
******************************************
Program above is about to make the fan, light and radio work.. The relay is about to on and off the radio.. while for pwm is to set the signal that will get from the transmitter is going to 255 (higher) and 0 (lower). This is the final program and will be test to the circuit by detect the LED first as an output.

Thursday, March 25, 2010

Suddenly SKXBee cannot be function..

My both SKXbee cannot function at all.. They don't want to communicate to each other.. I need to troubleshoot it? but how? So leave it to keep in view (KIV) for a moment.. So, I will continue in designing the transmitter circuit and program..

Thursday, March 18, 2010

Program for Transmitter

#include <16f877A.h> //use pic16f877A
#device adc=8 //use 8 bit adc function to read temperature
#use delay(clock = 20000000) //clock=20mhz
#fuses hs, noprotect, nowdt //default setting
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,PARITY=N)

#byte PORTA=5 //define PORT A address
#byte PORTB=6 //define PORT B address
#byte PORTC=7 //define PORT C address
#byte PORTD=8 //define PORT d address

void main()
{
int press1, press2;
int txdata1=0;
int txdata2=0;
int txdata3=0;
int myvr1, myvr2;

//set i/o for each pin
set_tris_a(0b11111111);
set_tris_b(0b00000000);
set_tris_c(0b10110000);
set_tris_d(0b00000000);
setup_port_a(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);

//test output
output_high(pin_d2);
delay_ms(1000);
output_low(pin_d2);
delay_ms(1000);

do
{
//if forward button pressed
if(input(pin_c4)==0 && press1==1)
{
txdata1='a';
press1=0;
}
else if(input(pin_c4)==1)
{
press1=1;
}

//if reverse button pressed
if(input(pin_c5)==0 && press2==1)
{
txdata1='b';
press2=0;
}
else if(input(pin_c5)==1)
{
press2=1;
}

set_adc_channel(0);
delay_ms(10);
myvr1=read_adc();
txdata2=myvr1;

set_adc_channel(1);
delay_ms(10);
myvr2=read_adc();
txdata3=myvr2;

if(input(pin_c4)==0 ||input(pin_c5)==0)
{
output_high(pin_d2);
}
else
{
output_low(pin_d2);
}

putc(txdata1);
putc(txdata2);
putc(txdata3);

delay_ms(250);

}while(1);
}
**********************************************
Program above is to another PIC in remote circuit that will transmit the data by using variable resister and push button as an input and LED as an output.. The variable resister is connected to the analog pin at the PIC. So, in the program, it need to setup all Pin A as an analog.. And the PIC will sent data 'a' to make the relay on, and data 'b' to make the relay off.. As for the variable resister, it need a ADC to read the signal and transmit it to another circuit.. And if it success in transmitting the data, each LED will light on as for the testing purpose..