Water level detection system using PIC

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Water level detection system using PIC

Postby ccf11_kc » Wed Apr 13, 2016 1:01 pm

I'm doing a demo water level detection system using PIC16F887 as per attached circuit design.

I'm not sure on the program coding using MPLAB X IDE, i wish it can be function like below:
When WS01 (water sensor1) at RA0 detects water, LED01 at RC0 will be light up/blinking;
When WS02 (water sensor2) at RA1 detects water, LED02 at RC1 will be light up/blinking;
When WS03 (water sensor3) at RA2 detects water, LED03 at RC2 will be light up/blinking, buzzer triggered;
When SW01 is pressed, buzzer isolated.

Urgent, Appreciate if can get it done by this week.

TQVM
Attachments
circuit.JPG
Circuit design
ccf11_kc
Freshie
 
Posts: 5
Joined: Wed Dec 30, 2015 2:51 pm

Re: Water level detection system using PIC

Postby ober » Wed Apr 13, 2016 3:30 pm

Hi, have you refer to some of the tutorials from our tutorials site? SK40C+16F887 might be helpful.

Also what is the water level sensor you are using? I guess you need to at least kick start a simple code and from there we can give feedback to modify it accordingly.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Water level detection system using PIC

Postby ccf11_kc » Wed Apr 13, 2016 5:25 pm

Hi,

Yes I did refer to the tutorial site and i've written some codes, just not sure it is correct or not, and I afraid maybe sth miss out to include.

The water sensor that I'm using is this:
http://www.seeedstudio.com/wiki/index.p ... ter_Sensor

Attached herewith some part of my coding.

TQVM
Attachments
code.JPG
ccf11_kc
Freshie
 
Posts: 5
Joined: Wed Dec 30, 2015 2:51 pm

Re: Water level detection system using PIC

Postby ober » Thu Apr 14, 2016 2:15 am

Good that you have written the code. The best way to verify a code in embedded system is to try it out and look at the output.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Water level detection system using PIC

Postby ccf11_kc » Thu Apr 14, 2016 1:31 pm

Hi,

I try to build, but a lot of errors come out, something wrong in my coding?

TQ
Attachments
error.JPG
ccf11_kc
Freshie
 
Posts: 5
Joined: Wed Dec 30, 2015 2:51 pm

Re: Water level detection system using PIC

Postby ccf11_kc » Thu Apr 14, 2016 5:00 pm

Hi,

The sensor that I'm using is this type:
http://www.seeedstudio.com/wiki/index.p ... ter_Sensor

How i suppose to write the program to blink LED when sensor detect water?

TQ
ccf11_kc
Freshie
 
Posts: 5
Joined: Wed Dec 30, 2015 2:51 pm

Re: Water level detection system using PIC

Postby ober » Fri Apr 15, 2016 2:31 am

It seem you have quite a number of syntax error, are you new to C language? Try to start with the example in the tutorial. PIC is not like Arduino, there are many different types of compiler and different versions of it. Some will cause different error and warning. Yet, from the warnings and errors that you shared, it seem to be syntax for now. Use a working code and modify from that code.

BTW, share the actual c file might be helpful to yourself. At least we can look at the whole file.

How to write a program to blink LED when it detects different water level? Errr.... Have you written code to blink the LED? I believe it is quite good to start from LED blinking. And the sensor is a type of analog sensor, so understand what is ADC and how it works will come later.

You want straight answer, the tutorials have several of ADC example.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 34 guests

cron