MCU Examples.com
PIC Microcontroller Project Examples, free source codes and resources collection.
The three subsystems were tested separately as follows:
The temperature monitoring and control system was tested by first setting the user temperature to 20degC and the room temperature was recorded as 17℃ as seen from the LCD and the room temperature scale. LEDs were connected to PORTC for testing and simulation purposes as shown in the schematic in the Appendix. Since the current temperature is lower than the user set temperature the heater needs to be turned on and the RC2 pin was set and the LED lit up. Then the user temperature was set to 8℃ and the room temperature was recorded as 17℃ as seen from the LCD and the room temperature scale and in this case the current temperature is less than the target temperature set by the user therefore heater needs to turn off and cooler fans need to be turned on so the RC2 pin was set as low therefore the led was off hence heater is off and RC1 pin is set and the LED connected to it lit up and hence the cooler fans are on.
The LDR was altered by changing the light intensity. Light intensity was altered by changing the distance between the flashlight and the LDR. When the LDR was covered by the palm the LCD displayed 11% (dark) for light intensity and since this value is less than 50% the Light bulbs in the greenhouse need to be turned on so RC3 pin is set as high and the LED was on. The flashlight was bought close enough to the LDR so that the light intensity value read in the LCD is more than 50% (bright light) and when this happen the Light bulbs in the greenhouse need to be turned off so RC3 pin is set as low and the LED was off.
Soil moisture sensor was simulated by using a potentiometer and the moisture level is regulated at 60%. The potentiometer value is altered to a value more than 70% and the result was such that RCX pin was set high so the LED turned on which in turn will turn on the solenoid valve and when the potentiometer value was reduced below 60% the LED connected to RC3 pin turned off which in turn will turn off the solenoid valve.
From the testing procedure it was found that the program works according to the system requirements but when implementing further more real time testing needs to be done.