Go Down

Topic: Building a Tubidity meter (Read 2245 times) previous topic - next topic


Im trying to build a turbidity meter for my university project but I'm having so many problems, the project consists in a led or infrared emissor sending light that will pass through a hole in a water pipe and a receiver (LDR or Infrared receiver) that will read the intensity of the signal.

Im having problems with the receiver:
- First the LDR seems to be unstable if i try to read the turbidity of one sample multiples times it gives me different values.

-Then Im trying the Infrared receiver but this one is suffering a lot of interferance from outside, solar light and heat and also doesnt have a great scale to measure if the water is clean or dirty.

Do you guys have any tips to give to me? Any other option i should try?


So I have an infrared emitter and receiver but i doesnt know a lot about eletronics and Im having problems to know which resistence i must use while wiring it.

I already found the datasheet but i didnt understand anything while reading it, which specifications do I need to know to calculate the resistence.

Im using an Arduino nano and I what to use 5V.


Continuous current and forward voltage are factors, from the data sheet, for determining the current limiting resistor value. With that information, together with the voltage you intend to drive the led at, you can use an online led calculator to see what the value should be. These use a simple application of ohms law.

If the current is higher than an Arduino pin can tolerate, either increase the resistor value, or use a transistor to drive it.


At 20mA its forward voltage is 1.2V,
at 100mA its forward voltage is 1.4V.

So, lets say 20mA, with 5V supply:

Voltage across LED = 1.2V (from datasheet, assuming the current is set right)
Voltage across resistor must therefore be 5-1.2 = 3.8V
Current through resistor is 20mA,

R = V/I by definition of resistance, so R = 3.8/0.02 = 190 ohms.

Arduino pins can handle 20mA, and have roughly 40 ohms of internal resistance, so an external
resistor of 190 - 40 = 150 ohms would be appropriate.

At higher currents you'd need some sort of driver transistor, or MOSFET or relay or whatever.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]


The LDR is relatively slow and probably unduly sensitive to temperature.  Not sure whether it is very sensitive to IR either!

To use the other IR receiver, you need to modulate the light (LED) with a frequency - such as 38 kHz and use signal processing of some sort to measure the component at that frequency that is received.


Not sure what your application is but your photo transistor should be connected between an analogue input and ground. I would start with a 10K pull up resistor on that.

You should aim to get the un - illuminated photo transistor to give very roughly a reading of 512, you can change this by altering the 10K value.

However, depending on your application you might suffer from stray light giving just as low a reading as an illuminated sensor. Do not expect very much range, perhaps a couple of inches.


At 20mA its forward voltage is 1.2V,
at 100mA its forward voltage is 1.4V.


At higher currents you'd need some sort of driver transistor, or MOSFET or relay or whatever.
What is the difference of these two currents?
I want to emit IR continuously and read the intensity of the signal that achieves the receiver.

The ideia of my project is measure the turbidity of the water, so i have the emitter 180ยบ of the receiver and water between them.

So I will measure the turbidity of the water according to the intesity of the signal that reaches the receiver.


What is the difference of these two currents?
Well they are different, one is when you run the LED at 20mA and the other is when you run it at 100mA.

It is part of your design to decide what current you want to flow through the LED. The more current the brighter it will be. If it is 20mA to 30mA this can be powered through an Arduino pin. If it is higher you will have to put the Arduino signal through a transistor in order to achieve the required current. It is the resistor value that determines what current flows whether you use a transistor or not.


Aug 13, 2020, 08:16 pm Last Edit: Aug 13, 2020, 09:02 pm by Gustavohbo
Just to be clear!
I want to use a white LED with a LDR or an Infrared LED emitter with a IR receiver.
So you think that the IR receiver and emmiter are more appropriate for this project?

I have a IR kit 5mm LED, is it possible to modulate the LED signal?
I attached the datasheet of the receiver and emitter.

This is the code that Im using now

I have three IR receiver conected analogic pin (A1, A2, A3)
Code: [Select]

float readings = 20.0;
void setup() {

void loop() {
  int sum1 = 0;
  int sum2 = 0;
  int sum3 = 0;

  for (int i = 0; i < leituras; i++){
    sum1 += analogRead(A1);
    sum2 += analogRead(A2);
    sum3 += analogRead(A3);
    Serial.print("Readings 1: ");
    Serial.print(sum1 / readings );
    Serial.print("   Readings 2: ");
    Serial.print(sum2 / readings);
    Serial.print("   Readings 3: ");
    Serial.println(sum3 / readings);
 // }


Aug 13, 2020, 08:35 pm Last Edit: Aug 13, 2020, 09:53 pm by Gustavohbo
But using it with 100mA doesnt reduce it durability? or any other problem?


What is connected to A1, A2 & A3?


Ops, i forgot to mention that.
I arleady edit my post.


But using it with 100maH doesnt reduce it durability? or any other problem?
The main "other" problem you have is that an Arduino board cannot directly handle 100mA, so you must use a suitable transistor circuit.


But using it with 100maH doesnt reduce it durability? or any other problem?
mAH is the wrong unit. That describes milliampere hours, not milliamperes.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.


Aug 13, 2020, 09:58 pm Last Edit: Aug 13, 2020, 10:01 pm by Gustavohbo
And how about the IR receiver, which resistence i must use?
I have followed some tutorials online and they said many differents values.
I'm using 5V.
I tried 10k but the output is frozen, and keep showing 14.

The pins of receiver are inverted?
The longer is negative and the shorter is positive?

Go Up