Using PIC microcontroller to make a natural wind generator for electric fans

Publisher:冷漠之心Latest update time:2019-10-22 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction to PIC microcontrollers 
PIC16C5X is a low-cost commercial microcontroller with internal program memory (0.5~~2K), working registers (32~~80), 33 streamlined instructions, internal watchdog (WDT), clock/pulse counter RTCC, bidirectional programmable I/O ports (12~~20), and the OTP (one-time programmable) chip of the PIC microcontroller is particularly suitable for commercial development and production. 

2. Hardware structure and principle of natural wind generator 

 

To make the electric fan generate natural wind, that is, to change the strength of the electric fan's air supply, only the voltage and current at the motor end can be changed. As shown in Figure 1, changing the thyristor control angle α, that is, controlling the time when the thyristor starts to conduct, can change the voltage and current on the motor load. Figure 2 shows the relationship between the α angle and the motor load voltage. 

 

The change of the α angle can be achieved by changing the discharge time of the capacitor C1. The PIC16C54 microcontroller regularly selects the resistor Rx to change the charge and discharge time of the capacitor C1, thereby achieving the purpose of changing the strength of the electric fan's air supply. The relationship between the control angle α and the wind strength is shown below. 

 

 

Generally, η=0.63 is selected, and the transistor characteristics are the best. The capacitor C1 is 0.047μF. According to formula (3), corresponding to different α settings, the Rx value table is obtained: 

R0=1K, R1=33K, R2=62K, R3=89K, R4=120K, R5=150K, R6=180K, R7=220K 

Rx is connected to the RB0~RB7 ports of the PIC16C54 microcontroller. 

Port RA0 is the start signal input port. When the A key is pressed, the natural wind generator starts working. 

Port RA1 is the stop signal input port. When the B key is pressed, the natural wind generator stops working. 

Port RA2 is the timing signal input port. When the C key is pressed, the natural wind generator works in a timing mode. Port 

RA3 is the AC phase detection port, which is used to determine the starting phase of the AC. 

Readers can add display, timing value input and other circuits to form a more complete device. 

3. Software Block Diagram and Program Listing The program block 

 

diagram is shown in Figure 3. 

The program list is as follows: 


;Routine for nature wind fan 

RTCC EQU 1 

RA EQU 5 

RB EQU 6 

F8 EQU 8 

F9 EQU 9 

ORG 1FFH ;Reset address 

GOTO MAIN 

ORG 0 


MAIN: 
CLRW 

TRIS RB 

MOVWF RB ;Set RB port as output port, and the initial value is 0 

MOVLW 0FH 

TRIS RA ;Set RA port as input port 

KEY-A: 
BTFSC RA, 0 

GOTO KEY-A ;Whether the A key is pressed 

START: 
MOVLW 80H 

MOVWF F8 ;80H->F8 

BTFSS RA, 1 

GOTO MAIN ;B key pressed 

PHASE 
BTFSC RA, 3 

GOTO PHASE ;Wait for AC power 0 phase 

MOVWF F8, W 

MOVWF RB ;F8->RB port 

CALL DELAY ;Delay 10 seconds 

CLRC ;Clear C 

RRF F8; F8 left shift 

SKPC 

GOTO PHASE 

GOTO START 

; Subroutine 
DELAY: 
MOVLW 150 

MOVWF F9 

MOVLW 7; Preset multiple 1:256 for RTCC 

OPTION 

LOOP: 
MOVLW 255 

SUBWF RTCC 

DECFSZ F9 

SKPZ 

GOTO LOOP 

RETLW 0 

END; End of 


the fourth summary 

The above is an example of using PIC16C54 microcontroller to control household appliances. Nowadays, smart home appliances controlled by microcomputers (single-chip microcomputers) are becoming increasingly popular and are an inevitable development trend of home appliances. The PIC series is a commercial-oriented model, especially suitable for product development. Its low price, compactness, and confidentiality are exactly what the development manufacturers need. Readers can use PIC to develop a series of exquisite products by themselves if they think carefully. 

Reference address:Using PIC microcontroller to make a natural wind generator for electric fans

Previous article:Counter using PIC16C54 microcontroller
Next article:Using PIC16C54 to Make a Simple AM ​​Frequency Counter

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号