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.
Previous article:Counter using PIC16C54 microcontroller
Next article:Using PIC16C54 to Make a Simple AM Frequency Counter
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What happens if the input voltage of the window comparator is equal to the upper and lower limits?
- Banknote number recognition system based on ARM.pdf
- My knowledge of computers
- Sampling rate of MCU ADC
- [Sipeed LicheeRV 86 Panel Review] 7-Waft Graphical Interface Development Test (Part 2)
- I don't understand the principle of ultrasonic signal processing.
- Let’s talk about the first big event in 2019...
- Wifi controlled LED screen
- IIoT opens up more possibilities beyond the factory floor
- Recommended one: [Lingsheng] MCU code automatic generator (automatic programming tool)