ph meter using pic 16f877

Status
Not open for further replies.

sinorbee

Newbie level 6
Joined
Apr 8, 2013
Messages
12
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Visit site
Activity points
1,366
hello i am doing a ph meter using pic micro controller project, i am done with the circuit using op amp to amplify the voltage range i receive from my ph meter now need to do some c programming for my pic 16f877.....is there anyone can help me to read the adc and display the value?
 

Re: ph meter using pic 16f877 pls help on coding

which compiler u r using? and whats ur display?
 
Reactions: elekia

    elekia

    Points: 2
    Helpful Answer Positive Rating
Re: ph meter using pic 16f877 pls help on coding

Which Compiler are you using? What is your Clock freq? How is LCD connected to microcontroller? To which adc pin op-amp output is connected? Is op-amp output in the range of 0 to 5V?
 
Re: ph meter using pic 16f877 pls help on coding

which compiler u r using? and whats ur display?




i am using ccs compiler and my display will be ph value..................any help would be appreciated

- - - Updated - - -

Which Compiler are you using? What is your Clock freq? How is LCD connected to microcontroller? To which adc pin op-amp output is connected? Is op-amp output in the range of 0 to 5V?

i am using ccs compiler and my clock frequency is 20Mhz................my op-amp output is connected to RA2 and my lcd is connected to port B..............the op am output range is 0-5v........any help would appreciated. thank you very much.
 

Re: ph meter using pic 16f877 pls help on coding

I mean to ask what type of display u r using? is it 16x2?

if so can I assume PORTB is data and what abt control pins (EN, RS, R/W)?
 

Re: ph meter using pic 16f877 pls help on coding



here is my circuit

- - - Updated - - -

I mean to ask what type of display u r using? is it 16x2?

if so can I assume PORTB is data and what abt control pins (EN, RS, R/W)?




i am sorry abt that.......yeah i am using lcd 16x2 and my port B is connected with my lcd and abt control pins i am not sure abt it
 
Reactions: elekia

    elekia

    Points: 2
    Helpful Answer Positive Rating
Re: ph meter using pic 16f877 pls help on coding

u r using 4-bit mode of operation for driving LCD.

RB1, RB2, RB3 are control pins and RB4 - RB7 data line.

In my next post (may b tomorrow) I'll post some sample code to read ADC and display it on LCD.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Re: ph meter using pic 16f877 pls help on coding

Extract these files to desktop\CCS C Project\ph_meter

Is your Ph sensor output linear? Post your ph sensor datasheet.
 

Attachments

  • ph_meter.rar
    50.2 KB · Views: 386
Re: ph meter using pic 16f877 pls help on coding

That link doesn't give much information about the pH sensor. Measure the pH of a solution with a ready pH meter and note the value. Then put your pH sensor in that solution and see what reading it gives on the LCD. Then post both the pH of the solution and the reading (raw adc value) you got from your pH sensor. I will write the code for it.
 

Re: ph meter using pic 16f877 pls help on coding

ok my reading from my sensor is
2.54V for pH7 water.
so i want the water to maintain at pH7 if lesser or higher i will flush it out using a pump or a dc motor and at the same time i wanna control the water level so it wont over flow when the new water being flushed in the tank.......
hope you understand
thank you in advance bro

- - - Updated - - -

Ra0-high water level-sensor
Ra1-low water level-sensor
Ra2-ph-sensor
Rc5-motor output
will attached my full schematic

- - - Updated - - -

this is my schematic n coding for water level
any help will be appreciate thank you
 

Attachments

  • naren.rar
    54.1 KB · Views: 239

Re: ph meter using pic 16f877 pls help on coding

Extract the files to Desktop\CCS C Project\ph_meter

I have not set RA0 and RA1 as digital input because there is no option to set them as digital input pins when ADC is used. You have to find a way to make those pins digital input pins. If you can make RA2 alone as Analog input that will be good. I checked the 16f877a.h file but there is no option to set just RA2 pin as analog input.

It gives ph = 7.031 for 2.55V

 

Attachments

  • ph.jpg
    237 KB · Views: 553
  • ph_meter.rar
    54.1 KB · Views: 260
Re: ph meter using pic 16f877 pls help on coding

is it possible if i set the water level sensor on the port D
 

Re: ph meter using pic 16f877 pls help on coding

It will be ok if you can set Sensors (water level) on PORTB or PORTC or PORTD. If you want to use PORTA for sensors then I can write the code in mikroC and not CCS C.
 

Re: ph meter using pic 16f877 pls help on coding

so if i set up sensor(water level) on portD then the motor will be on portC then the ph sensor on
portA is it possible for u to provide me the code? but i need to run the motor as following the ph value and stop when the water reach high level.
 

Re: ph meter using pic 16f877 pls help on coding

Yes. I can write the code but when will be the Motor ON or OFF is not clear to me. Explain the condition for Motor to be ON and OFF.
 

Re: ph meter using pic 16f877 pls help on coding

i am very sorry totally forgot about the other motor,
actually there are 2 motors.
Motor A for inlet and motor B for outlet.
the process starts when motor A pump in water then stop when the water reach high level, then ph sensor check the value if the ph value is higher or less than ph 7 the motor B will pump out the water.
Again the Motor A will sense the water level low and pump in water.
This system is just to monitor.
Sorry for the inconvenience .
Thank you.
 

Re: ph meter using pic 16f877 pls help on coding


this is my schematic

- - - Updated - - -

i have two motors,
motor a= inlet(c5)
motor b=outlet(c6)
motor a will pump in water until reach the high level then ph sensor check the ph value if the value is less or higher than 7 motor b will pump out the water
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…