Step by Step Procedure of Develop a Microcontroller Projects

I am sure the term ‘Microcontroller’ must be familiar to you. It is a single chip which contains the processor, the memory along with the input/output pins embedded inside it. We often use microcontrollers for embedded applications, as a controller to control any actuators such as motors or displays.
I am sure there must be many of you, who would love to build your own embedded system or let me say a simple project using a microcontroller. Now for this, you need to have a basic idea about each step required to develop a microcontroller based project. So here I am explaining the basic steps to build a microcontroller based project.
But before that, let us get an idea about the project we would like to design and the theory behind it.

Aim of the project

To design a LED flash light system using Microcontroller

Theory

The LED flash light system can produce the light through light emitting diode. The incandescent lights used in traditional flash light consume more energy and have very less life time. The LED lights on the other hand, consume less energy and have long life.

Basic Idea Behind the Design

The microcontroller generates the output logic pulses so that the LED light is switched ON and OFF at certain intervals. It is a 40 pin microcontroller. The Crystal interfaced to input pins of the microcontroller provides  accurate clock signals at the crystal frequency.

Steps in developing the project

Step1: Circuit Designing

The 8051 microcontroller crystal operates at 11.0592 MHz frequencies because it can give exact clock pulses for data synchronizing. Two capacitors are connected to the crystal oscillator with range of 20pf to 40pf which is used to stabilize the clock signals. The 8051 microcontroller at some times goes to block state or missing time calculation.
At that time we need to reset the microcontroller. When the microcontroller is reset, it takes maximum 3sec time delay with the help of the 10k resistor and 10uf capacitor.

Circuit Components:

Hardware Components:
  • Yellow LED
  • Crystal
  • Reset
  • 8051 microcontroller
  • Capacitors
  • Resistors
Software Components:
  • Keil compiler
  • Proteus software
  • Embedded C language
Circuit Connections
The 5v DC supply is given to the 40 pin of the microcontroller which  drives  the circuit. The crystal  is connected to the 18 and 19 pin of the microcontroller. The reset circuit is interfaced at 9 pin of the microcontroller. The Yellow LED is connected to the pin P0.2 of the microcontroller.

Step 2: Microcontroller Program Coding

  • First open the Kiel uVison2 software. This shows the menu bar with file, edit, view, project and tools option.
  • Select the project option and select the ‘new project option’ from the drop down menu. Give a name to the project and click on ‘save’ button to save the project. A folder named ‘target’ is created.
  • Select a microcontroller for your project. Here I am selecting ‘Atmel’. Select the exact type of Atmel microcontroller from the drop down menu. Here 89C51 microcontroller is selected. A folder with the name ‘source group’ is created in the ‘target’ folder.
  • Click on the ‘File’ menu on the menu bar. Select ‘new file’ from the drop down menu.
Kiel Window
Kiel Window
  • Write the code on the blank space.
The LED Flash Light program:
#include
sbit LED= P0^2;
void delay( unsigned int a);
void main()
{   LED=0;
While (1)
{ LED=0;
delay(600);
LED=1;
delay(600);
}
}
void delay (unsigned int b)
{   unsigned int k;
for(k=0;k}
  • Save this code with ‘.C’ extension.
  • Right click on the ‘source group’ folder icon and select ‘add files to group’ option.
  • A window appears. Select the ‘C’ file to be added.
  • Select the ‘debug’ menu. It checks the program for any errors.
  • Right click on the ‘target’ folder icon.
  • Select the ‘option for Target’ option.
  • A target window opens with a menu bar. Click on the ‘Target’ menu.
  • Set the crystal frequency for the microcontroller.
  • Click on the ‘Output’ menu. A window appears
  • Click on the ‘create hex file’ button. A hex file is created.

Step 3: Circuit Drawing

This is circuit is designed with help of Proteus software. It is circuit design software which contains a database of components which we can use to build the circuit. Each and every component is available in the components library.
Proteus window using the circuit
Proteus window using the circuit
  • Open the Proteus software. A window with a menu bar appears.
  • Click on the file menu.
  • Select ‘new design’ from the drop down menu.
  • Click on the library menu.
  • Select ‘pick devices/symbol’ from the drop down menu.
  • Select the relevant comment by double clicking on it, so that the component appears on the window.
  • Add all the components and draw the circuit with proper connections.
Circuit Diagram
Circuit Diagram

Step 4: Code Dumping

Loading the code to the microcontroller is called dumping. The microcontrollers understand only binary language. So we need to load the hex code into the microcontroller. There are lots of softwares available in the market for loading the code to the microcontroller. Here I am using ‘Willer’ programmer software to dump the code to the 8051 microcontroller. The programmer kit comes with software along with the hardware kit.
This software needs to be installed onto the computer. The hardware kit comes with a socket, on which the microcontroller is placed. Here are the steps to load the code onto the microcontroller.
Willer Programmer hardware kit
Willer Programmer hardware kit
Willer software window
Willer software window

  • The hardware (programmer kit) is interfaced to the computer through a serial cable
  • The microcontroller is placed on the socket of the hardware kit. Press the lock button to ensure the microcontroller is connected to the board.
  • Open the software installed in the computer. It will display some operating modes.
  • Select any mode. A window with a menu bar appears.
  • Click on the ‘file’ menu and select ‘load file’ option from the drop down menu
  • Click on the ‘auto’ button so that the hex file is loaded to the microcontroller.

Step 5:  Simulating the Circuit

  • Open the project in the proteus software.
  • Click on the ‘Debug’ menu.
  • Select the ‘start debugging’ option. The LED starts blinking, which indicates the circuit is running.
  • After some time, select the ‘stop debugging’ option. The LED will now stop blinking.

So ready to build your own project, aren’t you? You must have noticed, I have given a very basic project using a microcontroller and written the code in ‘C’ language. But the microcontroller understands the assembly language.


So here I leave a task for you. Write this same code using Assembly language, in the comment section below.
Previous
Next Post »
My photo

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation. I believe everyday can become a Electrician with the right learning materials.
My goal with BLOG is to help you learn Electrical.
Related Posts Plugin for WordPress, Blogger...

Label

KITAIFA NEWS KIMATAIFA MICHEZO BURUDANI SIASA TECHNICAL ARTICLES f HAPA KAZI TU. LEKULE TV EDITORIALS ARTICLES DC DIGITAL ROBOTICS SEMICONDUCTORS MAKALA GENERATOR GALLERY AC EXPERIMENTS MANUFACTURING-ENGINEERING MAGAZETI REFERENCE IOT FUNDAMENTAL OF ELECTRICITY ELECTRONICS ELECTRICAL ENGINEER MEASUREMENT VIDEO ZANZIBAR YETU TRANSDUCER & SENSOR MITINDO ARDUINO RENEWABLE ENERGY AUTOMOBILE SYNCHRONOUS GENERATOR ELECTRICAL DISTRIBUTION CABLES DIGITAL ELECTRONICS AUTOMOTIVE PROTECTION SOLAR TEARDOWN DIODE AND CIRCUITS BASIC ELECTRICAL ELECTRONICS MOTOR SWITCHES CIRCUIT BREAKERS MICROCONTROLLER CIRCUITS THEORY PANEL BUILDING ELECTRONICS DEVICES MIRACLES SWITCHGEAR ANALOG MOBILE DEVICES CAMERA TECHNOLOGY GENERATION WEARABLES BATTERIES COMMUNICATION FREE CIRCUITS INDUSTRIAL AUTOMATION SPECIAL MACHINES ELECTRICAL SAFETY ENERGY EFFIDIENCY-BUILDING DRONE NUCLEAR ENERGY CONTROL SYSTEM FILTER`S SMATRPHONE BIOGAS POWER TANZIA BELT CONVEYOR MATERIAL HANDLING RELAY ELECTRICAL INSTRUMENTS PLC`S TRANSFORMER AC CIRCUITS CIRCUIT SCHEMATIC SYMBOLS DDISCRETE SEMICONDUCTOR CIRCUITS WIND POWER C.B DEVICES DC CIRCUITS DIODES AND RECTIFIERS FUSE SPECIAL TRANSFORMER THERMAL POWER PLANT cartoon CELL CHEMISTRY EARTHING SYSTEM ELECTRIC LAMP ENERGY SOURCE FUNDAMENTAL OF ELECTRICITY 2 BIPOLAR JUNCTION TRANSISTOR 555 TIMER CIRCUITS AUTOCAD C PROGRAMMING HYDRO POWER LOGIC GATES OPERATIONAL AMPLIFIER`S SOLID-STATE DEVICE THEORRY DEFECE & MILITARY FLUORESCENT LAMP HOME AUTOMATION INDUSTRIAL ROBOTICS ANDROID COMPUTER ELECTRICAL DRIVES GROUNDING SYSTEM BLUETOOTH CALCULUS REFERENCE DC METERING CIRCUITS DC NETWORK ANALYSIS ELECTRICAL SAFETY TIPS ELECTRICIAN SCHOOL ELECTRON TUBES FUNDAMENTAL OF ELECTRICITY 1 INDUCTION MACHINES INSULATIONS ALGEBRA REFERENCE HMI[Human Interface Machines] INDUCTION MOTOR KARNAUGH MAPPING USEUL EQUIATIONS AND CONVERSION FACTOR ANALOG INTEGRATED CIRCUITS BASIC CONCEPTS AND TEST EQUIPMENTS DIGITAL COMMUNICATION DIGITAL-ANALOG CONVERSION ELECTRICAL SOFTWARE GAS TURBINE ILLUMINATION OHM`S LAW POWER ELECTRONICS THYRISTOR USB AUDIO BOOLEAN ALGEBRA DIGITAL INTEGRATED CIRCUITS FUNDAMENTAL OF ELECTRICITY 3 PHYSICS OF CONDUCTORS AND INSULATORS SPECIAL MOTOR STEAM POWER PLANTS TESTING TRANSMISION LINE C-BISCUIT CAPACITORS COMBINATION LOGIC FUNCTION COMPLEX NUMBERS ELECTRICAL LAWS HMI[HUMANI INTERFACE MACHINES INVERTER LADDER DIAGRAM MULTIVIBRATORS RC AND L/R TIME CONSTANTS SCADA SERIES AND PARALLEL CIRCUITS USING THE SPICE CIRCUIT SIMULATION PROGRAM AMPLIFIERS AND ACTIVE DEVICES BASIC CONCEPTS OF ELECTRICITY CONDUCTOR AND INSULATORS TABLES CONDUITS FITTING AND SUPPORTS CONTROL MOTION ELECTRICAL INSTRUMENTATION SIGNALS ELECTRICAL TOOLS INDUCTORS LiDAR MAGNETISM AND ELECTROMAGNETISM PLYPHASE AC CIRCUITS RECLOSER SAFE LIVING WITH GAS AND LPG SAFETY CLOTHING STEPPER MOTOR SYNCHRONOUS MOTOR AC METRING CIRCUITS APPS & SOFTWARE BASIC AC THEORY BECOME AN ELECTRICIAN BINARY ARITHMETIC BUSHING DIGITAL STORAGE MEMROY ELECTRICIAN JOBS HEAT ENGINES HOME THEATER INPECTIONS LIGHT SABER MOSFET NUMERATION SYSTEM POWER FACTORS REACTANCE AND IMPEDANCE INDUCTIVE RESONANCE SCIENTIFIC NOTATION AND METRIC PREFIXES SULFURIC ACID TROUBLESHOOTING TROUBLESHOOTING-THEORY & PRACTICE 12C BUS APPLE BATTERIES AND POWER SYSTEMS ELECTROMECHANICAL RELAYS ENERGY EFFICIENCY-LIGHT INDUSTRIAL SAFETY EQUIPMENTS MEGGER MXED-FREQUENCY AC SIGNALS PRINCIPLE OF DIGITAL COMPUTING QUESTIONS REACTANCE AND IMPEDANCE-CAPATIVE RECTIFIER AND CONVERTERS SEQUENTIAL CIRCUITS SERRIES-PARALLEL COMBINATION CIRCUITS SHIFT REGISTERS BUILDING SERVICES COMPRESSOR CRANES DC MOTOR DRIVES DIVIDER CIRCUIT AND KIRCHHOFF`S LAW ELECTRICAL DISTRIBUTION EQUIPMENTS 1 ELECTRICAL DISTRIBUTION EQUIPMENTS B ELECTRICAL TOOL KIT ELECTRICIAN JOB DESCRIPTION LAPTOP THERMOCOUPLE TRIGONOMENTRY REFERENCE UART WIRELESS BIOMASS CONTACTOR ELECTRIC ILLUMINATION ELECTRICAL SAFETY TRAINING FILTER DESIGN HARDWARE INDUSTRIAL DRIVES JUNCTION FIELD-EFFECT TRANSISTORS NASA NUCLEAR POWER SCIENCE VALVE WWE oscilloscope 3D TECHNOLOGIES COLOR CODES ELECTRIC TRACTION FEATURED FLEXIBLE ELECTRONICS FLUKE GEARMOTORS INTRODUCTION LASSER MATERIAL PID PUMP SEAL ELECTRICIAN CAREER ELECTRICITY SUPPLY AND DISTRIBUTION MUSIC NEUTRAL PERIODIC TABLES OF THE ELEMENTS POLYPHASE AC CIRCUITS PROJECTS REATORS SATELLITE STAR DELTA VIBRATION WATERPROOF