cancel
Showing results for 
Search instead for 
Did you mean: 

Code Examples

diluc_3555836
New Contributor II

Hello

I would like to ask if anyone had the opportunity to work with the Turbidity Sensor, since I do not find much reference on this device to program it and use it in a psoc5.

If there is a tutorial to start and start programming it.

I attach an image of the sensor

1 Solution
Len_CONSULTRON
Honored Contributor II

Diego,

I've attached a project as a starting point for you.  It was configured to work on a CY8CKIT-059 PSoc 5LP but can be modified to work on other PSoC kits and eval boards.

Look at TopDesign for the internal components used and the pins to be wired to the sensor.  It's only four connections to be wired to the sensor (GADV).  It uses the kit's USB as UART communication @ 115K 8N1 and displays to a terminal program the analog voltage value (in milliVolts) and the digital value once every second.

Once you have it working, you can modify it as needed for your application.

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
3 Replies
Len_CONSULTRON
Honored Contributor II

Diego,

I have not worked with a Turbidity sensor.  I tried locating the part you show in the picture.  I've had some luck but cannot be sure it is the same part.

Here is what I found:  The connector on the board shown with GADV is as follows:

G = Ground

A = Analog  ouput

D = Digital level output

V = +5V

Pin G and V are obvious.  A and D however are not.  Without a datasheet for the part, you can't be sure how to use it.

The good news, is that hooking it up to the PSoC5LP should be very easy.  Are you using the CY8CKIT-059 PSoc 5LP Kit?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
diluc_3555836
New Contributor II

these are the specifications that the sensor has:

  • Operating Voltage: 5V DC
  • Operating Current: 40mA (MAX)
  • Response Time : <500ms
  • Insulation Resistance: 100M (Min)
  • Output Method:
    • Analog output: 0-4.5V
    • Digital Output: High/Low level signal (you can adjust the threshold value by adjusting the potentiometer)
  • Operating Temperature: 5℃~90℃
  • Storage Temperature: -10℃~90℃
  • Weight: 30g
  • Adapter Dimensions: 38mm*28mm*10mm/1.5inches *1.1inches*0.4inches

Work with this code, but in arduino

int ledPin = 13// Connect an LED on pin 13, or use the onboard one

int sensor_in = 2// Connect turbidity sensor to Digital Pin 2 

void setup()

{

pinMode(ledPin, OUTPUT);  // Set ledPin to output mode

pinMode(sensor_in, INPUT);  //Set the turbidity sensor pin to input mode

void loop()

{

if(digitalRead(sensor_in)==LOW){  //read sensor signal

digitalWrite(ledPin, HIGH);  // if sensor is LOW, then turn on

}

else{ digitalWrite(ledPin, LOW);  // if sensor is HIGH, then turn off the led

}

}

0 Likes
Len_CONSULTRON
Honored Contributor II

Diego,

I've attached a project as a starting point for you.  It was configured to work on a CY8CKIT-059 PSoc 5LP but can be modified to work on other PSoC kits and eval boards.

Look at TopDesign for the internal components used and the pins to be wired to the sensor.  It's only four connections to be wired to the sensor (GADV).  It uses the kit's USB as UART communication @ 115K 8N1 and displays to a terminal program the analog voltage value (in milliVolts) and the digital value once every second.

Once you have it working, you can modify it as needed for your application.

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes