gaqlabs.blogg.se

C code for 8051 microcontroller water level controller
C code for 8051 microcontroller water level controller












c code for 8051 microcontroller water level controller

This high signal drives transistor BC548 into saturation and its collector goes low. When water in the tank rises to come in contact with the sensor, the base of transistor BC548 goes high. Presets VR1 and VR2 are used for calibrating the circuit for under- and over-voltage, respectively. This low signal is sensed by the microcontroller and the LCD module shows ‘high voltage.’ When the voltage at pin 2 of N2 goes above the set voltage at pin 3, output pin 1 of N2 goes low. In normal condition, pin 1 of N2 is high.

c code for 8051 microcontroller water level controller

This high output makes pin P2.3 of IC2 low, which is sensed by the microcontroller and the LCD module shows ‘low voltage.’

c code for 8051 microcontroller water level controller

When the voltage at pin 6 of N1 goes below the set reference voltage at pin 5 (say, 170 volts), output pin 7 of N1 goes high. In normal condition, output pin 7 of IC1 is low, making pin P2.3 of IC2 high. Two of its op-amps are used as comparators to detect under- and over-voltage. The LM324 (IC1) is a quad operational amplifier (op-amp). 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. Port pins P2.0 through P2.2 of the AT89C51 (IC2) 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. The circuit of the Microcontroller based Water Level Controller cum Motor Protector comprises of the operational amplifier LM324, microcontroller AT89C51, optocoupler PC817, regulator 7805 and an LCD module.

c code for 8051 microcontroller water level controller

The circuit also protects the motor from high voltages, low voltages, fluctuations of mains power and dry running. If(PORTA.F4=0 & PORTA.F3=0 & PORTA.F2=0 & PORTA.F1=0 & PORTA.The Microcontroller based Water Level Controller cum Motor Protector controls ‘on’ and ‘off’ conditions of the motor depending upon the level of water in the over head tank (OHT), the status of which is displayed on an LCD module. Souece Code :ĪDCON1=0x0F // Configure RA) pin as input That's the working process of this system. We get the notification tank is full the motor needs to be turned off. When it's full, all the mcu pins(RA0-RA4) goes to low or 0.














C code for 8051 microcontroller water level controller