FYP

FYP

Saturday, 22 March 2014

WEEK 7



MicroC PRO software is used to make a program for microcontroller to control selected output. By using this software we can create a program that can control several functions. For example to control motor. The motor speed or angle of the motor can be control using program. MicroC PRO have its own library contain an example of basic program that can be use directly such as program for motor, LED display, LCD display, temperature sensor and keypad.
For our project digital pH meter, we need to make two programs. The first program is for analogue to digital program. This program is important because to allow the LCD display can display the pH value in digital form. LCD display can only read digital value.




What microcontroller do is, it read the analogue output voltage or signal from pH meter circuit then convert the value into digital before it can be display on LCD display. In microcontroller pin, to convert analogue signal to digital signal, port A is use because port A is for analogue input only.
The second program is LCD display program. This program is made to display the pH value in digital and also to display the temperature value in digital.






Figure 3.3.1    program for PIC controller

Figure above show the overall program for our project. The program included analogue to digital converter program and LCD display program.

PIC microcontroller is the brain of our system in this project. PIC microcontroller has many advantages especially to design the process itself. By using the MikroC PRO for PIC software, we can simulate the circuit diagram on proteus before making the actual hardware. Source code is easy to program which variety instructions that we can programmed. There are many PIC type such as 16F84X, 16F877X, 18F8XX and many more. In our case, we use PIC16F877A to create the program.

To create the source code program, we need to insert the command, because, for our program have their own command to let one system can be function. In this project, we use some of command to displaying the value of pH and temperature such as the LCD library command and the ADC library. For the display the items, we use LCD library that we call them from the MikroC PRO for PIC for make communication with LCD (with HD44780 compliant controllers). Through the 8-bit interface. An example of LCD connections is given on the schematic from the pH meter circuit.







Figure 3.3.2    program code for LCD display

From the figure above, we insert the LCD pin out setting and the LCD pin direction for 8-bit to enable the value is function correctly. We use the port C and port D to enable the connection that can be read and have a communication between PIC and the display.




Figure 3.3.3    program code for LCD

From the figure above, we create the lcd_init command to initializes LCD module. Then, we create the Lcd_Out to prints text on LCD starting from specified position. Both string variables and literals can be passed as a text. After that, we add the command Lcd_Out_Cp to prints text on LCD at current cursor position. Both string variables and literals can be passed as a text. We go to add the Lcd_Chr command to prints character on LCD at specific position. Both variables and literals can be passed as a character. Then, we add Lcd_Chr_Cp to prints character on LCD at current cursor position. Both variables and literals can be passed as a character. Lastly we put the Lcd_Cmd to sends command to the LCD and completing the LCD program source code.




Figure 3.3.4    program code for ADC

From above figure is shown the main program, we use an ADC (Analog to Digital Converter) module library. Because the ADC is an electronic circuit that converts continuous signals to discrete digital numbers to target the goals of this project as Digital pH Meter as well. There are 3 main of command that must be used in creating the program. That is ADC_Init command, this routine initializes PIC’s internal ADC module to work with RC clock. Clock determines the time period necessary for performing AD conversion. After that we use the ADC_Get_Sample, the function is acquires analog value from the specified channel.


Parameter channel represents the channel from which the analog value is to be acquired data. Lastly we add the ADC_Read in this command, because this command initializes PIC’s internal ADC module to work with RC clock. Clock determines the time period necessary for performing AD conversion. The program of ADC command is to display the analog signal from the circuit of pH meter convert to the digital signal that can be display to the LCD display for the value of pH and also the value of temperature. We use the ADC_float cause of to create the character with the size of 15. Because we also want the output on the LCD can be read at the decimal point. For read the value of pH, we dividing the result with 20.45, and store the pH value before it can be display on the output display. For read the value of temperature, we multiple the result with 0.48828 to display the temperature result on LCD display.






Figure 3.3.6    program for display pH and Temperature

By referring the picture above, we are use command Lcd_Out to display the value. We put the pH value at the output by using the line 1 of text while we put the temperature value at the output by using the line 2 of text.





Saturday, 15 March 2014

WEEK 6



                                               power supply circuit using multisim




power supply circuit input













                                               pH meter circuit using multisim




pH meter circuit input



Friday, 7 March 2014

WEEK 5 


  •  drow the flow chart of project and flow chart of Digital pH Meter.



                         
                                                     flow chart of the project








                                                    flow chart of pH meter






                                                          pH meter block diagram










                                                         power supply circuit


In this project, the circuit requires a 5-volt DC power source. The main input of power supply can be use DC adapter device or battery device. The range of input power supply is between 9-volt until 12-volt to make sure the voltage regulators can provide a stable and accurate 5-volt power source for the two op amp, temperature circuit, pic circuit, and also LCD display circuit. Refer the figure below, the D1 is use to protect the circuit from wrong polarity supply. C1 and C2 is use to stabilize the voltage at the input side of the LM7805 voltage regulator, while the C3 and C4 is use to stabilize the voltage output side of the LM7805 voltage supply. LED is a RED to indicate the power status of the circuit. R1 is resistor to protect LED from over current that will burn the LED.






                                                                  oscillator circuit

An addition, the pH meter circuit requires a 5-volt DC power source supplied from the dual positive and negative power supply circuit. The positive power supply is providing by the voltage regulator LM7805 component. Otherwise, the negative power supply is providing by the output voltage from ICL7660s component. The negative power supply circuit shown in figure below. We use ICL7660s because the device are monolithic CMOS power supply circuits with offer unique performance advantages over previously available devices. The ICL7660s performs supply voltage conversions from positive to negative for an input range of +1.5v to +10.0v resulting in complementary output voltages of -1.5v to -10.0v.





                                                 pH glass electrode

SENSING PROBE


The sensing probe is a glass electrode with two electrodes in built in it. The glass probe acts as a sensing part of the pH meter; it is actually a galvanic cell which converts the change in hydrogen ion concentration to a corresponding change in voltage. The sensing probe should be immersed in the solution whose pH is to be measured.

A glass electrode is a type of ion-selective electrode made of a doped glass membrane that is sensitive to a specific ion. It is an important part of the instrumentation for chemical analysis and physic- chemical studies. A typical modern pH probe is a combination electrode, which combines both the glass and reference electrodes into one body. The combination electrode consist of the following parts (refer figure):-
1.    A sensing part of electrode, a bulb made from a specific glass.
2.    Internal electrode, usually silver chloride electrode or calomel electrode
3.    Internal solution, usually a pH=7 buffered solution of 0.1 mol/KCL for pH electrodes or 0.1 mol/L MeC1 for pMe electrodes.
4.    When using the silver chloride electrode, a small amount of AgC1 can precipitate inside the glass electrode.
5.    Reference electrode, usually the same type as 2
6.    Reference internal solution, usually 0.1 mol/L KCL
7.    Junction with studied solution usually made from ceramics or capillary with asbestos or quartz fiber.
8.    Body of electrode, made from non-conductive glass or plastics.

The bottom of a pH electrode balloons out into a round thin glass bulb. The pH electrode is best thought of as a tube within a tube. The inside most tube (inner tube) contains an unchanging mol/L HCL solution. Also inside the inner tube is the cathode terminus of the reference probe. The anodic terminus wraps itself around the inside of the inner tube. It is filled with a reference solution of 0.1 mol /L KCL and has contact with the solution on the outside of the pH probe by us plug that serves as a salt bridge.

The value of voltage produced by the probe is fortunately a linear function of the pH. For example, at pH 7.00, the probe produce 0 volts while at pH 6.00, it produces +0.06 volts or +60 millivolts. Notice the positive polarity mark; if the voltage were of negative polarity, the meter pointer would go to the pH reading of 8.00. Generally, a probe will produce about 60 millivolts for each change of 1 pH unit. The theoretical output of standard Ag/AgCl pH probe is 59.16 mV /pH at 25⁰C with 0 volts out at a pH of 7.00.



BUFFER AMPLIFIER




                                 

                                                    LMC 6001 schematic circuit
   
Using an ultralow input current amplifier, a CMOS micro power op-amp, and a digital multi meter, you can construct a useful pH meter. The signal from a pH probe has a typical resistance between 10 mega ohms and 1000 mega ohms. Because of this is high value input impedance, it is very important that the amplifier input currents be as small as possible. The LMC6001, with the less than 25fA input current, in an ideal choice for this pH meter circuit.
The ultralow input current amplifier, the LMC6001, amplifies the probe output providing a scaled voltage of +/- 100mV/pH from a pH 7. Overall gain adjustments to the pH meter can be made via trimmer at PH 1. Hence, a buffer amplifier is used between the sensing probe and the following amplifier stages. LMC6001 is used in the amplifier as it having impedance in the range of terra ohms.




AMPLIFIER


Several amplifier stages are used for the purpose of boosting the voltage output from the sensing probe. The second op- amp, a micro power LMC6041, provides phase inversion and offset so that the output is directly proportional to the pH value, over the full range of the pH probe. The range of output providing by the LMC6041 is between 0 volt to 1.4 volt means that 0 until 14 ph.

Offset circuit, consists of a zener diode, two resistors, and the trimmer at PH 2. The output of LMC6041 can be directly coupled to a digital multi meter or converting into the analog to digital value using the PIC to display value in the digital value, that means can be calibrated to read






LCD DISPLAY




                                                       lcd display connection



The display unit used is an HD44780 LCD or LCD display 16x2. It is the final block and it displays the pH of the solution digitally and also displays the temperature value digitally. This LCD can be operated in two different modes, 4 bit mode and 8 bit mode.
 In 8 bit mode, pins 7-14 of the LCD are connected to eight Inputs/ output pins on the microcontroller. While in 4 bit mode, pins 11-14 on the LCD are connected to four inputs/ output pins on the microcontroller. The advantage to operating in 8 bit mode is that the programming is a bit simpler and data can be updated more quickly. The obvious reason to operate in 4 bit mode is to save four inputs/ output pins on the PIC microcontroller












Thursday, 27 February 2014

WEEK 4

made a lot of research, analysis and discussion regarding to project’s relevant, concept’s acceptance, and the development of this project itself