16-11-2012, 11:20 AM
Microcontroller based Water Level Controller Cum Motor Protection
1Microcontroller based Water Level.docx (Size: 837.59 KB / Downloads: 86)
General Introduction
Many a time we forget to switch off the motor, pushing the water into the overhead tank (OHT) in our households. As a result, water keeps overflowing until we notice the overflow and switch the pump off. As the OHT is usually kept on the topmost floor, it is cumbersome to go up frequently to check the water level in the OHT.
Here’s a microcontroller-based water- level controller-cum-motor protector to solve this problem. It controls ‘on’ and ‘off’ conditions of the motor depending upon the level of water in the tank. The status is displayed on an LCD module. The circuit also protects the motor from high voltages, low voltages, fluctuations of mains power and dry running
Definition of an Embedded System
Embedded Device technology is a transformational technology-a technology that is a revolutionalizing the way we function. Embedded System can be seen everywhere from Watches, Washing Machines, Microwave Ovens and mobile Telephones to automobiles, Aircrafts and Nuclear Power Plants.Embedded4d Systems are the brains behind 90% of all electronic devices worldwide. The explosion of Embedded System technology is expected to happen across product categories like office products, consumer products, industrial automation products, and automobiles, medical instrumentation, vending machines, vehicles, communication infrastructure, etc. An Embedded System is a combination of hardware and software designed to control the additional hardware attached to the systems. The software systems are completely encapsulated by the hardware that controls it. Embedded system means the processor is embedded into that application or it is meant that for specific application.
Embedded system is a system which performs a specific or a pre-defined task. It is the combination of Hardware (Processor, memory, peripherals) and software (Programming languages ex: ALP, C, Cpp, java etc)as shown in Fig 2.1. To obtainthe output load the software into the hardware.
Configurations
A common implementation involves a LED and a phototransistor, separated so that light may travel across a barrier but electrical current may not. When an electrical signal is applied to the input of the opto-isolator, its LED lights, its light sensor then activates, and a corresponding electrical signal is generated at the output. Unlike a transformer, the opto-isolator allows for DC coupling and generally provides significant protection from serious overvoltage conditions in one circuit affecting the other.
Regulator 7805
In electronics, a linear regulator is a system used to maintain a steady voltage. The resistance of the regulator varies in accordance with the load resulting in a constant output voltage. The regulating device is made to act like a variable resistor, continuously adjusting a voltage divider network to maintain a constant output voltage, and continually dissipating the difference between the input and regulated voltages as waste heat. By contrast, a switching regulator uses an active device that switches on and off to maintain an average value of output. Because the regulated voltage of a linear regulator must always be lower than input voltage, efficiency is limited and the input voltage must be high enough to always allow the active device to drop some voltage.
Capacitors
A capacitor (formerly known as condenser) is a passive electronic component consisting of a pair of conductors separated by a dielectric (insulator). When a potential difference (voltage) exists across the conductors, an electric field is present in the dielectric. This field stores energy and produces a mechanical force between the conductors. The effect is greatest when there is a narrow separation between large areas of conductor; hence capacitor conductors are often called plates. An ideal capacitor is characterized by a single constant value, capacitance, which is measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them. In practice, the dielectric between the plates passes a small amount of leakage current. The conductors and leads introduce an equivalent series resistance and the dielectric has an electric field strength limit resulting in a breakdown voltage.
Crystal Oscillator
One of the most important features of any oscillator is its frequency stability, or in other words its ability to provide a constant frequency output under varying load conditions. Some of the factors that affect the frequency stability of an oscillator include: temperature, variations in the load and changes in the DC power supply. Frequency stability of the output signal can be improved by the proper selection of the components used for the resonant feedback circuit including the amplifier but there is a limit to the stability that can be obtained from normal LC and RC tank circuits. To obtain a very high level of oscillator stability a Quartz Crystal is generally used as the frequency determining device to produce other types of oscillator circuit known generally as a Quartz Crystal Oscillator, (XO).
AT 89C51 Microcontroller
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C21 and 80C22 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C21 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. The AT89C21 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a six-vector two-level interrupt architecture, a full-duplex serial port(UART) which operates at 11.0292 Mhz, on-chip oscillator, and clock circuitry. In addition, the AT89C21 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.
Transistors
A transistor is a semiconductor device used to amplify and switchelectronic signals and electrical power. It is composed ofsemiconductor material with at least three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another pair of terminals. Because the controlled (output) power can be higher than the controlling (input) power, a transistor can amplify a signal. Today, some transistors are packaged individually, but many more are found embedded in integrated circuits.
Description:
The circuit of the microcontroller-based water-level controller- cum-motor protector. It comprises operational amplifier LM324, microcontroller AT89C51, optocoupler PC817, regulator 7805, LCD module and a few discreet components. The AT89C51 (IC2) is an 8-bit microcontroller with four ports ( 32 /O lines), two 16-bit timers/counters, on-chip oscillator and clock circuitry. Eight pins of port-1 and three pins of port-3 are interfaced with data and control lines of the LCD module. Pins P3.0, P3.1 and P3.6 are connected to RS (pin 4), R/W (pin 5) and E (pin 6) of the LCD, respectively. Pin EA (pin 31) is strapped to Vcc for internal program executions. Switch S2 is used for backlight of the LCD module. Power-on-reset is achieved by connecting capacitor C8 and resistor R14 to pin 9 of the microcontroller. Switch S1 is used for manual reset. The microcontroller is operated with a 12MHz crystal. Port pins P2.0 through P2.2 are used to sense the water level, while pins P2.3 and P2.4 are used to sense the under-voltage and over-voltage, respectively. Pin P3.4 is used to control relay RL1 with the help of optocoupler IC3 and transistor T5 in the case of under-voltage, over-voltage and different water- level conditions. Relay RL1 operatesoff a 12V supply. Using switch S3, you can manually switch on the motor. The LM324 (IC1) is a quad operational amplifier (op-amp). Two of its op-amps are used as comparators to detect under- and over-voltage. In normal condition, output pin 7 of IC1 is low, making pin P2.3 of IC2 high. When the voltage at pin 6 of N1 goesbelow the set reference voltage at pin 5 (say, 170 volts), output pin 7 of N1 goes high. This high output makes pinP2.3 of IC2 low, which is sensed by the microcontroller and the LCD module shows ‘low voltage.’ In normal condition, pin 1 of N2 is high. When the voltage at pin 2 of N2 goes above the set voltage at pin 3, output pin 1 of N2 goes low.
Working:
When water in the tank is below sensor A, the motor will switch on to fill water in the tank. The LCD module will show ‘motor on.’ The controller is programmed for a 10- minute time interval to check the dry-run condition of the motor. If water reaches sensor B within 10 minutes, the microcontroller comes out of the dry-run condition and allows the motor to keep pushing water in the tank. The motor will remain ‘on’ until water reaches sensor C. Then it will stop automatically and the microcontroller will go into the standby mode. The LCD module will show ‘tank full’ followed by ‘standby mode’ after a few seconds. The ‘standby mode’ message is displayed until water and if the dry-run condition still persists, the display will show ‘drysump3’ and the microcontroller will not start the motor automatically. Now you have to check the line for water and manually reset the microcontroller to start operation. In the whole procedure, the microcontroller checks for high and low voltages.