04-11-2016, 11:30 AM
1464422788-SolarTrackingSystem.docx (Size: 699.05 KB / Downloads: 4)
Aim:
The aim of the project is to design a low cost solar tracking system
Solar tracking is the most appropriate technology to enhance the electricity production of a PV system. To achieve a high degree of tracking accuracy, several approaches have been widely investigated. Generally, they can be classified as either open-loop tracking types based on solar movement mathematical models or closed-loop tracking types using sensor-based feedback controllers. In the open-loop tracking approach, a tracking formula or control algorithm is used. Referring to the literature, the azimuth and the elevation angles of the Sun were determined by solar movement models or algorithms at the given date, time and geographical information.
The control algorithms were executed in a microprocessor controller. In the closed-loop tracking approach, various active sensor devices, such as charge couple devices (CCDs) or light dependent resistors (LDRs) were utilized to sense the Sun’s position and a feedback error signal was then generated to the control system to continuously receive the maximum solar radiation on the PV panel. This paper proposes an empirical research approach on this issue.
The system consists LDR sensor to track the sun light intensity a DC motor over which the solar panel is installed and a microcontroller that manages and controls the activity of these devices. As the sun intensity changes the LDR senses this change in intensity and forwards the information to the microcontroller. The microcontroller on the other hand processes the data obtained from the LDR and activates the DC motor accordingly where by the position of and the angle of the solar panel installed to the motor changes. The microcontroller is programmed in such a way that it maintains the position of the panel in such a way that it receives maximum solar energy in that position.
Chapter 2
Introduction to Embedded Systems
Before introducing the technology, it is important first to cover exactly what embedded systems are, and how they are used. This will attempt to cover a large number of topics, some of which apply only to embedded systems, but some of which will apply to nearly all computers (embedded or otherwise). As such, there is a chance that some of the material from this book will overlap with material from other sources that are focused on topics such as low-level computing, assembly language, computer architecture, etc. But we will first start with the basics, and attempt to answer some questions before the book actually begins.
The first question that needs to be asked, is "What exactly is an embedded computer?" An embedded computer is frequently a computer that is implemented for a particular purpose. In contrast, an average PC computer usually serves a number of purposes: checking email, surfing the internet, listening to music, word processing, etc... However, embedded systems usually only have a single task, or a very small number of related tasks that they are programmed to perform.
Every home has several examples of embedded computers. Any appliance that has a digital clock, for instance, has a small embedded micro-controller that performs no other task than to display the clock. Modern cars have embedded computers onboard that control such things as ignition timing and anti-lock brakes using input from a number of different sensors.
Embedded computers rarely have a generic interface, however. Even if embedded systems have a keypad and an LCD display, they are rarely capable of using many different types of input or output. An example of an embedded system with I/O capability is a security alarm with an LCD status display, and a keypad for entering a password.
Various Definitions of Embedded Systems
“Embedded Systems are the electronic systems that contain a microprocessor or a microcontroller, but we do not think of them as computers – the computer is hidden or embedded in the system.” – Todd D. Morton,
“An embedded system is a system that has software embedded into computer-hardware, which makes a system dedicated for an application (s) or specific part of an application or product or part of a larger system.” –
“An embedded system is one that has a dedicated purpose software embedded in a computer hardware.”
“It is a dedicated computer based system for an application(s) or product. It may be an independent system or a part of large system. Its software usually embeds into a ROM (Read Only Memory) or flash.”
“It is any device that includes a programmable computer but is not itself intended to be a general purpose computer.” – Wayne Wolf
In general, an Embedded System: It is a combination of hardware and software that performs a specific task.
1. Is a system built to perform its duty, completely or partially independent of human intervention.
2. Is specially designed to perform a few tasks in the most efficient way.
3. Interacts with physical elements in our environment, e.g. controlling and driving a motor, sensing temperature, etc.
4. An embedded system can be defined as a control system or computer system designed to perform a specific task. Common examples of embedded systems include MP3 players, navigation systems on aircraft and intruder alarm systems. An embedded system can also be defined as a single purpose computer.
Most embedded systems are time critical applications meaning that the embedded system is working in an environment where timing is very important: the results of an operation are only relevant if they take place in a specific time frame. An autopilot in an aircraft is a time critical embedded system. If the autopilot detects that the plane for some reason is going into a stall then it should take steps to correct this within milliseconds or there would be catastrophic results.
Embedded systems are considered when the cost of implementing a product designed in software on a microprocessor and some small amount of hardware, is cheaper, more reliable, or better for some other reason than a discrete hardware design. It is possible for one small and relatively cheap microprocessor to replace dozens or even hundreds of hardware logic gates, timing circuits, input buffers, output drivers, etc. It also happens that one generic embedded system with a standard input and output configuration can be made to perform in a completely different manner simply by changing the software.
The uses of embedded systems are virtually limitless, because every day new products are introduced to the market that utilize embedded computers in novel ways. In recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip and write your own custom software for it. Producing a custom-made chip to handle a particular task or set of tasks costs far more time and money. Many embedded computers even come with extensive libraries, so that "writing your own software" becomes a very trivial task indeed.
Some embedded systems run a scaled down version of operating system called an RTOS (real time operating system).
From an implementation viewpoint, there is a major difference between a computer and an embedded system. Embedded systems are often required to provide Real-Time response. A Real-Time system is defined as a system whose correctness depends on the timeliness of its response. Examples of such systems are flight control systems of an aircraft, sensor systems in nuclear reactors and power plants. For these systems, delay in response is a fatal error. A more relaxed version of Real-Time Systems, is the one where timely response with small delays is acceptable. Example of such a system would be the Scheduling Display System on the railway platforms. In technical terminology,Real-Time Systems can be classified as:
1. Hard Real-Time Systems - systems with severe constraints on the timeliness of the response.
2. Soft Real-Time Systems - systems which tolerate small variations in response times.
3. Hybrid Real-Time Systems - systems which exhibit both hard and soft constraints on its performance.
• Another problem with embedded computers is that they are often installed in systems for which unreliability is not an option. For instance, the computer controlling the brakes in your car cannot be allowed to fail under any condition. The targeting computer in a missile is not allowed to fail and accidentally target friendly units. As such, many of the programming techniques used when throwing together production software cannot be used in embedded systems. Reliability must be guaranteed before the chip leaves the factory. This means that every embedded system needs to be tested and analyzed extensively.
An embedded system will have very few resources when compared to full blown computing systems like a desktop computer. The memory capacity and processing power in an embedded system is limited. It is more challenging to develop an embedded system when compared to developing an application for a desktop system as we are developing a program for a very constricted environment.
Embedded systems are playing important roles in our lives every day, even though they might not necessarily be visible. Some of the embedded systems we use every day control the menu system on television, the timer in a microwave oven, a cellphone, an MP3 player or any other device with some amount of intelligence built-in. In fact, recent poll data shows that embedded computer systems currently outnumber humans in the USA. “Embedded systems is a rapidly growing industry where growth opportunities are numerous.”
Trends in Embedded Systems
Increasing code size average code size: 16-64KB in 1992, 64K-512KB in 1996
• migration from hand (assembly) coding to high-level languages
• Reuse of hardware and software components processors (micro-controllers, DSPs)
• software components (drivers)
• Increasing integration and system complexity integration of RF, DSP, network interfaces
• 32-bit processors, IO processors (I2O)
• Structured design and composition methods are
Characteristics of Embedded Systems
Application specific Efficient energy, code size, run-time, weight, cost
• Dependable Reliability, maintainability, availability, safety, security
• Real-time constraints Soft vs. hard
• Reactive - connected to physical environment sensors
• & actuators Hybrid Analog and digital
• Distributed Composability, scalability, dependability
• Dedicated user interfaces
Embedded Systems Product Design Life Cycle
New product development: Feasibility study, embedded software architecture, modeling, embedded systems design, embedded systems software engineering, embedded systems software programming, embedded software development systems,release management, and feature driven development
New product adaptation: Re-development and re-engineering of embedded software and systems,latest technology adaptation,custom embedded system software development, performance and reliability improvement, and multiple platform porting services
Product sustenance: Lifecycle enhancements, defect tracking and fixing, feature enhancements, regression testing, and maintenance releases
Testing and verification: Test plan design,embedded system design, test automation and scripting, compatibility and interoperability, compliance testing, and regression testing
Platforms/Hardware
Processor expertise - Intel x86, ARM7 DMI, Freescale, Renesas, Intel network processors, Xscale architecture devices, Intel microcontrollers
Network processor expertise - Intel IXP series, Vitesse, Mind speed, Motorola C Port C5, Agere Payload, Clearwater, ARM9/11/Cortex, Hitachi, MIPS, TI OMAP
Expertise in RTOS - Linux, OSE, QNX, VxWorks, WinCE, nSOS, Windows NT - RT, Nudes, RT Kernel, DSPBIOS, EPOC, ITRON, ThreadX, OSEK
Software Requirements:
1. Keil-IDE
2. OR-CAD
3. Flash Magic
4. Embedded C
Hardware Requirements
Microcontroller
Power Supply
DC Motor Driver
DC Motor
LCD
LDR
MICROCONTROLLER
Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical.
The Intel 8051 is Harvard architecture, single chip microcontroller (µC) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products.
8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.
The present project is implemented on Keil Uvision. In order to program the device, Proload tool has been used to burn the program onto the microcontroller.
The features, pin description of the microcontroller and the software tools used are discussed in the following sections.
4.1 FEATURES OF AT89s52:
• 8K Bytes of Re-programmable Flash Memory.
• RAM is 256 bytes.
• 4.0V to 5.5V Operating Range.
• Fully Static Operation: 0 Hz to 33 MHz’s
• Three-level Program Memory Lock.
• 256 x 8-bit Internal RAM.
• 32 Programmable I/O Lines.
• Three 16-bit Timer/Counters.
• Eight Interrupt Sources.
• Full Duplex UART Serial Channel.
• Low-power Idle and Power-down Modes.
• Interrupt recovery from power down mode.
• Watchdog timer.
• Dual data pointer.
• Power-off flag.
• Fast programming time.
• Flexible ISP programming (byte and page mode).
4.2 Description:
The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable memory. The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. The on chip flash allows the program memory to be reprogrammed in system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications.
In addition, the AT89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.
4.3 PIN DESCRIPTION:
Vcc Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND Pin 20 is the ground.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes during Program verification. External pull-ups are required during program verification.
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table.
Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. The port also receives the high-order address bits and some control signals during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses the entire AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages). Alternate pairs of diodes conduct, changing over the connections so the alternating directions of AC are converted to the one direction of DC.
LIQUID CRYSTAL DISPLAY (LCD)
INTRODUCTION
LCD is a type of display used in digital watches and many portable computers. LCD displays utilize to sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystals to align so that light cannot pass through them. LCD technology has advanced very rapidly since its initial inception over a decade ago for use in laptop computers. Technical achievement has resulted in brighter displace, higher resolutions, reduce response times and cheaper manufacturing process.