Plant water level indicator (via smiley ) based on 8085

This post is in continuation with a previous post where i had used BeagleBone black to log changing resistance of soil with respect to soil water content and other factors. Here in this post we will use an 8085 Microprocessor to generate various smiley based to water level in soil.
Schematics:-

Board file layout:-

Problem Statement:-

It is a fast paced world we live in today, and sometimes in the hectic everyday life, we forget about things that are slow, like a plant waiting for being watered. Soil testing equipment is available for testing soil quality, but is very expensive, delicate and is certainly not designed for home use. It is then tough to know when the plant needs more water.

We propose a solution using the Intel 8085 Microprocessor unit, which in conjunction with a network of op-amps measures if the soil is drier than required. The conductivity of soil changes with the amount of moisture, and it is a very reliable indicator of moisture content. The board informs the house owner to water the plant via an LED display.

Conceptual details:-The proposed solution of an automated soil moisture measurement system consists basically of a pair of probes around which there is a particular voltage applied. The soil acts as a resistor, and the value of changing resistance of soil causes the voltage induced on the second probe to change. (Higher the voltage, higher the conductivity, and hence higher the moisture content).

This voltage is then carried over to the amplifying opamp via a voltage follower. The final amplified voltage is fed into four different opamps, which are connected to sliding switches on the input port of the 8085. The four opamps operate as comparators, with different values of threshold voltages, and together generate a binary code signifying how much moisture the soil contains. This is a form of an Analog to Digital Convertor, known as Flash ADC.

The value is then checked against stored values in the 8085 ROM and the output is displayed through a multiplex LED matrix display. The display works with the LM555 timer IC which interrupts the microprocessor at the RST 7..5 interrupt.

Assembly code:-

        .ORG 0000H
        LXI SP,0FFFFH
        JMP LOOP

LOOP:    ;MVI A,0AAH  ;test
        ;OUT 00H
        ;CALL REFRESH
        ;CALL DELAY
        ;IN 03H
        ;OUT 00H        
        ;MOV D,A
        
        CALL CHECK_SLIDE
        CALL REFRESH
        CALL SMILE_PART
        CALL DELAY
        CALL REFRESH
        CALL SAD_PART
        CALL REFRESH
        CALL POKE_PART
        JMP LOOP
        .END



SMILE_PART:    PUSH PSW
        MVI A,0F0H     ;EYE
        ANI 8FH        ;SMILE_PART
        OUT 00H
        POP PSW
        JMP LOOP
        ;RET
        ;JMP SMILE_PART
            

SAD_PART:    PUSH PSW
        MVI A,0F0H     ;EYE
        OUT 00H
        MVI A,0F8H        ;SAD_PART
        OUT 01H
        POP PSW
        JMP LOOP
        ;RET
        ;JMP SAD_PART

POKE_PART:    PUSH PSW
        MVI A,0F0H     ;EYE
        OUT 00H
        MVI A,08FH
        OUT 01H
        POP PSW
        JMP LOOP
        ;JMP POKE_PART 
        ;RET


REFRESH:    PUSH PSW
        MVI A,0FFH
        OUT 00H
        OUT 01H
        POP PSW
        ;JMP REFRESH
        RET

DELAY:        PUSH PSW
        LXI B,0FFFFH
D_loop:        DCX B                
        MOV A,C
        ORA B
        JNZ D_LOOP
        POP PSW
        RET

CHECK_SLIDE:    PUSH PSW
        PUSH D
                
        ANI 80H
        CPI 80H
            JZ CHECK_OPAMP4
        MOV A,D                
        ANI 40H
        CPI 40H
            JZ CHECK_OPAMP3
        
        MOV A,D                
        ANI 20H
        CPI 20H
            JZ CHECK_OPAMP2

        MOV A,D                
        ANI 10H
        CPI 10H
            JZ CHECK_OPAMP1

        POP D
        POP PSW
        RET

CHECK_OPAMP4:    PUSH PSW
        PUSH D
        MOV A,D
        ANI 08H 
        CPI 08H
            JZ POKE_PART
        MOV A,D
        ANI 04H
        CPI 04H
            JZ SAD_PART
        MOV A,D
        ANI 02H
        CPI 02H
            JZ SAD_PART
        MOV A,D
        ANI 01H
        CPI 01H
            JZ SAD_PART            
        POP D
        POP PSW
        RET

CHECK_OPAMP3:    PUSH PSW
        PUSH D
        MOV A,D
        ANI 08H 
        CPI 08H
            JZ SMILE_PART
        MOV A,D
        ANI 04H
        CPI 04H
            JZ POKE_PART
        MOV A,D
        ANI 02H
        CPI 02H
            JZ SAD_PART
        MOV A,D
        ANI 01H
        CPI 01H
            JZ SAD_PART            
        POP D
        POP PSW
        RET 

CHECK_OPAMP2:    PUSH PSW
        PUSH D
        MOV A,D
        ANI 08H 
        CPI 08H
            JZ SMILE_PART
        MOV A,D
        ANI 04H
        CPI 04H
            JZ SMILE_PART
        MOV A,D
        ANI 02H
        CPI 02H
            JZ POKE_PART
        MOV A,D
        ANI 01H
        CPI 01H
            JZ SAD_PART            
        POP D
        POP PSW
        RET 

CHECK_OPAMP1:    PUSH PSW
        PUSH D
        MOV A,D
        ANI 08H 
        CPI 08H
            JZ SMILE_PART
        MOV A,D
        ANI 04H
        CPI 04H
            JZ SMILE_PART
        MOV A,D
        ANI 02H
        CPI 02H
            JZ SMILE_PART
        MOV A,D
        ANI 01H
        CPI 01H
            JZ POKE_PART        
        POP D
        POP PSW
        RET