Many electronics circuits and projects for learning in simple ways.

PIC microcontroller led flasher circuit using PIC16F627A

This is microcontroller led flasher circuit using PIC16F627A as first PIC microcontroller learning of mine son. it is basic for really beginner.

Important issue,we have to make The PIC micro controller is easier. Children 8 years old, he does not understand the computer language at all.

My friends say that children should not play computer. He should try to build a lot of real electronic projects. I avoid to teach computer programming. It is difficult and tedious for him.

Thus, We start learning the micro controller with creating the one LED Flasher circuit using PIC16F627A.

It is a very simple circuit. In the past, I’ve recommended his son play Dual LED Flasher. by 2N2907

The circuit diagram
First of all, Assembling the components by the circuit in Figure 1 in to the Bread board, Very few devices. The PIC16F627A is important.

One LED Flasher circuit using PIC16F627A

Figure 1 the circuit diagram

assemble all parts on bread board
Figure 2 assemble all parts on bread board

All Software for PIC microcontroller
We get a pic programmer software CD for USB PIC programmer.
1. Driver for USB PIC Programmer is PICKit 2 Programmer of Microchip
2. mikroC compiler for PIC

We install both software on Windows 7 OS computer.

PIC micro controller programming

Then we will write PIC micro controller on source code (human language), with C complier code. We perform the following steps.

1. Make new folder name : One_LED_Flasher
as Figure 3 for this project only.

make new folder for this project
Figure 3 make new folder for this project

2. Make new project : step by step as Figure 4
(1) Click at new project
(2) Fill in name project
(3) Browse folder of this project
(4) Select Device : PIC16F627A
(5) Set clock : 3.579545 MHz as we use crystal in circuit.
(6) Set Device Flags: to Default
(7) Click OK to finish this step

Setting new project option
Figure 4 Setting new project option

3. Typing simple one LED flasher CODE into a blank board below.

main()
{
TRISB = 0xFE ;
while(1)
{
PORTB = 0x01;
Delay_ms(2000);
PORTB = 0x00;
Delay_ms(2000);
}
}

Typing simple one LED flasher CODE
As Figure 5 Typing simple one LED flasher CODE

4. We will build Project…as Figure 6
(1) Click save all
(2) Then Click Build Project button (Ctrl+F9)
(3) Look at message text as Success

Build Project to get HEX code
Figure 6 Build Project to get HEX code

5. Open the PICKit 2 Programmer to write HEX code (machine language) to PIC16F627A as Figure 7 we apply the PIC16F627A to socket on the Programmer tool. Next take the usb cable to computer. The LED power on display. We will look at “PICKit 2 found and connected. PIC Device Found. Show Device: PIC16F627A.

PICKit 2 Programmer ready to use
Figure 7 PICKit 2 Programmer ready to use

6. To import Hex code as Figure 8 we click File menu and Import Hex
08_we click File menu and Import Hex

7. To select the One_LED_flasher.hex in this project folder as Figure 9
To select the One_LED_flasher.hex in this project folder

8. We look for “Hex file sucessfully imported as Figure 10
Hex file sucessfully imported

9. Click Write button then this system will write Hex code to IC. If finish will show “Programming Successful” as Figure 11
11_Programming Successful

10. Apply the PIC16F627A that finish the programming to the bread board circuit again.

We will see that the LED flasher as Video below LED ON = 2 Second and OFF = 2 Second alternately.

11. We back to edit code again to change as below.
/// ON = 1S OFF = 3s

main()
{
TRISB = 0xFE ;
while(1)
{
PORTB = 0x01;
Delay_ms(1000); <==== For LED ON
PORTB = 0x00;
Delay_ms(3000); <==== For LED OFF
}
}

Then write the HEX code on PIC16F627A again. Next Experiments By step through.

Makes LED ON : 1S only and LED OFF : 3S
as Video below.

1000 = 1000mS = 1 second
3000 = 3000mS = 3 second

Note: Thus we can change long time for LED display with Code only, so easy and very accurate than RC times. For example 100S on old circuit we need to use capacitors Electrolytic about 1,000uF too very big!

We hope to learn the our PIC micro controller will be beneficial for you.
My son love Micro controller because it easy which it is not perfect just to have fun.

This Post Has 2 Comments

  1. This site is very Amazing.
    Thank You with Regards.

    Soumitra Seth.
    Tech Astt.
    CDAC,KOLKATA

  2. Hi Mr. Soumitra Seth,
    Thanks for your feedback.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu