Ron or carl
Is the VB6 can direct burn the coding inside the PIC(i have no experience for VB6)?can u guy give some example coding about fuzzy PID? cause i had no idea how to write a program which contain fuzzy PID characteristics.
No, VB6 or any form of Microsoft Visual Basic is not used with PICs.
To program a PIC you would use a language designed for a PIC. PIC Basic is one of several. PIC Basic is not the same as or anything like Visual Basic.
Now from the beginning. Your assignment is to design a system to maintain a water level in a tank correct? I assume this is just a school assignment. As water flows out of the tank at different rates you need to add water to the tank.
So, you will need a sensor to measure the level of water in the tank. There is likely a dozen ways to do this. You can do as Carl suggested and place three sensors (maybe conductive probes) at three levels in the tank as low, medium and high. You can use a pressure sensor as I suggest at the bottom of the tank and measure pressure or as stranor points out you can use a ultrasonic sensor at the top of the tank that measures the distance between the sensor and water level. Those are just three possibles. Stranor introduced a new method.
The sensor used will output a signal. That signal will be proportional to the water level in the tank. It can be Carl's method giving a 1 or 0 for each level or it can be an analog signal like a voltage or current. This all depends on the sensor used. If you are the project engineer you make the decision based on cost, environment, equipment and a collection of variables. The end result is the output of the sensor(s) will provide a signal directly proportional to the water level in the tank. The signal may or may not require signal conditioning.
Later I will continue with a full example. Just remember you need to start at the beginning.
Ron