Hello Mr. Marcel, I must thank you for your kind help. The opamp is working perfectly. I am sorry that I didn't have prior experience working with opamps. As you had suggested, I set a power supply of 900mV from DC RPS as an input to the BNC connector. I adjusted the offset voltage such that the output from pin 7 is exactly zero. When I reduced my input to zero, the output voltage goes to 4.139V. Hence, I have a span of 4.139V for 900mV. My next issue is building a program for this span. I have built a logic and I would like to know whether it is correct. 4.139V is the 848th step in an ADC where 5V is the reference. So the 900mV span varies in 848 steps i.e 1.0625mV/step. So I wrote a code as follows in mikroC. adc_value = adc_read(0); // I am reading from AN0 converted_value = (long) adc_value ; mv_value = 900 - (float)(1.0625*converted_value);// I am converting it into a 0-900mV scale mv1_value = (long)mv_value; // I am removing the decimals I am using the mv1_value to be printed on the LCD. I am getting junk characters displayed on my LCD. Is this the correct method to do it or is there an efficient way of doing this at hardware level or in terms of software level. Sairam ________________________________ From: Marcel Duchamp To: Microcontroller discussion list - Public. Sent: Sat, March 6, 2010 7:57:57 AM Subject: Re: [PIC} Orp Probe interface with PIC16F877A On 3/5/2010 5:49 PM, yamanoor sairam wrote: > Hello, Thanks for the kind reply. I will have to get back to you > after setting the potential divider circuit. However, I tried what > you had told me on a particular occasion. I set the potentiometer to > 0V and I applied a signal 3V or so, I got a negative voltage at pin > 7. I believe the opamp is working properly. I shall double check > this. >> If your probe puts out +800mV to the input, the first stage will >> turn this into +4V. If the offset pot is set to +2V, you will get >> 0V at the output. Now if the ORP voltage drops towards +200mV, the >> output will indeed rise to 3V. This is probably what you want. >> The total circuit gain at DC is +5. Your input span is 800mV -200mV >> = 600mV; .6V * 5 = 3V. > > You were right on the input voltage. When there is no signal, the > circuit displayed 4.2V and there was a gradual decrease in voltage > later. So let me understand what you had meant. my circuit has a span > of 3V. I am supposed to set the offset voltage such that 800mV is 0V > and 200mV is 3V. I shall check this and get back to you. I had been > so dumb applying a voltage of 3V using a DC RPS and I was worried > that I was not able to get an output. > > Sairam > I think you have a good understanding now. One more point you may know but if you don't, you need to understand. With a high impedance input circuit like this, if you simply remove the ORP probe then the output is indeterminate. With the input floating, random noise, leakage currents, power line influence, etc. will dominate and the output may go to any voltage between the power supply rails. And yes, you understand correctly about setting the offset voltage for your particular input span. Good luck and come back if you have more questions. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist