It demonstrates the principle behind interfacing LED's with ARM LPC2148 micro controller. It performs the alternative ON and OFF operation of LED’s which are connected with the ARM LPC2148.

The basic operation for interfacing LED (Light Emitting Diode) with ARM (Advanced RISC Machine) LPC2148 is a very easy process. ARM7 is one of the widely used micro-controller family in embedded system application. It demonstrates the principle behind interfacing LEDs with ARM LPC2148 microcontroller. It performs the alternative ON and OFF operation of LED’s which are connected with the ARM LPC2148. LED’s are cheap in cost and they are easily available in the market. They are of different types, shapes, color, size based on the application the LED’s are chosen for the user needs.

A Light-Emitting Diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode that emits light when activated. When a suitable voltage is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence, and the color of the light (corresponding to the energy of the photon) is determined by the energy band gap of the semiconductor. LEDs are typically small (less than 1 mm2).

LEDs have many advantages over incandescent light sources, including lower energy consumption, longer lifetime, improved physical robustness, smaller size, and faster switching. They are used in the digital watch, street light, industries, health care and so on.


ARM is one of the major options available for embedded system developer. LPC2148 is the widely used IC from ARM-7 family. It is manufactured by Philips and it is pre-loaded with many inbuilt peripherals making it more efficient and a reliable option for the beginners as well as high end application developer.

ARM is a family of instruction set architectures for computer processors based on a reduced instruction set computing (RISC) architecture developed by British company ARM Holdings .A RISC-based computer design approach means ARM processors require significantly fewer transistors than typical processors in average computers. This approach reduces costs, heat and power use. These are desirable traits for light, portable, battery-powered devices including smartphones, laptops, tablet and notepad computers and other embedded systems. A simpler design facilitates more efficient multi-core CPUs and higher core counts at lower cost, providing higher processing power and improved energy efficiency for servers and supercomputers.

The ARM LPC2148 features are as follows:

1. Architecture: ARM v4T

2. Processor: ARM7-TDMI-S

3. Instructions: 32-bit ARM and 16-bit Thumb

4. Debug support: RT Embedded ICE, Embedded Trace interface

5. Static RAM: 32 KB

6. (On-chip)Additional: 8 KB for USB DMA

7. Flash Program: 512 KB

8. Mem.(On-chip)Programming: ISP/IAP via on-chip boot-loader program

9. GPIO No. of pins: up to 45 (fast GPIO lines, 5V tolerant), Configurable to fast GPIO

10. External Interrupts: Four; No. of pins: Nine

The ARM LPC2148 has two ports Port 0 and Port 1 respectively each port contains 32-bits for I/O operations. The Port 0 has 32-bit of I/O pins for individual directions and Port 1 has 32-bits of I/O pins for bidirectional purpose. It has two timers of each 32-bit. It has capable to storing 128-bit memory for interfacing.

Over the last few years, the ARM architecture has become the most pervasive 32-bitarchitecture in the world, with wide range of ICs available from various IC manufacturers. ARM processors are embedded in products ranging from cell/mobile phones to automotive braking systems. A worldwide community of ARM partners and third-party vendors has developed among semiconductor and product design companies, including hardware engineers, system designers, and software developers.

A light-emitting diode (LED) is a semiconductor device that emits visible light when an electric current passes through it. The light is not particularly bright, but in most LEDs it is monochromatic, occurring at a single wavelength. The output from an LED can range from red (at a wavelength of approximately 700 nanometers) to blue-violet (about 400 nanometers). Some LEDs emit infrared (IR) energy (830 nanometers or longer); such a device is known as an infrared-emitting diode (IRED).

An LED consists of two elements of processed material called P-type semiconductors and N-type semiconductors. These two elements are placed in direct contact, forming a region called the P-N junction. In this respect, the LED resembles most other diode types, but there are important differences. The LED has a transparent package, allowing visible energy to pass through. Also, the LED has a large PN-junction area whose shape is tailored to the application.

Benefits of LEDs compared with incandescent and fluorescent illuminating devices, include:

• Low power requirement: Most types can be operated with battery power supplies.

• High efficiency: Most of the power supplied to an LED is converted into radiation in the desired form, with minimal heat production.

• Long life: When properly installed, an LED can function for decades several amps.

The LED’s are of different color based on semiconductor material used during the manufacturing process. The wavelength, color and voltage drop are differ based on the material used in the LED’s. The voltage drop and wavelength of different types of LED’s are listed below.

As supply voltage for molex: 5, 7 and 12 volts and Batteries: 1.5 and 9 volts. Then the led forward voltages for Red and green: 2 volts; Blue and white: 3.0 - 3.5 volts. The LED current is 20mA will work for most regular led; Super bright led can go from 30mA up to several amps.

The LED will glow only when the supply voltage is given. The resistance used here is to limit the flow of current. The value of resistance is based on the color of the LED and its voltage drop. The calculation of resistance value is shown below.

To calculate the resistor needed for a simple LED circuit, simply take the voltage drop away from the source voltage then apply Ohm's Law. In other words...


• VS is the source voltage, measured in volts (V),

• VLED is the voltage drop across the LED, measured in volts (V),

• ILED is the current through the LED*, measured in Amperes (Amps/A), and

• R is the resistance, measured in Ohms (Ω).

The current through the circuit is constant so ILED is also the current through the resistor.


Typically rated for 2 mA at around 2 V (approximately 4 mW consumption)


20 mA LEDs (ranging from approximately 40 mW to 90 mW) at around:

• 1.9 to 2.1 V for red, orange, yellow, and traditional green

• 3.0 to 3.4 V for pure green and blue

• 2.9 to 4.2 V for violet, pink, purple and white


• 20 mA at approximately 2 or 4–5 V, designed for viewing in direct sunlight

• 5V and 12V LEDs are ordinary miniature LEDs that incorporate a suitable series resistor for direct connection to a 5 V or 12 V supply.


• Aviation lighting

• Automotive headlamps

• Advertising

• General lighting

• Traffic signals

• Camera flashes

• Lighted wallpaper.

Proteus design for LED interfacing with ARM

Orcad design for LED interfacing with ARM

LED interfacing with ARM

/*  Name     : main.c
 *  Purpose  : Source code for LED Interfacing with ARM LPC1248.
 *  Author   : Gemicates
 *  Date     : 2018-08-01
 *  Website  : www.gemicates.org
 *  Revision : None
#include<lpc21xx.h> 			//header file for LPC21XX series

void delay(int time) 			//delay function declaration
int i,j; 				//This function produces a delay in msec

int main() 				//main function
PINSEL0=0X00000000; 			//select PORT0 as GPIO mode
IO0DIR=0XFFFFFFFF; 			//make PORT0 pin as Output mode 
while(1) 				//Repeat(loop) forever
IO0SET=0X55555555; 			//Set the PORT0 pins 
delay(900); 				//hault for sometime
IO0CLR=0X55555555; 			//clear the PORT0 pins
IO0SET=0XAAAAAAAA; 			//Set the PORT0 pins 
delay(900); 				//hault for sometime
IO0CLR=0XAAAAAAAA; 	`		//clear the PORT0 pins         
return 0; 				//return back to main function

Error message here!

Show Error message here!

Forgot your password?

Error message here!

Send OTP

Error message here!

Show Error message here!

Lost your password? Please enter your email address. You will receive a password you Need.

Send Error message here!

Back to log-in