Design of Solar Energy Environmental Parameters Tester Based on AT89S52 Single Chip Microcomputer

Publisher:平安守护Latest update time:2010-06-25 Keywords:AT89S52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

In order to ensure that the solar power generation system can work normally, it is necessary to measure the various environmental parameters of the solar power generation system so as to effectively control its operation. This paper introduces a solar parameter tester based on a single-chip microcomputer, which provides three parameter measurement functions and a communication interface, as well as two power supply methods. It can be used as a handheld device and can also be installed in a power generation system, and has high practical value.


1 Hardware Circuit Design

1.1 Overall structure

The tester is based on the AT89S52 single-chip microcomputer, with external temperature and humidity sensor SHT11, illumination sensor TSL2561, four-digit common cathode digital tube, RS485 bus communication interface and display switch button. After the single-chip microcomputer is powered on, the current temperature, humidity and light intensity are measured in real time, and the three measured parameters are displayed in turn through the LED digital tube through the key switch; in addition, it can also communicate with the PC through the RS485 bus and transmit the parameter value to the host computer to achieve the purpose of remote monitoring. The structural block diagram of the tester is shown in Figure 1.

1.2 Measurement module

The temperature and humidity measurement uses the SHTll sensor produced by the Swiss company Sensirion. The sensor uses the unique CMOsens TM technology, integrating the temperature and humidity sensor, signal amplification processing, A/D conversion, and I2C bus on a single chip, which can be directly interfaced with the single-chip microcomputer. The chip uses digital output, which provides convenience for programming.

The light intensity sensor TSL2561 produced by TAOS is used for illuminance measurement. It has a digital output port and a standard I2C bus interface, covering a wide illuminance range of 1 to 70,000 lx, which is very suitable for measuring light intensity in outdoor environments and for solar power generation systems. Figure 2 shows the interface circuit design between the sensor and the AT89S52 microcontroller.


1.3 Power Module

The power module provides two power supply modes:

① When the tester is used as a handheld device, a 3.6V lithium battery can be used directly. After the DC-DC voltage conversion chip MAX756 increases the voltage to 5V, it can power the microcontroller and peripherals.

② When the tester is installed as a fixed device at a solar power generation site, it can be powered by solar energy. The 12 V voltage generated by the solar cell passes through the voltage regulator chip LM7805 to obtain a stable 5 V voltage output. The output voltage can not only power the test module but also charge the lithium battery through the charging circuit. Figure 3 is the hardware schematic diagram of the power module.

1.4 Charging Circuit

The core device of the charging circuit is the dedicated charging chip CN3058 produced by Shanghai Ruyun Company, which can charge a single-cell lithium iron phosphate rechargeable battery with constant current/constant voltage. The device has an integrated power transistor, and does not require the design of peripheral current detection and protection circuits when used, making it suitable for portable applications.

Figure 4 is a lithium battery charging circuit, where LED1 and LED2 are used as indicator lights for charging and saturation respectively, R1 plays a role of current limiting protection during charging; capacitors C1 and C2 are multilayer ceramic capacitors (MLCC), which can ensure stable operation of the charging circuit.

1.5 Communication Module

The tester communicates with the PC via the RS485 industrial bus, and its hardware interface circuit is shown in Figure 5.


2 Software Design

2.1 Overall design

The software development environment of the tester is Keil C, and all codes are written in C language. In order to facilitate program debugging and improve reliability, the software adopts a modular structure design, which is mainly composed of initialization program, main program, subroutine, interrupt service program, etc. After the microcontroller is powered on, it starts to execute the temperature, humidity and illumination measurement program in a loop, and dynamically displays them on the digital tube in turn at set time intervals; the key switching and communication function parts are relatively low in frequency of use, so in order to reduce the power consumption of the equipment, their programs are executed in the form of interrupt response. Here, it is necessary to pay attention to the setting of interrupt priority: the key interrupt priority should be higher than the serial port interrupt, otherwise the display switching will not be possible. The main program flow is shown in Figure 6.

2.2 Sensor Driver

The sensors used in this system are all integrated digital chips and have I2C bus interfaces, so the writing of their drivers must strictly follow the timing of the I2C bus. The main program opens up an 8-bit storage space for each parameter. The sensor outputs the collected data serially through the SDA pin. The driver converts the data output on the SDA line into serial-to-parallel and stores it in the corresponding space to facilitate other functional program calls. The following is part of the code for the illumination sensor data acquisition program.

(1)TSL2561 initialization

2.3 RS485 communication program

The communication between the tester and the host computer adopts RS485 protocol. The serial port parameters are: baud rate 9600, data bit 8, 1 check bit, 1 stop bit. Its data format is shown in Figure 7.

Since the RS485 bus protocol and the RS232 serial port protocol only differ in the interface level, their software programming is completely carried out in accordance with the serial port communication protocol and will not be described in detail here.


Conclusion

Through experimental tests, the temperature measurement and display accuracy of the environmental parameter tester can reach 0.1℃, the humidity is accurate to 0.1%, and the illumination can be accurate to 11x. Since the main components are all I2C digital interfaces, this tester also has the characteristics of simple structure, easy maintenance, strong scalability, etc., and has high practical value; in addition, the unique dual power supply mode further expands its scope of application.

Keywords:AT89S52 Reference address:Design of Solar Energy Environmental Parameters Tester Based on AT89S52 Single Chip Microcomputer

Previous article:Design of multi-point temperature control system based on 51 single chip microcomputer
Next article:Temperature telemetry and remote control system based on C8051F040 single chip microcomputer

Recommended ReadingLatest update time:2024-11-17 00:55

Hardware Design of LED Display Screen Based on AT89S52 Single Chip Microcomputer and ATF1508AS Programmable Logic Device
0 Introduction The LED display screen is mainly composed of three parts: current drive circuit and LED dot matrix array, control system and PC management software (Figure 1). The control system is responsible for receiving, converting and processing various external signals, and realizing scanning control, and t
[Microcontroller]
Hardware Design of LED Display Screen Based on AT89S52 Single Chip Microcomputer and ATF1508AS Programmable Logic Device
Design of automobile taillight controller based on AT89S52 single chip microcomputer
  0 Introduction   With the continuous progress of modern society, people are increasingly inseparable from cars. However, with the rapid increase in the number of cars, road safety has attracted more and more attention. It is now recognized that it is unrealistic to rely solely on the structural factors of the car
[Microcontroller]
Design of automobile taillight controller based on AT89S52 single chip microcomputer
Design of monitoring system based on USB and RS485 bus
Abstract: PID regulating instrument and sensor can be used together to measure and display the temperature of bell-type furnace on steel product production line. Through the corresponding actuator, PID regulation and control, alarm control, data acquisition and recording of relevant bell-type furnace equipment can b
[Industrial Control]
Design of monitoring system based on USB and RS485 bus
Several issues needing attention in RS485 communication reliability design
RS-485 interface chip can play a role of level conversion, converting TTL signals, COMS signals, etc. into differential signals that can be transmitted on the 485 bus, and converting the received 485 differential signals into TTL or COMS levels that can be recognized by MCU. It has been widely used in many fields such
[Analog Electronics]
Several issues needing attention in RS485 communication reliability design
A Design to Improve RS485 Bus Communication Speed
introduction Industrial sites often need to collect multi-point data, analog signals or switch signals. Generally, RS485 bus is used, using a master-slave communication method. This method is easy to wire and only requires two shielded cables. The maximum communication distance can support 1500m. Adding a repea
[Microcontroller]
A Design to Improve RS485 Bus Communication Speed
Design of a household intelligent watering device based on AT89S52
Abstract: A home intelligent watering device is designed to realize automatic watering of flowers. The single-chip microcomputer is used to realize automatic watering of flowers. Different control modes are set according to different flower species, namely, timed quantitative watering and watering according to humid
[Industrial Control]
Design of a household intelligent watering device based on AT89S52
Design of Voice Digital System Based on AT89S52 and K9F6408UOA
Data acquisition technology involves a wide range of fields, a wide dynamic range of collected signals, a large amount of processed data, and high requirements for system real-time performance. Processing signals in the form of digital signals has the advantages of fast processing speed, flexibility, accuracy, stron
[Microcontroller]
Design of Voice Digital System Based on AT89S52 and K9F6408UOA
Design of intelligent queue management system based on EasyARM615
1 System solution analysis According to the current domestic and international technical level, the queue management system can be divided into wired system and wireless system , and the functions they realize are exactly the same. The biggest advantage of wireless communication is that it is easy an
[Microcontroller]
Design of intelligent queue management system based on EasyARM615
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号