Design and Realization of Wireless Charger Based on 51 Single Chip Computer

Author's homepage: Programming Thousand Paper Cranes

About the author: Java, front-end, and Python have been developed for many years, and have worked as a senior engineer, project manager, and architect

Main content: Java project development, Python project development, university data and AI project development, MCU project design, interview technology arrangement, latest technology sharing

Favorites, likes, don't get lost, it's good to follow the author

Get the source code at the end of the article

Item number: BS-DPJ-001

Foreword:

Wireless power transmission technology is a new energy transmission technology. Its main function is resonant coupling wireless power transmission. It has high transmission efficiency and is suitable for medium transmission distances. Based on the principle of magnetic field and resonance coupling, it can effectively transmit power to the load. Therefore, many disadvantages of the traditional power transmission mode are solved. This thesis takes the single-chip microcomputer as the core, and uses the electromagnetic induction principle of the wireless charging coil to charge the mobile phone. First of all, on the basis of referring to relevant materials at home and abroad, the overall design of the entire wireless charging device is studied, the functions of each module are determined, and the hardware circuit is designed and constructed. On this basis, the control software of the single-chip microcomputer is written, the control of each part is completed, and the actual welding and testing are completed, and the system design of the wireless charging device with the single-chip microcomputer as the core is completed.

1. Project Introduction

In the case of low power consumption, wireless charging technology can still play its advantages. First of all, this is to adapt to the life of modern people. For convenience, many portable mobile phones must be charged with the mobile phone from time to time, which leads to the existence of sockets and wires, making it difficult to be waterproof. Secondly, with the continuous growth of electricity, people's impact on the environment is also increasing, and wireless contactless charging technology is a very good solution, which lays the foundation for sustainable development. With the development of the times, the design of wireless charger is a brand-new technology, and its application range is very wide. The wireless charger developed in this paper with MCU as the core has stable performance, simple circuit and practicality. The function has been greatly improved, bringing great convenience to people's daily life.

Second, program design

2.1 Introduction to the principle of wireless charging system

No matter how different the wireless charging technology is, the theory behind it is the so-called "electromagnetic induction", that is, a changing magnetic field is generated by a changing electric field, and then an electric field is generated by the changing magnetic field, thereby generating electricity. The magnetic field produced by a charged wire is perpendicular to the direction of the current and is generally weak, but when the wire is wound into a loop or helix, the magnetic fields add up in the same direction to form a stronger magnetic field. In fact, the principle of wireless charging is very similar to the transformers we use every day, which drives the other coil through the current in one coil. However, unlike the method in which a transformer transmits a magnetic field through an iron core, the induction coil in the wireless charging device is specially adjusted to use air as a medium to conduct the magnetic field and generate an induced current. At the same time, in order to ensure the resonant frequency of the two coils, it is necessary to ensure that the resonant frequency of the two coils is the same, even if the current of the output coil is very low, a large induced current can be generated to a certain extent. In terms of its technical principles and solutions, there are three types of existing wireless charging technologies: electromagnetic induction, magnetic resonance, and radio waves. These technologies can be used for short-distance, short-distance and long-distance transmission.

Different wireless charging modes have different characteristics, and the specific comparison is shown in Table 2-1.

Table 2-1 Features of various wireless charging methods

category

Electromagnetic induction

electromagnetic resonance

radio waves

principle

The current passes through the wire, forming a magnetic field, causing the surrounding coil to generate an induced voltage, which is the current.

The energy at the transmitting end is in contact with the receiving end at the same resonant frequency, so that the electric energy is transferred through resonance

Turn the surrounding electromagnetic waves into electric current and transmit it through the secondary circuit

transmission power

Several W~hundreds of KW

Number KW

More than 100mW

Transmission distance

less than 1cm

3-4m

greater than 10

m

features

Short-distance charging, high conversion efficiency

Medium power, conversion efficiency

Remote charging, automatic charging at any time and any place

2.1.1 Principle of electromagnetic induction

At present, the most commonly used charging method is electromagnetic induction. Under the action of Faraday's electromagnetic induction, when the current passes through the coil, a magnetic field will be formed. The generated magnetic field is a voltage, a current is a current, and a current is an energy. The primary winding and the secondary winding induce current to transmit energy from the transmitting end to the receiving end. Current passing through the coil creates a magnetic field. In the vicinity of this magnetic field, the unenergized coil will generate current. Due to the physical phenomenon of "electromagnetic induction", energy can be transmitted from the power-generating coil on the left to the power-receiving coil on the right.

WPC completes energy conversion in this way. At present, it is mainly aimed at low power consumption applications below 5 W. At the same time, it is also working hard to formulate standards for high-power products. The device can charge multiple electronic devices in one plane, and the distance between the transmitting end and the receiving end of the charged product is relatively close. This solution has already had many application examples in practice, but there is still a lack of a major manufacturer to lead it. Now many manufacturers are just around the corner, and there will be a huge demand in the near future.

Figure 2-2 Implementation principle of electromagnetic induction wireless charging

2.1.2 Principle of magnetic resonance

The MRI method was developed in 2007 by MIT physicist Marin Soljashik. The NMR method works on the same principle as the resonance of sound waves. Each tuning fork vibrates at the same frequency, and when one makes a sound, the others resonate. Similarly, in a magnetic field, coils with the same vibration frequency can be powered from one side. The transmission distance can also be increased by resonance. The maximum power range of electromagnetic induction is 1-10 cm, while the magnetic induction mode, if the coil is large enough, can provide power several meters away. In addition, the NMR method, unlike the electromagnetic induction method, does not require precise matching of the positions of the coils.

Resonant wireless charging, which has the same frequency as the resonant coil of the smart device, can be charged by resonance, so even if the smartphone does not touch the charging pad, it can be charged.

Figure 2-3 Implementation principle of magnetic resonance wireless charging

2.1.3 Radio wave principle

Radio waves are another more mature technology, and their basic principles are similar to those of early mineral radios. The company has developed a small, high-efficiency receiving circuit that picks up waves reflected off walls and maintains a constant DC voltage as the load changes. As long as a transmitter installed in a wall socket and a "mosquito" receiver can convert radio waves into direct current to charge the batteries of various electronic devices. The main defect of this scheme is that the transmission power is too small.

2.2 Overall plan analysis

2.2.1 Principle model analysis

The principle of electromagnetic induction applied in this project does not need to include the oscillation circuit when performing theoretical analysis and calculation on the wireless charging system, so it can be divided into two parts: transmission and reception.

Figure 2-4 The wireless charging principle of this system

2.2.2 System Design Requirements

This scheme mainly uses rectification and filtering, step-down circuit, power amplifier circuit, and coil to transmit energy to 220 V AC mains power, the final output power is 5 V, the maximum output current is not more than 500 mA, and the output frequency is 87~205 kHz , The output voltage fluctuation is not more than 10%.

2.2.3 System principle analysis

The wireless charging base (transmitter winding) is mainly composed of an oscillation circuit, a step-down circuit, a power amplifier circuit and an EMT transmitter coil. The 220V mains is controlled by the power amplifier circuit to convert the mains power into a suitable AC power value, and The alternating current is rectified and filtered to increase its frequency and then transmitted to the transmitting coil. Inside the transmitting coil, due to the alternating current passing through, an alternating magnetic field is formed in the transmitting coil. In this alternating magnetic field, the receiving coil generates electromagnetic induction, thus generate current. At the receiving end, the sensed AC power is converted into DC through the charging circuit, and then wireless charging is realized through the load at the output end. Figure 2-5 shows the basic principle of the wireless power transfer system.

Figure 2-5 Schematic diagram of wireless power transfer system

2.3 Scheme design

The solution includes: MCU minimum system + ADC0832 + wireless charging coil + USB output + LCD + power supply.

1) Charging of wireless mobile phones: use the principle of electromagnetic induction of wireless charging coils to charge mobile phones.

2) LCD display function: display the current voltage and current in real time.

3) ADC0832ADC0832 analog converter is used to collect the charging voltage and current when the mobile phone is charging. After data processing by the MCU, the voltage and current are displayed on the LCD screen.

Three, hardware design

3.1 Design of main control module

In order to ensure that the STC89C52 single-chip microcomputer has the most basic working performance when it works at 5 V, it can use some components on the STC89C52, including the pull-up resistance circuit, reset circuit and crystal oscillator circuit, to form a minimum single-chip microcomputer system.

Figure 3-1 Minimum system block diagram of a microcontroller

The CPU is mainly shown in Figure 3-2. There is a crystal oscillator in the lower left corner. The crystal oscillator and capacitor are used together. The capacitor value between 3-50 pf is acceptable, but 30 pf is the most stable. The circuit on the upper left is reset, and pin 9 of the MCU is at high level. Press the pin 9 of the button to reset at 5 V. This is a manual reset, and the resistors and capacitors will automatically reset to form A differential circuit, in an instant, the capacitor is a short circuit, equal to 5 V on the 9 pins. The relationship between capacitance and resistance uses a time parameter here: the product of resistance and capacitance is the reset moment, and the value of the resistance determines the duration of the delay.

Figure 3-2 Main control CPU module

3.2 Power module design

As can be seen from Figure 3-3, the main function of the power supply module is to provide power. It consists of two parts, one is for MCU and other modules, and the other is 12 V. The 12 V voltage is stabilized to 5 V through L7805. The 5 V of the MCU requires a voltage of 5 V. Among them, c4 and c5 are filter capacitors, c4 is 470 uf, which is used to filter low-frequency unstable voltage, and c5 is used to filter high-frequency unstable voltage. There is a resistor connected across the power indicator to limit the current and avoid burning the indicator.

Figure 3-3 Schematic diagram of the power module circuit

3.3 LC oscillator circuit design

The RF output of this energy transfer device passes through a transfer coil (inductor) and a capacitor, and continuously forms a resonant tank. In order to increase the power of the energy receiver, a parallel resonant circuit is used.

When the resonant frequency of the frequency-selective circuit is the same as the frequency of the excitation signal, resonance is achieved through resonance, so that the current and voltage reach the maximum value, thereby generating the maximum AC electromagnetic field. When the receiving end winding is close to the transmitting coil, an induced voltage will be generated in the receiving coil. When the resonant frequency of the receiving coil circuit is equal to the transmitting frequency, a resonance phenomenon will appear, so that the output voltage reaches the maximum value. In this way, when both the sending coil loop and the receiving coil loop are in a resonant state, the energy transmission efficiency is optimal. The coil has higher energy transfer and longer transmission distance.

Figure 3-4 Schematic diagram of LC oscillation circuit module

3.4 Liquid crystal display module

The main function of the LCD display module is to display the collected voltage and current on the display screen.

LCD 1602 The LCD display uses LCD 1602, which has 16 pins, the first, fifth, and 16 pins are grounded, the second and 15 are power supply, and the seventh to 14 are the data bus D0~D7 pins. And the P0.0~P0.7 pins output control commands through high and low levels; the fourth RS pin is used as an input port, and the register [11] is selected through the P2.6 pin; the sixth pin The start signal is connected to P2.7 of the MCU. The circuit structure of the LCD module is shown in Figure 3-5.

Figure 3-5 Circuit schematic diagram of LCD module

3.5 Selection of wireless charging coil

When the wireless charging coil is supplied with power, it will form a spiral magnetic field. Within a certain period of time, the number of its magnetic field and current will increase accordingly, and the strength of the magnetic field will also increase with the tendency of the current. increase. The wires used for the coil are usually insulated to increase the space available. According to the calculation method of the radio coil:

45/cross section=turns per volt/volt times×220=primary turns/volt turns×18=secondary turns selection.

The module adopts Ketai 412 wireless power supply circuit, the circuit is simple, and the load capacity is large. The main parameters of the module are as follows:

Input voltage: 5-12V;

Launching module: 10mm*21mm;

Transmitting coil: with 4.4 uH inductance, outer diameter 27.5 mm;

Accept stabilizer: 10mm*24mm;

Receiving coil: with 4.4 uH inductance, outer diameter 27.5 mm;

6mm 5V200mA receiver output

5mm 5V500mA receiver output

4mm 5V800mA receiver output

The receiving output is 5V1A at 3mm

Receive output of 5 V1.5 A at 2mm

3.6 Design of wireless transmission detection module

The wireless transmission module is connected to a 12 V power supply, and the LC circuit is used to oscillate inside, so that the square wave pulse resonates into a sine wave, which is output to the outside in the form of electromagnetic energy, thereby supplying power to the receiving circuit. The magnetic fields at the receiving end and the transmitting end are cut to generate a voltage of 5 V, which is then divided by two sampling resistors, and the voltage change is displayed on the LCD screen, and then a load such as a mobile phone is connected through the USB interface. There are 3 small resistors below, and the current detection should be connected in series, so use 3 small resistors as sampling resistors, and display CH0 and CH1 on LCD respectively.

Figure 3-6 Wireless transmission and detection module

3.6.1 Voltage and current detection module

As shown in Figure 3-7 , the voltage and current detection module is a digital-to-analog converter, in which both CH0 and CH1 convert the changed voltage and current signals into digital signals for display. This is just a simple program that doesn't need much explanation.

Figure 3-7 Voltage and current detection module

3.6.2 Sampling circuit design

74HC00 NAND gate has several features

1. To drive the field transistor IRF530, because the IO drive power is not enough, 74HC00 is used as the drive amplifier.

Two: When shutting down, the output of IRF530 is cut off. This is because the output of this special pin is high when the IO is disconnected. When the IO is added to 74HC00, it becomes low. , the IRF530 is reliably turned off to ensure that there is no short circuit.

R1 is a sampling resistor. When the secondary winding is loaded, the current of the primary winding will increase. Therefore, by measuring the current of the primary winding, it can be determined whether the secondary winding is loaded.

Comparing circuit, which includes an operational amplifier LM358, which uses a sampling resistor to convert the current into a voltage, and compares it with the reference voltage to obtain whether there is a load at present.

Figure 3-8 Schematic diagram of sampling circuit design

3.6.3 Transmitting circuit module design

Figure 3-9 Schematic diagram of sending circuit design

3.6.4 Receiver circuit module design

The rectifier circuit converts high-frequency AC current into DC current, and then stabilizes the voltage with capacitor filtering to make it more stable, and then stabilizes the DC current rectified by the rectifier bridge to 5 V.

Figure 3-10 Schematic diagram of receiving circuit module

4. Code design and system display

main program design


#include"LCD1602.h"  //添加LCD1602头文件
//#include "eepom52.h"//
#include"adc0832.h"//添加ADC0832头文件

sbit LED = P1^3;	 //蜂鸣器驱动端口==P1^2

/************************************************
** 函数名称 : void main(void)
** 函数功能 : 主函数
** 输    入 : 无
** 输    出 : 无
** 说    明 :
************************************************/
void main(void)
{
	uint adc_val=0;
	uchar disp1[16]={"   OUT-V: . v   "};//显示数组
	uchar disp2[16]={"  OUT-A:   . ma "};//显示数组	                 
	LCD_Init();//lcd初始化		 	   
		 					 				  
	//byte_read(0x2000);//读取报警数据

	while(1)
	{
		WriteChar(1,0,16,disp1); //在第二行显示
		WriteChar(2,0,16,disp2); //在第二行显示

		adc_val=adc0832(1)*100/256;//读取电压值
		disp1[9]=adc_val/10+0x30;
		disp1[11]=adc_val%10+0x30;
							
		adc_val=adc0832(0)*750/256;//读取电流值
		adc_val*=10;
		disp2[8]=adc_val/1000+0x30;
		disp2[9]=adc_val/100%10+0x30;
		disp2[10]=adc_val/10%10+0x30;
		disp2[12]=adc_val%10+0x30;

		if(adc_val>100)LED=0;
		else LED=1;
	}
}

#ifndef __LCD1602_H__
#define __LCD1602_H__
#include"delay.h"  		  //添加延时函数头文件
#define LCD_PINDATA P0	  //数据端口定义 
sbit RS  =  P1^4;		  //RS 
sbit RW  =  P1^5;		  //RW 
sbit E   =  P1^6;		  //E  
/************************************************
** 函数名称 : WriteCOMDATA(uchar LCD_DATA,uchar N)
** 函数功能 : LCD1602写指令、数据函数
** 输    入 : LCD_DATA:指令或者数据
               N:指令方式还是数据方式 
			   N=0时,LCD_DATA为指令,N=1时,LCD_DATA为数据
** 输    出	: 无
** 说    明 : 
************************************************/
void WriteCOMDATA(uchar LCD_DATA,uchar N)
{
	Delay(10);
	E=1;
	RW=0;
	RS=N;
	LCD_PINDATA=LCD_DATA;
	E=0;
}
/************************************************
** 函数名称 : void LCD_init(void)
** 函数功能 : LCD1602初始化操作
** 输    入 : 无
** 输    出 : 无
** 说    明 :
************************************************/
void LCD_Init(void)
{
    WriteCOMDATA(0x01,0);
	Delay(500);
	WriteCOMDATA(0x38,0);
	Delay(10);
	WriteCOMDATA(0x06,0);
	Delay(10);
	WriteCOMDATA(0x0c,0);
	Delay(10);
}
/************************************************
** 函数名称 :void WriteChar(uchar Row,uchar Col,uchar Num,uchar *pBuffer)
** 函数功能 :在任意位置写指定个字符
** 输    入 :Row : 要写的字符所在的行,只能为1或2;
              Col : 要写的字符所在的列,只能为0---15
              Num : 要写字符的个数
              pbuffer : 要写字符的首地址
** 输    出 :无
** 说    明 :
************************************************/
void WriteChar(uchar Row,uchar Col,uchar Num,uchar *pBuffer)
{
	uchar i;
	if(Row==1)Row=0x80+Col;
	else Row=0xC0+Col;
	WriteCOMDATA(Row,0);
	for(i=Num;i!=0;i--)
	{	
		WriteCOMDATA(*pBuffer,1);	
		pBuffer++;
	}
}
#endif

physical display

 

 

 

 

 

V. Project Summary

In recent years, there have been researches and discussions on wireless charging technology at home and abroad, including macro-distance and short-distance wireless charging. Radio has penetrated into every corner of the world, and it has been integrated with the communication system. From the initial radio and telegraph, to today's highly developed high-tech satellite and microwave communication, it has completely changed human life and production. However, wireless communication can only transmit very little information, and the farther the distance, the greater the energy consumption required by the device, and the less energy it can receive.

This thesis takes the single-chip microcomputer as the core, and uses the electromagnetic induction principle of the wireless charging coil to charge the mobile phone. First of all, on the basis of referring to the relevant materials at home and abroad, the overall design of the wireless charging equipment is studied, and its functions are initially analyzed, and its hardware design is carried out. Finally, through the actual welding and testing, the system design of the wireless charging device based on the single-chip microcomputer is completed. Through the actual system test, the design has realized the following functions:

1) The mobile phone is charged: the mobile phone is charged by using the electromagnetic induction principle of the wireless charging coil.

2) Data display on the LCD display: display the current voltage, current, etc.

3) The ADC0832ADC0832 analog converter is used to collect the charging voltage and current when the mobile phone is charging, and the voltage and current are displayed on the LCD screen after data processing by the single-chip microcomputer.

Although the effect of wireless charging is not as good as that of wired charging, its novelty and simplicity still attract the attention of many manufacturers and the company's investment. It is this huge drive that many scholars have begun to study the wireless charging of mobile phones and promote the wireless charging technology of mobile phones. The currently developed mobile wireless charging devices are based on electromagnetic induction, transmission and reception. The coil of the terminal assembly is used for power supply. Coil size, placement, etc. will have an impact on the energy transfer of the system. Therefore, in the future work, how to improve the positioning accuracy of the coil and improve the flexibility of the mobile phone is the work to be done in the future.

Guess you like

Origin blog.csdn.net/BS009/article/details/132244941