EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Hi guys, i too making project

Hi guys, i too making project

|

Microcontroller › 8051 › water level controller using 8051 › Hi guys, i too making project

February 8, 2014 at 5:29 am #10975
Anu
Participant

Hi guys, i too making project on water level controller,… with 8051- i.e., AT89S51

i have circuit diagram,even assembly language program… and i hve a small try to write c program….. anybody help me please……

here the circuit daigrm and assembly lvel progrm

wysiwyg_imageupload:11577:

Program.

MOV P2,#11111111B // initiates P2 as sensor input

MOV P0,#11111111B // initiates P2 as the output port

MOV A,#00000000B

MAIN:ACALL SMPCK // checks the level of the sump tank

MOV A,P2 // moves the current status of P2 tp A

CJNE A,#11110000B,LABEL1 // checks whether tank is full

SETB P0.1

SETB P0.2

SETB P0.3

SETB P0.4

CLR P0.0 // glows full level LED

SETB P0.5

LABEL1:MOV A,P2

CJNE A,#11111000B,LABEL2 // checks whether tank is 3/4

SETB P0.0

SETB P0.2

SETB P0.3

SETB P0.4

CLR P0.1 // glows 3/4 level LED

LABEL2:MOV A,P2

CJNE A,#11111100B,LABEL3 // checks whether tank is 1/2

SETB P0.0

SETB P0.1

SETB P0.3

SETB P0.4

CLR P0.2 // glows 1/2 level LED

LABEL3:MOV A,P2

CJNE A,#11111110B,LABEL4 // checks whether tank is 1/4

SETB P0.0

SETB P0.1

SETB P0.2

SETB P0.4

CLR P0.3 // glows 1/4 level LED

JB P0.6,LABEL4

CLR P0.5 // switches motor ON

LABEL4:MOV A,P2

CJNE A,#11111111B,MAIN // checks whether tank is empty

SETB P0.0

SETB P0.1

SETB P0.2

SETB P0.3

CLR P0.4 // glows EMPTY LED

JB P0.6,MAIN // checks whether sump is low

CLR P0.5 // switches motor ON

SJMP MAIN

SMPCK:JB P0.6,LABEL5 // checks whether sump is low

SETB P0.7 // extinguishes the sump low indicator LED

SJMP LABEL6

LABEL5:SETB P0.5 // switches the pump OFF

CLR P0.7 // glows sump low indicator LED

LABEL6:RET

END

RSS feed: Recent Posts Recent Posts

  • Request for a 5W transistor controlled LED flash light controller circuit review October 10, 2026
  • Delco alternator (12SI) AC-tap - what is the mate to this connector called and where to find it? October 10, 2026
  • Frustration, single phase, high KW, high voltage battery charge module, rectifier. October 10, 2026
  • On off switch hack October 10, 2026
  • Almost Very New in PCB / KICAD DESIGN October 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy | Advertising

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise