You have no items in your shopping cart.

Subtotal: 0.00

How to Interface Relay with MSP430F5529 MSP430 Development Board

PS DEVELOPMENT MSP430 kit

The MSP430 Development kit is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports with Code Composer Studio v4 and later through USB port.

Texas Instrument Microcontroller, MSP430 Development kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 16-bit Microcontrollers. It integrates on board PS2, UART, ADC, PWM, Temperature Sensor, Relay, Buzzer, I2c Seven Segment, I2C Serial EEPROM, Temperature Sensor LM35, Matrix Keypad, Switch, LED, Stepper Motor Driver, Traffic Light Controller, I2C RTC, LCD & GLCD Display to create a stand-alone versatile test platform. User can easily engage in Development in this platform, or use it as reference to application Development.

Relay

Relays are devices which allow low power circuits to switch a relatively high Current/Voltage ON/OFF. A relay circuit is typically a smaller switch or device which drives (opens/closes) an electric switch that is capable of carrying much larger current amounts.

Interfacing Relays

Fig. 1 shows how to interface the Relay to microcontroller. There are 2 input channels. Each input is connected to the triggering coil of the respective relay. There are 2 output channels that each correspond to an input. When the input is energized, the relay turns on and the '+' output is connected to +12v. When the relay is off, the '+' output is connected to Ground. The '-' output is permanently wired to Ground.



Fig. 1 Interfacing Relay to Microcontroller

Interfacing Relay with MSP430F5529

We now want to control the relay operations by using MSP430F5529 Development Board. Here we are using two Relays. The relay consists of a coil and a switch. When the coil is energized, the switch closes, connecting the two contacts together. ULN2803 is used as a driver for port I/O lines, drivers output connected to relay modules. Connector provided for external power supply if needed.

Relay Module : Port P1 pins (Realy1 – P3.2) and Relay2-P3.5) for relay module, make port pins to high, relay will activated.

Pin Assignment with MSP430F5529



 

RELAY SPDT

MSP430F5529 Lines

RELAY Power Select

RELAY Modules

Relay-1

P3.2

Relay-2

P3.5

Note : Relay selection make switch SW28 to SM/RL label marking position

 

 

For Motor/relay section obtain power from on-board (internal) or external supply through jumper JP8.

Circuit Diagram to Interface Relay with MSP430F5529





Relay2 Schematics:





C Program to control Relay in MSP430F5529

***************************************************************************************

Title : Program to control Relay

***************************************************************************************

#include 

void Delay();

#define RLY1 2

//RLY1 (P1.20) AS output

#define RLY2 5

//RLY2 (P1.21) AS output

void main(void)

{

unsigned int i;

WDTCTL = WDTPW + WDTHOLD;

// Stop watchdog timer P3DIR |= 0x24;

// Set P3.2-P3.5 to O/P direction RLY1, RLY2, Stepper i=5;

while(i>0)

//loop for 5 times { P3OUT |= 0x1 << RLY1;

Delay();

P3OUT &= ~0x1 << RLY1; Delay();

P3OUT |= 0x1 << RLY2; Delay();

P3OUT &= ~0x1 << RLY2;

Delay();

i--;

}

}

void Delay()

{

unsigned int i,j;

for(i=0;i<60;i++)

for(j=0;j<700;j++)

{

asm("nop;");

}

}