Design of PIC16F84 single chip microcomputer to control electric fan

Publisher:vnerwb池塘边Latest update time:2019-12-25 Source: elecfansKeywords:PIC16F84 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Hardware circuit and principle

To make the electric fan send out natural wind, it is necessary to change the strength of the fan, that is, to change the voltage and current of the fan motor, thereby changing its speed. As shown in Figure 1, the fan socket is connected in series with the thyristor TREAC. By changing the thyristor control angle α, that is, controlling the time when the thyristor is turned on, the voltage and current of the fan motor can be changed. Figure 2 shows the relationship between the α angle and the motor load voltage.


The change of angle α can be achieved by changing the charge and discharge time of capacitor C1. The PIC16F84 microcontroller selects resistor Rx according to a certain rule to change the charge and discharge time of capacitor C1, thereby changing the conduction time of 2N2646. By changing the conduction angle of TREAC, the purpose of changing the strength of the fan is achieved. The relationship between the control angle α and the strength of the wind is shown in Figure 3.


If the mains frequency f = 50 Hz, then we can get the following formula: α/360° = t/0.02………………(1)

According to the RxC1 charging circuit shown in Figure 1, it can be inferred that

α=t·360°/0.02 ={RxC1ln1[1/(1-n)]}·360°/0.02 ……………(2)

Where η = VP / VBB, Vp is the voltage value of C1 after charging, VBB is the charging power supply voltage, and η = 0.63 is generally taken. If the capacitor C is 0.047μF, according to the value of (2), the Rx value table corresponding to different α setting values ​​is obtained:


100% working days.


Rx is connected to RB0~RB7 ports of PIC16F84 microcontroller; RA0 port is the start signal input port. When the A key is pressed, the natural wind generator starts to work; RA1 port is the stop signal input port. When the B key is pressed, the natural wind generator stops running; RA3 port is the AC phase detection port. It is used to determine the starting phase of the AC.


Program Listing:

LSIT P=PIC16F84

#INCLUDE P16F84INC

FC EQU0CH

FD EQU0DH

ORG 0

MAIN:CLRW

TRISRB

MOVWFRB; set RB port as output port,

; and set its initial value to 0

MOVLW0FH

TRIS RA; Set port A as input port

KEYA: BTFSCRA, 0; Is the A key pressed?

GOTO KEYA ;A key is not pressed to go to

KEYA, wait

START: MOVLW80H; Press the A key,

;80H→F8

MOVWFF8

BTFSSRA,1;B key pressed No

GOTOMAIN ;B key pressed

PHASE:BTFSCRA3

GOTO PHASE ; Waiting for AC power

Zero Phase

MOVF8,W

MOVWFRB ; F8 → RB exit

CALL DELAAY; delay 10 seconds

CLRC ;清C

RRF F8; F8 right shift

BTFSS3,0

GOTO PHASE

GOTO START

DELAY:MOVLW150

MOVWFF9

MOVLW7; Preset RTCC

Let the multiple be 1:256

OPTION

LOOP:MOVLW255

SUBWFRTCC

BTFSS 32

DECFSZF9

GOTO LOOP

RETLW 0

END; End of program

Design of PIC16F84 single chip microcomputer to control electric fan

Design of PIC16F84 single chip microcomputer to control electric fan

Design of PIC16F84 single chip microcomputer to control electric fan

Keywords:PIC16F84 Reference address:Design of PIC16F84 single chip microcomputer to control electric fan

Previous article:Getting Started with PIC18F Microcontroller
Next article:Design of LCD segment driver driven by PIC microcontroller

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号