专栏中心

EEPW首页 > 专栏 > Interfacing Relay to Microcontroller

Interfacing Relay to Microcontroller

发布人:0750long 时间:2010-02-02 来源:工程师 发布文章
Interfacing Relay to Microcontroller

 

 

Relays are devices which allow low power circuits to switch a relatively high Current/Voltage ON/OFF. For a relay to operate a suitable pull-in & holding current should be passed through its coil. Generally relay coils are designed to operate from a particular voltage often its 5V or 12V.

The function of relay driver circuit is to provide the necessary current (typically 25 to 70ma) to energize the relay coil.

Image
Figure 1

 

Figure 1 shows the basic relay driver circuit. As you can see an NPN transistor BC547 is being used to control the relay. The transistor is driven into saturation (turned ON)  when a LOGIC 1 is written on the PORT PIN thus turning ON the relay. The relay is turned OFF by writing LOGIC 0 on the port pin.

A diode (1N4007/1N4148) is connected across the relay coil, this is done so as to protect the transistor from damage due to the BACK EMF generated in the relay's inductive coil when the transistor is turned OFF.When the transistor is switched OFF the energy stored in the inductor is dissipated through the diode & the internal resistance of the relay coil.

As you can see we have used a pull up resistor at the base of the transistor. AT8951/52/55 has an internal pull up resistor of 10k so when the pin is pulled high the current flows through this resistor so the maximum output current is 5v/10K = 0.5ma, the DC current gain of BC547 is 100 so the maximum collector current we can get is 0.5ma x 100 = 50ma, but most of the relays require more than 70ma-130ma current depending on the relay that we have used, 0.5ma of base current is not suitable enough for turning ON the relay, so we have used an external pull up resistor. When the controller pin is high current flows through the controller pin i.e. 5v/10k=0.5ma as well as through the pull up resistor. We have used 4.7k pull up resistor so 5v/4.7k=1.1ma so maximum base current can be 0.5ma + 1.1ma=1.6ma i.e. collector current =1.6ma x 100 = 160ma which is enough to turn ON most of the relays.

 

NOTE: This relay driver circuit is to be used only with controllers for using this circuit with other digital IC's like LM 555 use a resistor should be used between that IC's output & the base of transistor.No need of  pull up resistor in that case. 

-Amol Shah

专栏文章内容及配图由作者撰写发布,仅供工程师学习之用,如有侵权或者其他违规问题,请联系本站处理。 联系我们

关键词:

相关推荐

利用计算机设计单片开关电源讲座(1)

德赛西威联合高通打造搭载骁龙汽车平台至尊版的全新AI智能座舱平台

新品驾到!MIC24097——你的高性能降压神器

利用计算机设计单片开关电源讲座(2)

理解发展哲理 领悟发展走向——关于硅技术的思考

利用计算机设计单片开关电源讲座(4)

利用TL431作大功率可调稳压电源

资源下载 2007-02-09

国产1700V GaN器件进一步打开应用端市场

新一轮芯片管制或将分为三级

2025-01-14

贵30%,美国4nm芯片,是台积电带来的

EDA/PCB 2025-01-14

一颗芯片如何助力车内安全传感?AWRL6844 给你答案

美国正式公布AI芯片出口限制新规

智能计算 2025-01-14

闪存安全功能保护您的知识产权

视频 2009-12-14

恒忆 Krypto 密码访问

视频 2009-12-14

利用计算机设计单片开关电源讲座(3)

EasyARM1138嵌入式专题讲座

视频 2009-12-02

更轻易的LED照明温度控制

视频 2009-12-02

服务器电源设计中的五大趋势

一种新型存储技术问世

网络与存储 2025-01-14

Apple Intelligence加速落地中国:苹果上海技术开发公司成立

2025-01-14
更多 培训课堂
更多 焦点
更多 视频

技术专区