Professional Documents
Culture Documents
Interfacing Relay With LPC2148 ARM: Arm How-To Guide
Interfacing Relay With LPC2148 ARM: Arm How-To Guide
Interfacing Relay With LPC2148 ARM: Arm How-To Guide
Relay
+5V
SW28
Relay-1 P1.20
RELAY Modules
OFF 1 8 ON 7SEG
2 7 LCD
3 6 SM/RL
4 5 GLCD
PWR ON/OFF
Note : Relay selection make switch SW28 to SM/RL label marking position
U16
VDD1
VDD2
VDD3
VDDA
VREF
U4
6 16 1 18 STM_A
18 VSS1 P1.16 12 2 I1 O1 17 STM_B
25 VSS2 P1.17 8 3 I2 O2 16 STM_C
42 VSS3 P1.18 4 4 I3 O3 15 STM_D
50 VSS4 P1.19 48 5 I4 O4 14 RL1
59 VSS5 P1.20 44 6 I5 O5 13 RL2
VSSA P1.21 7 I6 O6 12
LPC2148 8 I7 O7 11
9 I8 O8 10 ULN_PWR
GND COMM
ULN2803A
ULN_PWR 2 7 LS3
XTAL2
XTAL1
1
RL1 1 6 4 R2_NC
1
4 D5 3
R1_NC R2_C
D4 3 5
R1_C R2_NO
61
62
5 R1_NO 8
12MHz LED
8 RELAY SPDT
JP9 LED RELAY SPDT
2
3 R1_NO
2
RL2
RELAY O/P2
RL1
RELAY O/P1
RELAY SPDT
Source Code
#include <LPC214x.h>
#include <stdio.h>
void main(void)
{
PINSEL2 = 0x00;
IODIR1 = 1 << RLY1; //Configure P1.20 Output
IODIR1 |= 1 << RLY2; //Configure P1.21 Output
void Delay()
{
unsigned int i,j;
for(i=0;i<2000;i++) for(j=0;j<900;j++);
}
If you are not getting any output from Relay, then you
just check the jumper connections & check the Relay is
connected properly. Otherwise you just check it with
debugging mode in Keil. If you want to see more details
about debugging just see the videos in below link.
General Information