Monday, 24 September 2012

Week 9 (Final Semester)

Title: Drilling


Objective:


  • To make a hole on PCB for the component to fit in
  • To master the skill  on drilling the PCB

Content:

Drill size is important to make correct holes for the correct electronic components. Difference components have difference size of leads and hence need difference pad sizes and hole. Following figure shows the difference size of drill bits and following table shows the functions of each bit. 



Difference size of drill bits and their functions. 




Analysis:

There are certain things must be considered while drilling. The most importance thing is make sure the drill bits did not cuts the diagram on the PCB. It may unconnected the circuit of PCB. And make sure the size of the drill bits is proportional for the functions just like on the table.

Conclusion:

If the drill accidentally damage the diagram on the circuit, the circuit must be fix with the soldering iron to connect back what the damage that has been done. After successfully finish the drilling, the next thing to do is to track checking and soldering the component. 

Monday, 17 September 2012

Week 8 (Final Semester)

Title: PCB fabrication

Objective:


  • To copy the diagram of the circuit on the PCB
  • To master on how to fabric the PCB

Content:

PCB fabrication
1.    PCB Drawing: PCB drawing is designed using Protel DXP 2005. Once the PCB layout has been correctly design, it is now prints out the layout on the A4 size transparent OHP paper. Note that, two types of printers are allowed to print the PCB layout, one is laser printer and the other is carbon type of printer such as Photostat machine. Inkjet and dot matrix type of printer will not work.

2.    Prepare tools required:
þ Fluorescent light
þ UV PCB
þ Marker Pen
þ Blade
þ OHP transparent paper
þ Iron (III) chloride, FeCl3 acid
þ Clean water
þ Thinner
þ Plastic Container
þ Laser printer
þ PCB cutter and trimmer
þ Soldering gun
þ Soldering lead

3.    PCB Cutting: Cut photo PCB size according to the film size.

4.    PCB Photo Etching: Expose the photo PCB in photo etching kit for 8-10minutes.

5.    PCB Developing: Wash the PCB using PCB developer (white powder) for 2 min.

6.    Acid Etching: Etching is a process that removes materials from such us unwanted copper from the PCB surface to achieve circuit design requirements. The etching process used in this project is called chemical etch or pattern etch.
Once the image printed on PCB copper board, now prepare the iron (III) chloride, FeCl3 solution and ready to do the etching. Add in hot water (80C) and shake the water until you see unused part is ‘washed’ and left only the tracks. The etching process takes around 30 min.
 

7.    Thinner Washing:
This is a process to remove the black ink on the PCB board. The black ink has to remove in order to solder the components. The green coating on PCB can be removed by alcoholic solution and leaving only the PCB trace. After remove the black ink, the PCB is then send for cleaning using normal water.



Analysis:

This project has two circuit, the circuit can do at the same time at the step acid etching and thinner washing to elude the waste. The acid etching is quite dangerous task, so must take safety precaution while doing it such as wearing a glove to cover the hand and the mask to evade from smelling the acid. If the route of the diagram is accidently  cut off, use the soldering iron to connect it back.

Conclusion:

This part of task is really important because the circuit is the heart of the project to operate. Without the circuit, the project cannot operate. After the fabrication is finish, the next thing to for the next week is drilling

Monday, 10 September 2012

Week 7 (Final Semester)

Title: Burn the program into PIC

Objective:


  • To download the PIC program to PIC microcontroller
  • To master the step

Content:

Step to download the PIC program to PIC microcontroller

1.    Connect PIC programmer to computer via serial port / USB port.
2.    Insert PIC into the programmer socket

3.   Copy ‘Winpic800’ folder to Desktop.
4.    Look for Winpic800.exe in the folder.


 5. Double click Winpic800.exe to start the program.

6. Select the proper PIC name in the top right combo box

7.   Open the .hex file which you want to download into PIC e.g. if your .c filename is ‘abc.c’,    suppose you need to download ‘abc.hex’ into PIC.


Analysis:

For this project there are two PIC need to be burn. Even they are different PIC, the way to download the program on it still the same. 

Conclusion:

The step of downloading the PIC program to PIC microcontroller must be follow, or it will lead to another problem such as PIC dysfunction or even broken PIC. So, it must be done with care.









Monday, 3 September 2012

Week 6 (Final Semester)

Title: Testing the components

Objective:


  • To evaluate whether the component function or dysfunction
  • To evade any major problem related to the component 


Content:

For this week certain component were tested whether it got problem or not. Not all the test are recorded but here one of the component is being test

This is the video where the lock mechanism is being test. By using 12 volt battery the lock mechanism work fine, there is no dysfunction from this component.


Analysis:

Not all the component can test directly like PIC, it need to be burn and see the PIC work fine or has the problem working. So all that can do is just hoping the component like PIC works fine after the burning.


Conclusion:

This part of task is important to evade any major problem afterwards. This is the safety precaution that need to be take. Finish with this task, the next week will begin to burning the PIC 

Monday, 27 August 2012

Week 5 (Final Semester)

Title : Buying the component

Objective:


  • To buy the components for the project
  • To discover the suitable place to buy the components

Content:

This project mainly have two parts, which is the transmitter circuit parts and the receiver circuit parts. After write down all the components that need to be bought for the project, the Bizchip company has been chose as a components dealer because of the price and transportation. These are the components that has been bought from the dealer

For transmitter circuit



For receiver circuit


and the additional of remote control car and the lock mechanism that not including on the list.

Analysis:

There are discount that has been given from the dealer because of buying huge numbers of components. And the PIC and the RF sensor has two month warranty if there is some dysfunctional on these components

Conclusion:

All the component has been bought, the next step is to testing the component to make sure the component function.

Monday, 20 August 2012

Week 4 (Final Semester)

Title: Program designing

Objective:


  • To design a program proportional with the flow chart of the project
  • To master C compiler software
  • To master C language

Content:

PCWH C-Compiler Software

PCWH powerful C-Compiler that developed by CCS Co. USA. The software is designed mainly for 8 bit chip microcontroller embedded system. It supports a wide range of PIC micro-controllers, including PIC10, PIC12, PIC14, PIC16, and PIC18. The software also has broad library functions at which programmer can access.
In general, the PCWH C-Compiler allows user:
  • Write the C code using advanced code editor.
  • By using "include" function, accessing or processing of code become even faster.
  • Control the execution of the program at which the "error" will be reported when bugs are detected.
  • Samples of program also provided in the helps file.


            To used the software creating a project, make sure a copy of PCWH available in the computer. User can download a 30 days trial copy from http://ccsinfo.com/ccsfreedemo.php. Follow steps by steps on the instruction during installation process and finally user will see an icon of PCWH appears on the desktop of the computer.

Steps to use PCWH C-Compiler

1.    Open PCW C-Compiler Start->All Programs->PIC-C->PIC C Compiler.
2.    ‘File’ -> ‘New’ to start a new file.
3.    Save the file as .c file, it is advisable to put the main file name within 8 chars length, extended file name must be .c, e.g. myprog1.c.
4.    Type / Edit your program.
5.    Save program before compile.
6.    Compile your program using F9.
7.    If any error occurs, please check your program and compile again. Otherwise you won’t get your .hex file.

    
For the project, by using this software, there are two program need to be design which is for the transmitter and the receiver. These two programs are necessary to make sure the project function smoothly. After countless trial and compiling, finally the programs works and ready to use.

Program for transmitter (PIC 16F876A)

#include <16f876A.h>       //use pic16f876a library
#use delay(clock=20000000) //set pic clock speed as 20mhz
#use rs232(baud=4800,xmit=PIN_C6,rcv=PIN_C7,PARITY=N) //set serial interfacing
#fuses hs,protect,nowdt,nolvp //default setting

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

void main()
{
   int i=0;

   //set i/o for each pin
   set_tris_a(0b00000000); 
   set_tris_b(0b00000000); 
   set_tris_c(0b10000000); 

   output_high(pin_c2); //on led
   delay_ms(1000);
   output_low(pin_c2);  //off led
   delay_ms(1000);

   do
   {
      output_high(pin_c2); //on led

      //send data out
      for(i=0;i<10;i++)
      {
         putc('(');
         putc('1');
         putc(')');
         delay_ms(10);
      }

      output_low(pin_c2);  //off led
      delay_ms(3000);

   }while(1);
}

Program for receiver (PIC 16F877A)

#include <16f877A.h> //use pic16f877a
#use delay(clock=20000000) //set pic speed 20mhz
#fuses hs,noprotect,nowdt,nolvp  //default setting
#use rs232(baud=4800, xmit=PIN_C6, rcv=PIN_C7, parity=N) //set serial interfacing

#byte PORTA=5 
#byte PORTB=6 
#byte PORTC=7 
#byte PORTD=8 
#byte PORTE=9 

int rx_temp1=0;
int rx_temp3=0;
int rcvdata;
int mystat=0;

//receive data from transmitter
#int_rda
void serial_isr()
{
   rx_temp1=getch();
   if(rx_temp1=='(')
   {
      rcvdata=getc();
      rx_temp3=getch();
      if(rx_temp3==')')
      {
         mystat=1;
      }
   }

   rx_temp1=0;
   rx_temp3=0;

}

void main()
{
   int id1sta=0;
   int id1count=0;

   set_tris_a(0b00000000);    //set i/o pin for port a
   set_tris_b(0b00000000);    //set i/o pin for port b
   set_tris_c(0b10011000);    //set i/o pin for port c
   set_tris_d(0b00000110);    //set i/o pin for port d
   set_tris_e(0b00000000);    //set i/o pin for port e

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

   output_low(pin_d5);  //stop motor1
   output_low(pin_d4);  //stop motor2
   output_low(pin_c5);  //lock door
   output_high(pin_c0);  //on blue led
   output_high(pin_c1);  //on white led1
   output_high(pin_c2);  //on white led2
   delay_ms(1000);
   output_low(pin_c0);  //off blue led
   output_low(pin_c1);  //off white led1
   output_low(pin_c2);  //off white led2
   delay_ms(1000);

   do
   {
      //if RF receiver received valid data
      if(mystat==1)
      {
         mystat=0;
         if(rcvdata=='1')  //if '1' received
         {
            id1sta=1;
            id1count=0;            
         }
      }
      else
      {
         if(id1count<6)    //if transmitter lost less than 3sec
         {
            id1count=id1count+1; //increase timer
         }
         else  //if 3sec reached
         {
            id1sta=0;            
         }
      }

      if(id1sta==1)  //if transmitter in range
      {
         output_high(pin_c5);  //unlock door

         output_high(pin_c0);  //on blue led
         delay_ms(250);
         output_low(pin_c0);   //off blue led
         delay_ms(250);

         if(input(pin_d1)==0) //if on white led button pressed
         {
            output_high(pin_c1);  //on white led1
            output_high(pin_c2);  //on white led2         
         }
         if(input(pin_d3)==0) //if off white led button pressed
         {
            output_low(pin_c1);  //off white led1
            output_low(pin_c2);  //off white led2               
         }

         if(input(pin_d2)==0) //if on motor button pressed
         {
            output_high(pin_d5);  //run motor1
            output_high(pin_d4);  //run motor2
         }
         if(input(pin_c4)==0) //if off motor button pressed
         {
            output_low(pin_d5);  //stop motor1
            output_low(pin_d4);  //stop motor2
         }
      }
      else  //if transmitter out of range
      {
         output_low(pin_c1);  //off white led1
         output_low(pin_c2);  //off white led2                     
         output_low(pin_c5);  //lock door
         output_low(pin_d5);  //stop motor1
         output_low(pin_d4);  //stop motor2
      }     

      delay_ms(500);
      
   }while(1);
}


Analysis:

The program on receiver circuit are longer than the program on the transmitter circuit because the transmitter job is only send a signal to the receiver when the transmitter is on the range, while the receiver  circuit do all the works such as running the motor, switch, led's.

Conclusion:

There are numbers of the software that can be use to design a program. C compiler has been use is because this software is quite simple and easy to use. And with program and circuit is already design, purchasing the component will be the next step of the project






Monday, 13 August 2012

Week 3 (Final Semester)

Title: Circuit design

Objective:

  • To master the PROTEL DXP software
  • To design circuit for the project
  • Testing the circuit by simulation


Content:

After several error had been corrected, finally the final circuit for the Automatic Car Lock/Unlock system has been ready to fabric. Because of the RF sensor has two main part, which is the transmitter and the receiver, so the circuit also split to two. This is the two circuit before it convert for PCB fabrication

Transmitter circuit

Normal circuit



Convert for fabrication

-Components
 -Pins

-components and pins



Receiver ciruit

-Normal circuit


-Components


-Pins


-Components and Pins



Analysis:

While design this circuit, the lay out must be as simpler as it can and the lay out must must below 90 degrees at the corner. If not the circuit will have some error when operate. The name and the ID number on the lay out is to keep the originality as a designer.


Conclusion:

With the circuit lay out is finish, next week will begin purchasing the components and the hardware of the project