You have no items in your shopping cart.

Subtotal: 0.00

How to Interface Relay with CY8C3866 PSOC3 Development Board

PSoc 3 Development kit

The PSoc 3 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 FX2LP Programmer which is done through USB port.

Cypress 8051 core (CY8C3866), PSoc 3 Development kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 8-bit Microcontrollers. It integrates on board CAPSENSE BUTTONS, CAPSENSE LINEAR SLIDER, UART, ADC, DAC, Relay, Buzzer, Seven Segment, Serial EEPROM, Temperature Sensor LM35, Matrix Keypad, Switch, LED, Stepper Motor Driver, Traffic Light Controller, 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.


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 CY8C3866

We now want to control the relay operations by using CY8C3866 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 – P1.20) and Relay2-P1.21) for relay module, make port pins to high, relay will activated.

Pin Assignment with CY8C3866



CY8C3866 Lines

RELAY Power Select

RELAY Modules






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


Circuit Diagram to Interface Relay with CY8C3866

C Program to control Relay in CY8C3866


Title : Program to control Relay



void main()


for (;;)












/* [] END OF FILE */