Project 14 – Interface with Relay

PROJECT 14

INTERFACE WITH RELAY

Back to Project 13                                                                                                    Go to Project 15

Relay have become a common use electronic component which operate as an switching device by simply apply voltage to ON and OFF it. For this project, we will discover a simple relay connected with an LED to show what is the basic function and connection.

———————————————————————————————————————————————————-

COMPONENT NEEDED

———————————————————————————————————————————————————-

RELAY
  LED x2
  1K RESISTOR x2
 
NPN TRANSISTOR
 
1N5817
SCHOTTKY DIODE
  BREADBOARD
  JUMPER WIRES

———————————————————————————————————————————————————-

CONNECTION

———————————————————————————————————————————————————-
Normally relay will have 4 pin which is normally open(NO), normally close(NC), common and 2 control pin to ON/OFF the magnetic coil. By referring to the figure below, RED wires are VDD which connected to LEDs anode. BLACK wires are GND are connected to common and NPN Emitter pin.. ORANGE and WHITE wire connected to both cathode of LED through 1K resistor. The YELLOW wire are connected to RA0 and NPN Base pin. For protection of the microcontroller, we added a schottky diode as an protection diode.


———————————————————————————————————————————————————-

ADDITIONAL INFORMATION

———————————————————————————————————————————————————-
Relay have almost the same function as a switch but the difference are that relay can be toggle by simple giving an electricity. Please refer this webpage for detail.

CODE OVERVIEW

———————————————————————————————————————————————————-

#define Relay1 RA0
In system.h, we have defined the Relay1 I/O PORT as
RA0.

If (SW1 == 0) Relay1 = 1;
Check if switch 1 is trigger ON. If switch 1 is HIGH(1), then go out of this loop. If switch 1 is LOW(0), trigger ON Relay 1.

else Relays = 0;
If switch 1 is HIGH(1), Relay1 =0.

Back to Project 13                                                                                                    Go to Project 15

———————————————————————————————————————————————————-

ATTACHMENT

1. P14 User Manual.pdf
2. Project_14_code.zip

Buy

, , ,

Related Post

Control and Monitor via SMS Part 2

Simple steps to control Stepper Motor using 2Amp Motor Driver Shield and CIKU

PIC16F VS PIC18F:Analysis of PIC Mid-Range 8 bit family and Advanced 8-bits Family

Gesture Sensor (APDS9960) interface with SK40C+PIC16F877A

Leave a Reply

Your email address will not be published. Required fields are marked *