Home
UNIVERSITI TEKNOLOGI MALAYSIA
Contents
1. void move for i 0 1 lt 2 i Move text to the Right Lcd Cmd LCD SHIFT RIGHT delay ms 500 for i 0 i lt 2 i Move text to the Left Lcd Cmd LCD SHIFT LEFT delay ms 500 void move2 for i 0 12 i Move text to the Left Led_Cmd LCD_SHIFT_LEFT delay_ms 500 for i 0 1 lt 2 i Move text to the Right Lcd Cmd LCD SHIFT RIGHT delay ms 500 58 APPENDIX B PROGRAMMING FOR GUI Private Sub Form_Load Label1 Caption Data is unavailable amp vbCrLf amp Please Open CommPort amp vbCrLf amp And select option Label2 Caption Data is unavailable amp vbCrLf amp Please Open CommPort amp vbCrLf amp And select option Label3 Caption Data is unavailable amp vbCrLf amp Please Open CommPort amp vbCrLf amp And select option ShapeS Visible False Shape6 Visible False Shape7 Visible False Shape8 Visible False Shape9 Visible False Shape10 Visible False End Sub Private Sub mnuAbout_Click MsgBox Menu Demo amp vbCrLf amp Copyright amp Chr 169 amp Syafiq Afifi About Exit Sub End Sub 59 Private Sub MSComm1_OnComm Dim tdata As String Dim hdata As String Dim rdata As String Dim Idata As String Dim TEMP As Integer Dim HUM As Integer Dim Tarikh As Integer If MSComm1 CommEvent comEvReceive Then rdata MSComm1 Input If Left rdata 1 T Then tdata CInt Trim Mi
2. The most critical element in designing hardware is built up the component connection For the first attempt circuit is set up at proto board based on theory gathered from literature reviews done This temporary circuit was used to make sure the connection working well and to avoid errors Then the real connection was done and directly soldered at strip board as shown in Figure 4 2 Rainbow cable had been used to connect between the circuit of sensor LCD circuit serial communication circuit and main circuit of microcontroller Figure 4 2 Major connection of component 41 After soldering process finished troubleshoot process take place Checking for continuity between the connection and make sure the path is in the right pin Finally when the testing process completed means the circuit system is done and model of the monitoring system is shown as in Figure 4 3 and Figure 4 4 below Figure 4 3 Project prototype Figure 4 4 Component inside the project prototype 42 Then project proceeds with the software part where it is the most important part since the working of this part will ensure the successful of this project The brain or the software of this system will ensure the hardware could control and monitor data as the programmer want Software that was used in this project is MikroC and Visual Basic 6 0 where MIkroC is used to program the hardware meanwhile VB6 is used to program the display and interface on P
3. 4 34V 34 According to Table 3 1 the dark condition is when the analog voltage is less than 1 0V and the bright condition is when the analog voltage is higher than Thus the subroutine for light sensor can be written as Figure 3 16 void display_light adc_rd ADC_read 2 lightbuffer adc_rd gt gt 2 Icd_out 1 11 LIGHT if adc_rd lt 215 Icd_out 2 12 OFF txt3 0 0x46 for i 0 i lt 6 i usart_write txt3 i if adc_rd gt 215 Icd out 2 12 ON txt3 0 0x4E for i 0 i lt 6 i usart_write txt3 i Figure 3 16 A subroutine to sense light condition 35 3 3 3 Humidity Sensor Programming For humidity sensor the relation was extracted from the datasheet and focused on some specification The following calculations will clarity the process to construct an equation for this sensor Table 3 2 Humidity sensor specification Number Specification Value 1 Input voltage range DC 5 0 V 4 0 2V 2 Output voltage range DC1 0V 3 0V 3 Storage RH range 0 99 4 Operating RH range 20 95 Yo As mentioned before PIC18F452 is 10 bits analog to digital converter microcontroller with SV input mean 4 88mV per resolution Since the output voltage range of humidity sensor is 1V 3V hence microcontroller only read digital values from 1023 1023 XL 205 lt adcreaa S x3 614 The differences of this step will be 409 steps 36 The oper
4. unsigned double adc rd rs 4 88 val rs rs 10 Icd_out 1 9 C displayNum rs 1 3 Ihumidity display AN 1 void display_humid int row Icd_out row 1 H adc_rd ADC_read 1 humidbuffer ade_rd gt gt 2 if ade_rd lt 205 ade_rd gt 614 Lcd Out row 3 ERROR return humid adc_rd 215 humid 0 18 humid 20 Icd_out row 9 displayNum humid row 3 delay_ms 100 void display_light adc rd ADC read 2 lightbuffer adc_rd gt gt 2 Ied_out 1 11 LIGHT if adc_rd lt 215 Icd_out 2 12 OFF txt3 0 0x46 for i 0 1 lt 6 i usart_write txt3 i if adc_rd gt 215 55 Icd_out 2 12 ON txt3 0 0x4E for i 0 1 lt 6 i usart_write txt3 i void displayNum unsigned double num int row int column char ratus puluh sa dec1 dec2 unsigned long ch unsigned long num 100 if num gt 999 Led_Out row column ERROR return ratus char ch 10000 ratus 0x30 ch ch 10000 if ratus 0 ratus puluh char ch 1000 puluh 0x30 ch ch 1000 if ratus amp amp puluh 0 puluh sa char ch 100 sa 0x30 ch ch 100 decl char ch 10 decl 0x30 ch ch 10 dec2 ch 0x30 Lcd Chr row column ratus Led_Chr row column 1 puluh Led_Chr row column 2 sa Led_Chr row column 3 Led_Chr row column 4 dec1 56 57 Led_Chr row column 5 dec2
5. O RD2 PSP2 Figure 2 6 Pin configuration of PIC18F452 14 16 Table 2 2 PIC18F452 Specification On Chip Program Memory On Chip RAM Data EEPROM FLASH bytes Single Word bytes bytes Instructions 32K 16384 1536 256 Meanwhile the peripheral features as follows Three external interrupt pins Timer0 module 8 bit 16 bit timer counter with 8 bit programmable prescaler Timer module 16 bit timer counter Timer2 module 8 bit timer counter with 8 bitprogrammable prescaler Timer3 module 16 bit timer counter Secondary oscillator clock option Timer1 Timer3 Two Capture Compare PWM CCP modules D po PAN oy Oe ee a CCP pins that can be configured Capture input capture is 16 bit max resolution 6 25 ns TCY 16 Compare is 16 bit max resolution 100ns TCY PWM output PWM resolution is 1 bit to 10 bit Max PWM freq 8 bit 10 bit resolution 39 kHz 14 High current sink source 25mA Ww N Analog feature 1 Compatible 10 bit Analog to Digital Converter module A D with gt Fast sampling rate gt Conversion available during sleep 2 Programmable Low Voltage Detection PLVD Support interrupt on Low Voltage Detection 3 Programmable Brown Out Reset BOR Special microcontroller feature 1 100 000 erase write cycle Enhanced FLASH program memory typical 2 1000000 erase write cycle Data EEPROM memory 3 Flash Data EEPRROM Reten
6. for data communication and three types of sensors which temperature humidity and light Meanwhile software part was implemented using MikroC to create a program of reading data from sensors and also a part of software that used Visual Basic 6 0 to implement the GUI for data display on computer 21 Furthermore serial communication had been used to communicate between hardware and GUI Figure 3 1 is a few steps to follow in order to finish this project and Figure 3 2 is the block diagram for this project HARDWARE DESIGN PROTOTYPING AND TESTING SOFTWARE DESIGN DEBUGGING AND PROJECT TESTING Figure 3 1 Method to complete the project TEMPERATURE J HUMIDITY O gt PIC 18F452 Figure 3 2 Block diagram of the project 22 3 2 Hardware Design Prototyping and Testing Hardware design and prototyping works parallel with circuit testing to ensure the circuit is working The most important and complicated part of designing a monitoring system is to design the sensors part Working with an analog signal requires a highly knowledge and understand on how the sensors and microcontroller operate The information of the hardware mostly can be read from data sheet then important specification need to be extracted from data sheet and reliable source 321 Microcontroller PIC18F452 Microcontroller is the controlling system that will control the whole operation It was used to handling communication with sensors LCD and the
7. is OFF Figure 4 7 Light condition is ON Figure 4 8 Light condition is OFF 45 44 2 Graphic User Interface Display of the monitoring system was implemented on window PC using Visual Basic The window consists of three boxes in data column to display the data received from hardware in real time These three boxes were temperature humidity and light The example of window display is shown in Figure 4 9 below ix DATA ACQUISITION of x Fie Help TEMPERATURE UV LIGHT 86 TN S Data is unavailable PJE Please Open CommPort bs And select option Data is unavailable Please Open CommPort HUMIDITY And select option Data is unavailable Please Open CommPort And select option r COMM PORT Dale nen TEMPERATURE Celcius Sunday 28 November 2010 Close HUMIDITY ZRH 11 28 42 PM m OPTION C Optionl LIGHT C Option2 Figure 4 9 GUI for fungi culture monitoring system The Comm Port is used to open or closed serial communication so data could enter or stop from coming into the monitoring system If the button open clicked without communication port connected to hardware this message box will come out as Figure 4 10 A x Please connect the Device Invalid port number E Figure 4 10 Message box 46 After the communication port was opened and option column was selected then data will be displayed on the window Monitoring system also works completely according to desire envi
8. organism that we see and call a mushroom is really just the fruiting body The unseen is the mycelium tiny threads that grow throughout the substrate and collect nutrients by breaking down the organic material This is the main body of mushroom 2 The market for mushroom continues to grow due to interest in their culinary nutritional and health benefits Besides this mushroom also show the potential for use in waste management since they grow and fruiting from this organic waste However as fungi mushrooms have life cycles very different from those of green plants Different species require different type of growth media and environment consideration The biggest challenge is maintaining the optimal temperature and moisture and other condition so that mycelium could favor fruiting and we obtain a mushroom Figure 2 1 Cultivation of mushroom 8 Based on Figure 2 1 it is an overview of technique for mushroom Cultivation Here are the description of each process and the requirement SO oe SNe PA 8 9 Preparation and pouring of agar media into petri dishes Germination of spores and isolation pure mushroom mycelium Expansion of mycelium mass on agar media Preparation of grain media Inoculation of grain media with pure mycelium grown on agar media Incubation of inoculated grain media spawn a lying out grain spawn onto trays b Inoculation of grain spawns into bulk substrate Casing covering of substrate with a moist mi
9. their support My sincere appreciation also extends to all my colleagues especially Mr Faiz Asraf Nadia Hidayah and others who have provided assistance at various occasions Their views and tips are useful indeed Unfortunately it is not possible to list all of them in this limited space I am grateful to all my family members and very thankful to Mr Bustam Juki and Mrs Zakiah Wan Md Noor who are continually giving support for me to finish this thesis ABSTRACT Agriculture industry is expected to grow rapidly to become an important contributor to the economy Indoor cultivation of mushroom is among the agro industry that flourishes recently The weather and condition of Malaysian tropical environment enable the growth of this sector Meanwhile at this cutting edge of technology era the usage of embedded system in conventional farming has become widely accepted The use of technologies could possibly enhance the quality of products in food industry Hence the purpose of this project is to develop an embedded application via microcontroller as a monitoring system in cultivation of mushroom The embedded system will have PIC18F452 as the heart of the system and the brain of this system written in C language The fruiting body or mushroom depends on the growth of fungi called mycelium This fungi demands a highly control of environment to growth Hence the embedded system is included with the sensors of temperature humidity and light Besides
10. this project are listed as follows i To develop a model of fungi culture monitoring system via sensors and PIC microcontroller ii To implement GUI that able to interface with PIC microcontroller 1 4 Scope of Project The scopes of this project are 1 The environment analyses considered via sensors are limited to temperature humidity and light 2 Hardware implemented involving circuit for microcontroller PIC18F452 and circuit for temperature sensor humidity sensor light sensor LCD and serial communication circuit 3 This project is using C language for PIC programming and Microsoft Visual Basic 6 0 to implement the GUI for monitoring system 1 5 Outline of Thesis CHAPTER 1 0 This chapter commence with an introduction of the project fungi culture monitoring system and automated control system CHAPTER 2 0 This chapter focused on lit review presenting up to data findings and useful theoretical definition Besides research related to project is reviewed CHAPTER 3 0 This chapter focused on the exact steps to be undertaken to complete the project The development of operating system and hardware will be examined CHAPTER 4 0 Full system and results from the preferred project will be discuss in details CHAPTER 5 0 Review and summary of project s finding will be concluded in the thesis Recommendation for future development will be included 1 6 Methodology This project consists of two parts
11. 5 1 Introduction 5 2 Conclusion 5 3 Recommendation 38 39 40 42 42 45 48 48 50 51 53 61 TABLE 2 1 2 2 3 1 3 2 4 1 LIST OF TABLES TITLE The condition of fungi culture monitoring system PIC18F452 specification Calculation for Min and max of the voltage divider Humidity sensor specification Condition for monitoring system in GUI PAGES 10 16 33 35 47 FIGURES 1 1 2 1 2 2 2 3 2 4 23 2 6 Dal 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 LIST OF FIGURES TITLE The block diagram of the system Cultivation of mushroom 8 Resistance Vs illumination 17 The LM35 package 15 Humidity sensor 16 Humidity Configuration Pin configuration of PIC18F452 14 PIC18F452 block diagram 14 Method to complete the project Block diagram of the project The connection of microcontroller Typical connection for LM35 temperature sensor LM35DZ temperature sensor Light sensor schematic Light dependent resistor Circuit for humidity sensor 16x2 LCD PAGES 11 12 13 13 15 17 21 21 22 23 23 25 25 27 28 xi 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 16x2 LCD configuration MAX232 IC Hardware connection for RS232 communication Flowchart of microcontroller system Flowchart of GUI for monitoring system A subroutine to perform tempera
12. C 4 4 Project Discussion 441 Programming in MikroC MikroC is an IDE provided by MikroElektronika and it is a powerful feature rich development tool for PIC microcontrollers Programming was done in C language Since C language used it able the programmer to develop the possible solution for embedded system in the easiest way compare to assembly language The data sent and received between hardware and computer via comm Port also can be checked with the USART communication terminal in MikroC Collected data from field to computer shown as Figure 4 5 43 Status Send Receive CTS DSR e o Log Eies Bead from Write to Apper to fi Figure 4 5 Usart communication terminal receive data Meanwhile the process of read data from environment can be tested wia display on LCD If the programming is success hence there will be no problems with data displayed on LCD If there is a bug in programming mean the output on LCD will be not as desired Figure 4 6 below shows the LCD display with free error and bug mean system working well Figure 4 6 Parameters show on LCD 44 The parameters included into the display of LCD were T for temperature in degree Celsius H for humidity in RH and LIGHT for light condition either ON or OFF If the condition changes the parameter should change too For example the light condition in Figure 4 7 the light is ON meanwhile in Figure 4 8 the light condition
13. M Frenz 2002 Visual Basic and Visual Basic Net for scientist and engineer Apress Michael A Vine 2001 Microsoft Visual Basic programming for the absolute beginner Pratice Hall India Wabschall D 1999 Circuit Design for Electronic Instrument Analog and Digital Devices from Sensor to Display New York McGraw Hill Paul Stamets 1995 Mushroom Cultivator A Practical Guide Growing Mushrooms at Home Wu Zhuang Jiao Zhi and Guo L 2009 Temperature and Humidity Measure control System Based on CAN and Digital Sensors North China Institute of Aerospace Engineering IEEE 10 11 12 13 14 15 16 17 52 Xiao L and Guo L 2010 The Realization of Precision Agriculture Monitoring System Based on Wireless Sensor Network IEEE Yashushi H Murase H and Morimoto T 2001 Intelligent Systems for Agriculture in Japan IEEE Alice Beetz and Michael K 2004 Mushroom Cultivation and Marketing National Sustainable Agriculture Information Services Martin D Seyer 1998 RS232 made Easy Connecting Computers Printers Terminals and Modems New Jersey Microchip PIC 18FXXX Data Sheet Microchip Technology Inc 2001 National Semiconductor LM35 Precision Centigrade Temperature Sensors Data Sheet November 2000 HSM 20G User Manual Cytron Technologies April 2009 RS Component Light Dependent Resistors Data Sheet March 1997 53 APPENDIX A PROGRAMMING FOR FIRM
14. PC for display The data received from field is in analog form then microcontroller convert the data to digital and process those raw data into readable data to be displayed on LCD or PC The basic circuits for the microcontroller are crystal oscillator and power supply This project used 20Mhz crystal oscillator to produce high frequency and give the best performance Figure 3 3 shows the connection of microcontroller PIC 18F 452 Figure 3 3 The connection of microcontroller 23 3 2 2 Temperature Sensor The LM35 series are precision integrated circuit temperature sensor which output voltage is linearly proportional to the temperature Thus LM35 has an advantage over linear temperature sensor calibrated in degree Celsius The scale factor is 10mV C Besides the LM35 temperature sensor does not require any external calibration or trimming and it does maintaining its accuracy of 0 25 C at room temperature and 0 75 C over range to 150 C Figure 3 4 shows a typical electrical connection for the LM35 temperature sensor Meanwhile Figure 3 5 shows the plastic package of the temperature sensor LM35DZ RAO Figure 3 4 Typical connection for LM35 temperature sensor gt Figure 3 5 LM35DZ temperature sensor Based on Figure 3 5 simply connect the left pin to 5V and the right pin to the ground The middle pin will have an analog voltage that is directly proportional to the 24 temperature LM35 will send dat
15. PSZ 19 16 Pind 1 07 UNIVERSITI TEKNOLOGI MALAYSIA DECLARATION OF THESIS UNDERGRADUATE PROJECT PAPER AND COPYRIGHT Author s full name MOHD SYAFIQ AFIFI BIN BUSTAM Date of birth 31 AUGUST 1987 se Title DESIGN OF FUNGI CULTURE ENVIRONMENTAL CHARACTERIZATION SYSTEM Academic Session 2010 2011 declare that this thesis is classified as CONFIDENTIAL Contains confidential information under the Official Secret Act 1972 RESTRICTED Contains restricted information as specified by the organization where research was done OPEN ACCESS agree that my thesis to be published as online open access full text acknowledged that University Technology Malaysia reserves the right as follows The thesis is the property of University Technology Malaysia The Library of University Technology Malaysia has the right to make copies for the purpose of research only The Library has the right to make copies of the thesis for academic exchange Certified by SIGNATURE SIGNATURE OF SUPERVISOR 870831 02 5807 DR MUHAMMAD NASIR IBRAHIM NEW IC NO PASSPORT NO NAME OF SUPERVISOR Date 9 DECEMBER 2010 Date 9 DECEMBER 2010 NOTES If the thesis is CONFIDENTIAL or RESTRICTED please attach with the letter from the organization with period and reasons for confidentiality or restriction I hereby declare that I have read this work and in my opinion this work is adequate in terms of scope and quality of
16. WARE char text SYAFIQ AFIFI int i j unsigned int adc_rd unsigned double rs val unsigned double humid unsigned short tempbuffer humidbuffer lightbuffer unsigned char txt 7 txt2 7 txt3 7 void app init void display temp void display light void display humidint row void displayNum unsigned double num int row int column void move void move2 void main app_init while 1 display_temp TEMPERATURE IntToStr rs txt txt 0 0x54 for i 0 1 lt 6 i usart_write txt i delay_ms 2000 display humid 2 HUMIDITY IntToStr humid txt2 txt2 0 0x48 for i 0 1 lt 6 i usart_write txt2 i delay_ms 2000 display light LIGHT void app init delay_ms 100 TRISD 0 TRISA 0xFF ADCON1 0x80 usart init 9600 lcd ini amp PORTD led cmd LCD CLEAR led cmd LCD CURSOR OFF led out 1 3 text text FKE UTM Icd_out 2 6 text delay_ms 4000 led cmd LCD CLEAR text FUNGICULTURE led out 1 3 text text DATA ACQUISITION Icd_out 2 1 text delay_ms 4000 j 0 do loop moving display move move2 j while j lt 2 delay_ms 2000 led cmd LCD CLEAR Icd_out 1 1 DATA ACQUISITION Icd_out 2 1 TEMP amp HUMID amp LIGHT delay_ms 4000 led cmd LCD CLEAR temperature display ANO void display_temp unsigned double val 54 Icd_out 1 1 T adc rd ADC read 0 tempbuffer ade_rd gt gt 2 val
17. a GUI was developed so farmer could monitor the condition from computer Finally with the usage of technology shall boosting the food production market and stay competitive so as the human population growth vi ABSTRAK Industri agrikultur dijangka berkembang dengan pesat nya dan menjadi penyumbang penting kepada ekonomi negara Antara industri agro yang kian berkembang dengan pantas adalah penanaman cendawan secara tertutup Faktor cuaca dan keadaan iklim tropika Malaysia juga membolehkan sektor ini berkembang dengan baik Sementara itu dalam ledakan era teknologi ini penggunaan sistem tertanam dalam pertanian secara tradisional telah menjadi perkara biasa dan diterima umum Penggunaan teknologi boleh menambah baik kualiti hasil dalam sektor industri pemakanan Oleh yang demikian projek ini bertujuan untuk membangunkan aplikasi sistem tertanam melalui penggunaan mikropengawal sebagai sistem pengawal dalam penanam cendawan Sistem ini akan menggunakan PIC18F452 sebagai jantung operasi manakala pengaturcaraan untuk sistem terbenam ini menggunakan bahasa C Tumbesaran cendawan adalah bergantung kepada sejenis kulat dipanggil mycelium Kulat ini memerlukan pemerhatian yang teliti terhadap kawasan tumbesarannya Oleh itu sistem tertanam yang dibangunkan akan mempunyai beberapa pengesan seperti pengesan suhu kelembapan dan kehadiran cahaya Selain itu paparan tetingkap juga dibangunkan agar petani dapat mengawal selia keaadaan tempat penanaman mela
18. a to the PIC microcontroller in voltage then the PIC will convert to degree Celsius base on below formula Temp in C Vout in mV 10 Testing the temperature sensor require the Vcc connected to power supply 5V ground to OV and multimeter in DC voltage mode connected to middle pin and ground If room temperature is 25 C the output voltage should be about 0 25V If the plastic case of sensor pressed then the voltage will or place on in such colder environment the voltage will drop 25 3 2 3 Light Sensor Light sensor is based on LDR Light Dependent Resistor Light dependent resistor is a resistive light sensor that changes its electrical resistance from several thousand Ohms in the dark to only a few hundred Ohms when light fall upon it PIC 18F452 Figure 3 6 Light sensor schematic Figure 3 7 Light Dependent Resistor 26 Based on Figure 3 6 the light sensor schematic diagram which consist of LDR and 100K Ohm resistor Vout can be calculated using below formula R bottom Vout m x Vin R bottom R top According to this formula R bottom is egual to 100K ohm and Rtop is base on LDR resistance and Vin is equal to 5V Figure 3 7 shows the Light Dependent Resistor that will be placed at Rtop The resistance of LDR becomes higher when the illumination is low or the environment become dark The value of Vout becomes OV 27 3 2 4 Humidity Sensor Humidity sensor is used to read the moisture or
19. ating range of humidity sensor is 20 95 with 75 differences It shows that at 20 RH the analog value is 1V while binary is 205 and at 95 RH the analog will be 3V while binary is 614 Hence the humidity relation was then obtained as 0 75 NRH ang x adCreaa 205 20 The source code for humidity sensor can be written as Figure 3 17 void display_humid int row Icd_out row 1 H adc_rd ADC_read 1 humidbuffer adc_rd gt gt 2 if adc_rd lt 205 adc_rd gt 614 Lcd Out row 3 ERROR return humid adc_rd 205 humid 0 18 humid 20 Icd_out row 9 displayNum humid row 3 delay_ms 100 Figure 3 17 A subroutine to perform humidity read 37 3 4 Debugging and Project Testing Every programmer will not escape producing bugs in his or her codes Thus debugging and project testing process is necessary to ensure no fatal mistakes were done when the controller system is finish The test could be done by run the programming in simulation environment next test with actual environment If mistakes occur such wrong display value or pattern on LCD then it is known that codes in such subroutine contains bug Debugging process usually takes the most time because the problems are uncertain and the most time requires trial and error 38 CHAPTER 4 RESULT AND DISCUSSION 4 1 Introduction Through this chapter this project hardware and software of monitoring system will be test
20. awarding a Bachelor s Degree of Engineering Electrical Electronic Signature git i Red NN PN ak PS ete hts Name of Supervisor DR MUHAMMAD NASIR IBRAHIM Date 9 DECEMBER 2010 DESIGN OF FUNGI CULTURE ENVIRONMENTAL CHARACTERIZATION SYSTEM MOHD SYAFIQ AFIFI BIN BUSTAM A thesis submitted in fulfillment of the requirements for the award of the degree of Bachelor of Engineering Electrical Electronic Faculty of Electrical Engineering Universiti Teknologi Malaysia DECEMBER 2010 I declare that this thesis entitled Design of Fungi Culture Environmental Characterization System is the result of my own research except as cited in the references The thesis has not been accepted for any degree and is not concurrently submitted in candidature of any other degree Signature asresten ea Aas Name MOHD SYAFIO AFIFI BIN BUSTAM Date 9 DECEMBER 2010 To my beloved mother father and brothers ACKNOWLEDGEMENT In preparing this thesis I was in contact with many people academicians and practitioners They have contributed towards my understanding and thoughts In particular I wish to express my sincere appreciation to my main thesis supervisor Associate Professor Dr Muhammad Nasir Ibrahim for encouragement guidance critics motivation and advices Without his continued support and interest this thesis would not have been the same as presented here My fellow undergraduate students should also be recognized for
21. bits it is equal to 2 1 1023 steps or level of resolution hence SV then divided into 1023 5V 4 88mV per resolution 1023 The scale factor for LM35DZ is given by 10mV C Figure 3 15 shows a set of instruction that perform a subroutine for reading analog signal and calculation made to convert into degree Celsius void display_temp unsigned double val Icd_out 1 1 T adc_rd ADC_read 0 tempbuffer adc_rd gt gt 2 val unsigned double adc_rd rs 4 88 val rs rs 10 Icd out 1 9 C displayNum rs 1 3 Figure 3 15 A subroutine to perform temperature reading 33 3 3 2 Light Sensor Programming Based on equation below R bottom is fixed at 100K ohm and the voltage output value is taken from this equation The value of Vout increases when the LDR resistive value decreases The minimum value for LDR is about 15K 20K ohm Meanwhile the value for LDR without presence of light is above 400K ohm R bottom Vout m x Vin R bottom R top Table 3 1 Calculation for the Min and Max of the voltage divider Condition Description In Dark In dark condition the value of LDR is high around 400KQ Condition Therefore it will output the minimal voltage value Vout 100K 100K 400K 5 1 0V 215 in digital hex In Bright In bright condition the value of LDR is low 15K 20KQ Therefore it Condition will output the maximal voltage value Vout 100K 100K 15K 5
22. d for humidity and light System terminate when power turned off gor A READ HUMIDITY b DISPLAY HUMIDTY SEND DATA TO PC USART INITIATE ADC INITIATE LCD INITIATE USART READ LIGHTING CONDITON DISPLAY LIGHTING CONDITON READ TEMPERATURE DISPLAY TEMPERATURE SEND DATA TO PC A USART A SEND DATA TO PC USART FINISH Figure 3 13 Flowchart of microcontroller system 31 The second part involved developing software for Graphic User Interface GUI purpose Microsoft Visual Basic 6 0 VB6 was used as the platform to generate interface The interface was provided with the display of processed data and monitoring system including the date and time Flowchart of the monitoring system is given by Figure 3 14 NO MONITORING SYSTEM BASE ON a OPTION 1 Figure 3 14 Flowchart of GUI for monitoring system MONITORING SYSTEM BASE ON OPTION 2 32 3 3 1 Temperature Sensor Programming Correct technique required to interface the sensor and hardware module It can be done with the Analog to Digital Converter ADC provided in PIC18F452 Thus the analog signal sense by sensor can be represented in a digital data so that microcontroller could understand and process the raw data The PIC18F452 is a 10 bit analog to digital converter microcontroller The maximum input voltage for microcontroller is 5V Since the binary is 10
23. d precise inherent calibration make interface to control circuit easy It can be used with single power supply or with plus and minus supply It has very low self heating less than 0 1 C in still air The LM35 is rated to operate over a 55 C to 150 C temperature range TO 46 TO 32 T0220 Metal Can Package Plastic Package Plastic Fachane Sea s an a sorron new Corre waw Lahan sos Small Outline Molded Package Figure 2 3 The LM35 package 15 This project used plastic package TO92 with LM35DZ type as a temperature sensor The storage temperature for TO 92 is between 60 C to 150 C but the specified operating temperature range for this project is only for 0 C to 100 C 13 2 22 Humidity Humidity sensor is a device consisting of special plastic material whose electrical characteristics change according to amount of humidity in the air Basically it is a sensor that senses the amount of water vapor in air The module of HSM 20G is essential for those applications where the relative humidity can be converted to standard voltage output The applications of this sensor include air conditioner humidifier and dehumidifier automotive climate control and humidity data logger Figure 2 4 Humidity sensor 16 The product features for model HSM 20G include voltage analog output for humidity small size and easy to conceal Besides this model of humidity sensor is compatible with all type of microcontrollers a
24. d rdata 2 5 txtTemperature Text tdata tdata ElseIf Left rdata 1 H Then hdata CInt Trim Mid rdata 2 5 txtHumidity Text hdata tdata ElseIf Left rdata 1 F Then Idata OFF txtLight Text Idata Idata ElseIf Left rdata 1 N Then Idata ON txtLight Text Idata Idata End If End If If Option Value True Then If txtTemperature Text lt 26 And txtTemperature Text gt 24 Then Label1 Caption Temperature is in range Shape6 Visible False ShapeS Visible True Else Label1 Caption Temperature is not in range ShapeS Visible False Shape6 Visible True End If If txtHumidity Text gt 75 And txtHumidity Text lt 80 Then Label2 Caption Humidity is in range Shape8 Visible False Shape7 Visible True 60 Else Label2 Caption Humidity is not in range Shape7 Visible False Shape8 Visible True End If If txtLight ON Then Label3 Caption Light is ON Shape10 Visible False Shape9 Visible True Else Label3 Caption Light is OFF Shape9 Visible False Shape10 Visible True End If End If If Option2 Value True Then If txtTemperature Text lt 18 Then Label1 Caption Temperature is in range Shape6 Visible False ShapeS Visible True Else Label1 Caption Temperature is not in range ShapeS Visible False Shape6 Visible True End If If txtHumidity Text gt 90 Then Label2 Caption Humidity is in
25. ed whether it is able to meet the desire objectives This chapter explains about the result achieved and a few discussions regarding a problem solving during the process Final project overview such as block and flow diagram are included 39 4 2 Project Description This project was based on the objectives stated before which is designing a model of monitoring system for fungi culture environment via few sensors such as temperature humidity and light Besides this project also include the implementation of GUI that able to interface with PIC microcontroller Those sensors will sense analog signal from indoor fungi farm convert and displayed into digital Furthermore this project also fully utilizes the function of USART communication provided in PIC18F452 the communication between PC and microcontroller were connected via RS232 serial communication After all the phases were completed the whole project can be summarized as Figure 4 1 sensor RS232 pc m USART Microcontroller apc sensor sensor 8bits paralel data Figure 4 1 Block diagram of whole project 40 4 3 Project Result This project involves implementation of hardware and software These two parts were highly dependent The success of the whole project is on the functionally work between hardware and software Microcontroller played a major role as a brain to the system where it capture signals process into desire data display and send to PC
26. he sensors generate an analog signal There are a few sensors can be used in this project and each has its own function The device function can be extracted from the datasheet 2 21 Light Light sensor is developed through voltage divider and Light Dependent Resistor LDR LDR is a resistive light that change its electrical resistance from several thousand Ohm in the dark to only a few Ohm in bright condition The net effect is a decrease in resistance for an increase in illumination Material used as the semiconductor substrate include Lead Sulphide PbS Lead Selenide PbSe Indium Antimonide InSb which detect light in the infrared range and the most commonly used of all is Cadmium Sulphide Cds as its spectral response curve closely match that of human eye and can even controlled using a simple torch as a light source Resistance kN So 0 1 1 0 10 100 Ftc 1Ftc 10 764 lumens Figure 2 2 Resistance vs illumination 17 12 2 2 1 Temperature Based on the LM35 Precision Centigrade Temperature Sensors manual by National Semiconductor Corporation the LM35 series are precision integrated circuit temperature sensors whose output voltage is linearly proportional to the Celsius The LM35 does not require any external calibration or trimming to provide typical accuracies of 1 4 C at room temperature and 3 4 C over a full 55 to 150 C temperature range The LM35 s low output impedance linear output an
27. his unwanted waste Meanwhile embedded system is some combination of computer hardware and software either fixed in capability or programmable that is specifically designed for a particular function Embedded system can be found in various industry and product from simple to complex embedded The versatility of embedded system makes it able to utilize and fulfill any purpose of project Thus the fungi culture industry might benefit from this advancement of technology Developing a monitoring system through this embedded application may expand the qualities of mushroom for business purpose Besides through this monitoring system fungi products may be produced in mega scale production to support the food and medical need in industry Controlling the condition of several processes ensure the growth of mushroom much faster and competence to be in mega scale production 1 2 Problem Statement There are many important aspects need to be controlled in cultivation of mushroom and the most important three aspects are temperature humidity and light Problems 1 Indoor mushroom production demand continuous monitoring and timely manipulation of environment condition 2 Maintaining optimal temperature moisture and other condition for fungi growth to favor fruiting 3 Since there is no hardware for collecting fungi environment farmer could not able to monitor and control the parameters 1 3 Objective of Project The objective of
28. ific type of microcontroller that used in this project is a microcontroller from the Microchip Technology Incorporated which is PIC18F452 The PIC18F4452 is used as controller system that will process data from monitoring system and also to control output to display and output system PIC18F452 is chose because of it characteristic is suitable to this project application Besides it has the high performance and multifunction Furthermore the learning process for beginner on this can be discovered in many reliable sources According to the data sheet the specification of PIC18F452 is shown in Table 2 The pin configuration of this PIC can be seen in Figure 2 Below MCLRIVep gt 1 40 0 RB7 PGD RAD ANO e A2 39 RBs PGc RAVAN1 3 38 O RBS PGM RA2IAN2IVREF 4 37 O R84 RA3 AN3 VREF 5 36 1 e RB3 CCP2 RA4ITOCKI 16 35 0 RB2 INT2 RAS AN4 SSILVDIN 7 ka 34 O RB1ANT1 RED RDIANS 6 io 33 O RBOMNTO REVWRIANS 9 i 32 Q Voo RE2ICSIANT lt O 3110 vss Yoo e O 1 RD7 PSP7 Vss e a 29 O RD6 PSP6 OSC1 CLKI 7 28 O e RDSVPSPS OSC2ICLKO RA6 1 lt RD4 PSP4 RCO TIOSOTICK 26 O lt e RC7IRX DT RC1UTIOSUCCP2 25 J e RCE TXICK RC2ZICCP1 RCS SDO RC3ISCK SCL 23 LJ RC4 SDI SDA RD1 PSP1 2 21
29. ill load all program made into internal memory of PIC18F452 Once HEX file was created in MikroC this file will then be loaded into PIC18F452 through PIC Kit2 2 5 3 Microsoft Visual Basic 6 0 Visual Basic VB is powerful and useful programming tools for development of applications for the Microsoft Window operating system 5 Microsoft Visual Basic 6 0 is designed to allow programmer to develop applications that run under windows without the complexity generally associated with window programming The programmer can design a screen that holds standard window element such a command buttons text boxes and list boxes Each of these window objects operate as expected producing a standard window user interface Visual basic enables the user to created a forms using drag and drop technigues A tool is used to place control example like text box or button on the form window Programmer can literally draw out the graphical user interface GUI This makes developing a GUI relatively easy instead of writing long code 20 CHAPTER 3 DESIGN AND IMPLEMENTATION 3 1 Introduction This project was done according to carefully planned methodology in designing the system as to achieve the objectives Hence this chapter will provide sufficient details of the necessary steps to complete project This project divided into two parts which are hardware and software implementation Hardware part consists of microcontroller PIC18F452 16x2 LCD RS232
30. lui komputer Melalui penggunaan teknologi ini pengeluaran makanan dapat ditingkat kan seiring dengan pertambahan penduduk CHAPTER TABLE OF CONTENT TITLE DECLARATION OF THESIS DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENT LIST OF TABLE LIST OF FIGURE LIST OF APPENDICES INTRODUCTION 1 1 1 2 1 3 1 4 1 5 Background of Study Problem Statement Objective of Project Scope of Project Outline of Thesis PAGES ii iii iv vi vii xi xiii A A U Q vii LITERATURE REVIEW 21 2 2 2 3 2 4 2 5 Introduction Mushroom Sensors 2 31 Light 2 3 2 Temperature 2 3 3 Humidity Embedded System 2 4 1 Microcontroller PIC18F452 Programming Tools 2 51 MikroC IDE 2 5 3 PIC Kit Programmer 2 5 3 Microsoft Visual Basic 6 0 DESIGN AND IMPLEMENTATION 3 1 3 2 3 3 Introduction Hardware Design Prototyping and Testing 3 21 PIC18F452 3 2 2 Temperature 3 2 3 Light 3 2 4 Humidity 3 2 6 LCD 3 2 6 RS232 Serial Communication Software Design 3 3 1 Temperature Sensor Programming 3 3 2 Light Sensor Programming 3 3 3 Humidity Sensor Programming 3 4 Debugging and Project Testing 20 22 22 23 25 21 28 29 30 32 33 35 37 viii REFERENCES APPENDICES RESULT AND DISCUSSION 4 1 Introduction 42 Project Description 43 Project Result 4 4 Project Discussion 441 Programming in MikroC 442 Graphic User Interface CONCLUSION AND RECOMMENDATION
31. nd high sensitivity to humidity in the air Figure 2 5 Humidity configuration 14 2 4 Embedded System The basic idea of an embedded system is very simple Take any engineering product that needs control and if computer is incorporated within that product to undertake the control then we have an embedded system A system whose principal function is not computational but which is controlled by a computer embedded within it 1 These days embedded systems are everywhere appearing in the home factory car or hospital The microcontroller is the heart of the embedded system A microcontroller is a microprocessor system which contains data and program memory serial and parallel I O timers external and internal interrupts All integrated into a single chip About 40 percent of all microcontroller applications are found in office equipment such as laser printers fax machine and intelligent telephones 3 About one third of all microcontrollers are founding in consumer electronic goods The microcontroller has all the support chips inside its single chip compared to microprocessor which requires several other components for it operation Basically the microcontroller executes a user program which is leaded in its memory Base on program that had been loaded into the memory chip data will receive from external devices input manipulated and then send to external devices output 15 241 Microcontroller PIC18F452 The spec
32. ountry necessary of sustaining the foods stock in market will demand the usage of technology in agro industry 49 The project of fungi culture environmental characterization has a great impact in leading the agro industry to the next level This prototype of embedded application in monitoring system could be the basic in building more practical application in real world The usage of technology might be able to enhance several possibilities in managing the farm precisely Furthermore all implementation in this project were designed to be highly expandable in future Via this project an understanding of embedded usage shall be a learning platform in order to perform more complex and advance embedded system developed in future Complex system with more parameters and automated control perform farming duties and minimize human involvement Thus the product of agro industry will have such a better qualities and yield more corps The objective of the project had been state clearly before The expected outcome of this project is able to model an embedded system via sensors and microcontroller and also able to perform monitoring task for cultivation of mushroom The system met the expected outcome therefore the objectives were fulfilled 50 5 3 Recommendation Further research is recommended to improve the reliability of this project especially in embedded system This project uses few sensors and wired communication medium to communica
33. range Shape8 Visible False Shape7 Visible True Else Label2 Caption Humidity is not in range Shape7 Visible False Shape8 Visible True End If If txtLight ON Then Label3 Caption Light is ON Shape10 Visible False Shape9 Visible True Else Label3 Caption Light is OFF Shape9 Visible False Shape10 Visible True End If End If End With End Sub 61 Private Sub Optionclose_Click disable comm port On Error GoTo HandleErrors MSComm1 PortOpen False Optionl1 Value False Option2 Value False Exit Sub HandleErrors Dim strMessage As String strMessage Port already disconnected amp vbCrLf amp vbCrLf _ amp Err Description MsgBox strMessage vbExclamation Error Option1 Value False Option2 Value False On Error GoTo 0 End Sub Private Sub Optionopen Click On Error GoTo HandleErrors With MSComml CommPort 5 PortOpen True InputMode comInputModeText Handshaking comNone Settings 9600 n 8 1 RThreshold 7 InputLen 0 End With Exit Sub HandleErrors Dim strMessage As String strMessage Please connect the Device amp vbCrLf amp vbCrLf _ amp Err Description MsgBox strMessage vbExclamation Error Optionl1 Value False Option2 Value False On Error GoTo 0 End Sub Private Sub Timerl Timer IbIDisplay Caption Format Now Long Date amp vbCrLf amp vbCrLf amp Format Now Long Time End Sub
34. ronment selected by user Figure 4 11 below shows the operating of fungi culture monitoring system DATA ACQUISITION Figure 4 11 A fungi culture monitoring system where Red parameter is not in range Green parameter is in range 47 The condition for option 1 and option 2 is given by Table 4 1 below Option is the medium for growing mycelium in composes meanwhile Option2 is the condition during initiation of mushroom cultivation Finally is the harvesting of mushroom During this time Option2 condition still can be used as the medium of environment besides lowering the humidity to certain range between 85 92 of moisture Table 4 1 Condition for monitoring system in GUI Process Requirement Option1 Temperature 24 C 26 C Expansion of mycelium in agar media Humidity 75 80 Presence of light is not important Option2 Temperature below 18 C Initiation Increase humidity to 95 Introducing light 48 CHAPTER 5 CONCLUSION AND RECOMMENDATION 5 1 Introduction This section will conclude the whole project and future recommendations for students or individual who is interested in continuing this project as their research 5 2 Conclusion In this project cultivation of mushroom had been merging with the advancement of embedded application Compared to traditional system this project greatly improves the production efficiency In future and since Malaysia becoming the developing c
35. te To improve it a wireless communication between microcontroller and computer could be used instead of serial communication Thus this project will become more efficient since the data transmitted from field to monitoring room control station without require the person to be at the field Those sensors can be read from several meters away and beyond the sight of person in charge As improvement the researcher could add some features like database into the GUI of monitoring system Those data collected shall be kept and analyzed The purpose of this feature is to guarantee there is a reliable source of data for further research in fungi growth in future In addition with some alteration to the system this project could monitor and control other type of monitoring system such as aquaculture and livestock industry Those industries also have bigger potential to be developed with embedded application 1 2 3 4 5 6 7 8 9 51 REFERENCES Tim Wilmshurst 2010 Designing Embedded systems with PIC microcontroller Principle and application Kidlington Oxford Elsevier Ltd Randy Moore W and Dennis Clark 1995 Botany United State of America McGraw Hill Dogan Ibrahim 2008 Advanced PIC microcontroller projects in C from USB to RTOS with PICI8F series Jordan Hill Oxford Elsevier Ltd MikroC C compiler for Microchip PIC Microcontroller Mikroelektronika User Manual Christopher
36. tion gt 40 years 4 Self reprogrammable under software control 5 Watchdog Timer WDT with its own On Chip RC Oscillator for reliable operation 6 Programmable code protection 7 Power saving SLEEP mode 8 Selectable oscillator options xX REANTO HA REUINT x RESINT2 RBaccpa OSC2ICLKO OSCVCLKI x Figure 2 7 PIC18F452 block diagram 14 18 2 5 Programming Tools 251 MikroC IDE MikroC is powerful and user friendly C compiler for PIC microcontroller from MikroElektronika This software program runs on a PC to build up applications for PIC microcontroller families It is called an Integrated Development Environment IDE because it provides a single integrated environment to develop code for embedded microcontroller 4 Furthermore highly sophisticated IDE provides the power we need with the simplicity of window based point and click environment MikroC is a powerful feature rich development tool for PIC It is designed to provide the user with the easiest possible solution for developing applications for embedded systems without compromising performance control PIC and C fit together well because PICs are used widely over the world with wide variety of applications while C credited for its efficiency is a natural choice for developing microcontroller applications 19 2 5 2 PIC Kit Programmer In order to load the program in the microcontroller this software is used This software w
37. ture reading A subroutine to sense light condition A subroutine to perform humidity read Block diagram of whole project Major connection of component Project prototype Component inside the project prototype Usart communication terminal receive data Parameters show on LCD Light condition is ON Light condition is OFF GUI for fungi culture monitoring system Message box A fungi culture monitoring system 28 29 29 30 31 32 34 36 39 40 41 41 43 43 44 44 45 45 46 xii xiii LIST OF APPENDICES APPENDIX TITLE PAGES A PROGRAMMING FOR FIRMWARE 52 B PROGRAMMING FOR GUI 57 CHAPTER 1 INTRODUCTION 11 Background of Study Malaysia s agro sector is expected to grow from year to year and remain an important contributor to the economy Rapid developments in the agro food industry will further boost the output of this sector The agriculture industry can be divided into several types one of those part is fungi culture or mushroom industry Commercial and indoor cultivation of mushroom has a high potential to be developed since Malaysia is a tropical environment The weather and condition will enhance the capability of growing the fungi Besides Malaysia also has the unwanted waste from others agro industry like oil palm wood and husk from rice field Those unwanted waste could be used as the seed to favor the fruiting of fungi Hence the growth of mushroom could possibly take an advantage and fully utilize t
38. water vapor in air Few things need to be considered such as the external circuit The purpose of external circuit is to make sure the relationship of humidity and voltage is linear Components required to build the humidity sensor circuit is shown in Figure 3 8 Temperature Dutput li amp Humidity Eon o 3 output NA 5 0VDC Ri 2 anae ya Figure 3 8 Circuit for humidity sensor In order to use this sensor 4 pins was connected to the circuit required such that I pin connects to GND II pin connects to Vcc I H humidity sensor pin which included 47uF capacitor and 100kQ resistor connects to microcontroller I O pin To ensure the sensor works in the specified range detailed programming must be considered 28 3 2 5 16x2 LCD This project also uses 16x2 LCD as a display for temperature humidity and light sensor The LCD has two rows and each row can display 16 characters First row display temperature value and word LIGHT Meanwhile the second row display humidity value Figure 3 9 16x2 LCD Referring to the Figure 3 10 for pin configuration of LCD display these pins were connected to PORTD at PIC18F452 O RERE AE Figure 3 10 16x2 LCD configuration ri BESS BRERES Seca 29 3 2 6 RS232 Serial Communication This project used the RS232 serial communication protocol to communicate between microcontroller and computer Hardware connection can simpl
39. which can be divided into hardware and software The hardware part includes a circuit for microcontroller 3 sensors circuit temperature humidity and light Temperature sensor will sense the temperature of the growth field and humidity to sense the presence of moisture Besides the light sensor will sense the presence of light either on or off The control system consists of PIC18F452 as microcontroller crystal 20MHz as oscillator and voltage regulator used to regulate high voltage to 5V The control system functions to process analog data received from sensor system and send digital data to display system The system block diagram as shown in Figure 1 1 TEMPERATURE HUMIDITY LIGHT MICROCONTROLLER 4 LI Figure 1 1 The block diagram of the system The software part will be divided into two First is software for controlling system on microcontroller and second software purposely for monitoring system on PC CHAPTER 2 LITERATURE REVIEW 2 1 Introduction This chapter presents the theories and fact related to the fungi culture monitoring system topic A whole concept and further details regarding the monitoring control system will be explained for example the fungi culture sensors microcontroller and software 2 2 Mushroom Mushroom production is completely different from growing green plants Mushroom does not contain chlorophyll and therefore depend on other plant material substrate for their food The part of the
40. xture of peat and other materials Initiation 10 Cropping According to the step above the most important part to monitor and control the environment is during Initiation and Cropping Table 2 1 shows the requirement 10 Table 2 1 The condition of fungi culture monitoring system Process Requirement Expansion of mycelium in agar media Temperature should be in 24 C 26 C Humidity 75 80 Increase air circulation Presence of light is not important Initiation Lower the temperature around 18 C Increase humidity to 95 Increase air circulation Decreasing carbon dioxide Introducing light Cropping Maintaining temperature Lowering humidity to 85 92 Maintaining air circulation Maintaining carbon dioxide Maintaining light level During the growth of mycelium in agar media e g soil the compost temperature has to be around 24 C to 26 C The temperature shall not less than 20 C if not it will slower the growth of mycelium and if temperature higher than 30 C mycelium may die Besides the presence of moisture should be around 75 80 Meanwhile during the initiation of fruiting the temperature should be around 18 C If mushroom is dry skin will crack and caps open prematurely The humidity should be maintaining at 95 or above 90 Finally during the cropping humidity should be lowered to 85 92 and others maintained 11 2 2 Sensors A sensor is a type of transducer and most of t
41. y made between the microcontroller and PC via ic named MAX 232 The MAX 232 as shown in Figure 3 11 is an integrated circuit that converts signal from RS232 serial port to signals suitable for use in TTL compatible digital logic circuits Since microcontroller operate in 5V and OV signals then the MAX232 needed to convert the Rx and Tx signals from PC to microcontroller or microcontroller to PC Figure 3 12 Hardware connection for RS232 communication 30 3 3 Software Design Software implementation is the most important part of developing this project and required sophisticated knowledge to achieve desire objective There were 2 types software developed in this project The first part was codes that programmed into the microcontroller s memory Developing the codes will be the vital part of the project since it is the brain for the controller to think and process data correctly This part develop using C language through IDE MikroC provided by MikroElektronika Figure 3 13 shows the flowchart of microcontroller s system From the figure system starts when power is turned on Then the system will initiate the LCD Analog to Digital Converter and USART Next the system will start by reading the analog signal from temperature sensor convert to digital value and displayed on LCD as readable data in degree Celsius Then the processed temperature data send to PC using USART via RS232 communication port Next the same process repeate
Download Pdf Manuals
Related Search
Related Contents
Supermicro BPN-SAS-823TQ mounting kit Philips Incandescent reflector lamp Reflector 8 Août 2015 - L`Abeille des Deux 詳しいご案内 HX808D - 株式会社東北SR通信システム スタンダードの業務用無線機 2657 02-07 Stay Put.indd IndicesBuilder V2.1 T L I F P E E K C A G E Copyright © All rights reserved.
Failed to retrieve file