Page 1 of 1

How to configure Water Sensor for PIC18F4580 in c language?

PostPosted: Fri Sep 26, 2014 1:49 pm
by Aisar
How to configure Water Sensor for PIC18F4580 in c language? this is the product code SN-WS-11304P.

Re: How to configure Water Sensor in ADC for PIC18F4580?

PostPosted: Sat Sep 27, 2014 9:33 am
by yonghui
what Water sensor? where is the sensor?why need to configure water sensor in ADC?

Re: How to configure Water Sensor for PIC18F4580 in c langua

PostPosted: Sun Sep 28, 2014 6:39 pm
by Aisar
sorry for the wrong question previously....actually i need help how to declare water sensor in c language,because this sensor using analog signal.

Re: How to configure Water Sensor for PIC18F4580 in c langua

PostPosted: Sun Sep 28, 2014 6:42 pm
by Aisar
water sensor.PNG
this is the sensor...

Re: How to configure Water Sensor for PIC18F4580 in c langua

PostPosted: Sun Sep 28, 2014 8:32 pm
by ober
Declare sensor? Not really understand your question.

Basically it is just analog sensor just like other analog sensor, it output analog voltage.

Maybe checking this video by our internship student might be helpful.


Then configure your PIC to read analog voltage, compare it and decide what to do.

Re: How to configure Water Sensor for PIC18F4580 in c langua

PostPosted: Mon Sep 29, 2014 10:07 am
by yonghui
Hi,

i think you will need to read more on ADC part of datasheet of PIC. it will teach you on how to configure the PIC pin as analog pin, then configure the internal adc to read analog sensor. u can find sample code of ADC to refer. the water sensor will give analog value, and you will need to use the PIC internal adc to read the value.