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:
R0=1kΩ, R1=33kΩ, R2=62kΩ, R3=89kΩ, R4=120kΩ, R5=150kΩ, R6=180kΩ, R7=220kΩ.
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
#INCLUDEP16F84INC
FC EQU0CH
FD EQU0DH
ORG 0
MAIN: CLRRW
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 port
CALL DELAAY; delay 10 seconds
CLRC ;清C
RRF F8; F8 right shift
BTFS3,0
GOTO PHASE
GOTO START
DELAY:MOVLW150
MOVWFF9
MOVLW7; Preset RTCC
Let the multiple be 1:256
OPTION
LOOP:MOVLW255
SUBWFRTCC
BTFSS 32
DECFZF9
GOTO LOOP
RETLW 0
END; End of program
Previous article:Why can't I enter the other external interrupt of the PIC microcontroller?
Next article:Design of motorcycle anti-theft alarm using PIC microcontroller
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- I don't quite understand this thermal imager resolution comparison chart
- [TI recommended course] #Amplifier design in test and measurement#
- Seeking long-term cooperative lecturers for win-win cooperation
- MSP430F149 I/O port control
- Xunwei-i.MX6ULL Development Board-Busybox transplant DHCP (Part 3)
- Free download of test solutions: R&SCMA180 - ideal test tool for analog and digital radio walkie-talkies
- Review summary: APM32E103VET6S MINI development board with the Polar Ocean M3 core
- Live broadcast at 13:15 this afternoon [Keysight World 2020|Telecom Infrastructure, Cloud and Artificial Intelligence Forum]
- [RISC-V MCU CH32V103 Review] - 4: EXTI starts the troubleshooting journey
- Use of SN74LVC125AD