Go Down

Topic: what sensor for DIY turbidimeter? (Read 656 times) previous topic - next topic

Gigiux

Hello,
I would like to build a turbidimeter to check the growth of bacteria since I don't have one in the lab. I have seen this project but I don't like the sensor because it is too big and must be immersed in the solution (which would contaminate the sample).
I have seen this one, which is about a spectrophotometer. Actually it would be even better but it is an overkill.
I am looking for an instrument where I can stick a 15 mL Falcon tube and measure the reduction of light intensity from a light source.
What emitter and sensor would you recommend? something I can buy from amazon, easy peasy.
Thank you



Gigiux

Just an addendum, if I place a LED at the other side of a cuvette, would the TCS230 Color Sensor be used to sense the light intensity reduction?

jremington

#4
Dec 18, 2020, 12:25 am Last Edit: Dec 18, 2020, 12:27 am by jremington
Probably. Try it and let us know.

Conventional turbidity measurements are usually done by measuring light scattering, rather than absorbance. The detector is mounted 90 degrees away from the light source.  But either method can be used to monitor bacterial growth in solution.

Gigiux

Could you suggest a sensor?
Perhaps BH1750FVILM393, or KY-018?

jremington

#6
Dec 21, 2020, 05:12 pm Last Edit: Dec 21, 2020, 05:15 pm by jremington
I would use an LED for the light source (with a constant current source to limit the current, for stability) and the TSL2591 as the detector.

I imagine a rectangular block with a hole drilled in it to fit the sample tube, and two holes perpendicular to the tube and to each other (for the light source and detector) would work well.

Gigiux

I have plugged the color sensor to a Leonardo following this scheme and ran this:

Code: [Select]
#include "Arduino.h"
#define S0 4 // purple
#define S1 5 // brown
#define S2 7 // orange
#define S3 6 // yellow
#define sensorOut 8 // green
// 5v = red, GRD = white
int redFreq = 0;
int greenFreq = 0;
int blueFreq = 0;

void setup() {
  pinMode(S0, OUTPUT);
  pinMode(S1, OUTPUT);
  pinMode(S2, OUTPUT);
  pinMode(S3, OUTPUT);
  pinMode(sensorOut, INPUT);

  // color
  digitalWrite(S0, HIGH);
  digitalWrite(S1, LOW);

  Serial.begin(9600);
}

void loop() {
  // read red
  digitalWrite(S2, LOW);
  digitalWrite(S3, LOW);
  redFreq = pulseIn(sensorOut, LOW);
  Serial.print("R = ");
  Serial.print(redFreq);
  delay(100);

  // read green
  digitalWrite(S2, HIGH);
  digitalWrite(S3, HIGH);
  greenFreq = pulseIn(sensorOut, LOW);
  Serial.print("G = ");
  Serial.print(greenFreq);
  delay(100);

  // read blue
  digitalWrite(S2, LOW);
  digitalWrite(S3, HIGH);
  blueFreq = pulseIn(sensorOut, LOW);
  Serial.print("B = ");
  Serial.print(blueFreq);
  delay(100);
}


but nothing happens. When I open the serial terminal (shouldn't it open by itself), it remains empty...
It is a problem of hardware or sketch? 

jremington

#8
Dec 28, 2020, 06:58 pm Last Edit: Dec 28, 2020, 07:50 pm by jremington
The tutorial was designed for the Uno. You may need to change some pins for the Leonardo.

Make sure that you can run the Blink program on the Leonardo, and use Serial.print() before starting a complex project.

In particular, after Serial.begin(), you should add this line:
Code: [Select]
while (!Serial); //wait for connection with host PC to be established

Quote
shouldn't it open by itself
No.

wvmarle

Do you have the Serial monitor set to 9600 bps? (I prefer to use 115200, gives much faster communication).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Gigiux

Further on this, I tried with this blink sketch:

Code: [Select]
#include "Arduino.h"

void setup()
{
  // initialize LED digital pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
  // blink 3 times
  for (int i=1;  i=3; i++) {
      digitalWrite(LED_BUILTIN, HIGH); // ON
      delay(100);
      digitalWrite(LED_BUILTIN, LOW); // OFF
      delay(100);
  }
  // keep off
  delay(150);
  // blink once
  digitalWrite(LED_BUILTIN, HIGH); // ON
  delay(250);
  digitalWrite(LED_BUILTIN, LOW); // OFF
  delay(250);
}


Building it did not give any error, also it was uploaded into Leonardo with no problems, but it does not blink. Did I forget something?

wvmarle

How does it look? Always on I guess?

One thing you forgot your eyes are not as fast as an Arduino... a sustained 0.1s on/0.1s off sequence (do have a good look at your for loop, there are two errors in there) will look as constant on.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Gigiux

No, the problem is that there is nothing at all. The 50 ms might have been too fast, but the 250 I could see it properly in previous tests. 

johnerrington

#13
Jan 21, 2021, 09:05 am Last Edit: Jan 21, 2021, 10:15 am by johnerrington
Code: [Select]
 for (int i=1;  i=3; i++) {
 could this be a clue?

Quote
I am looking for an instrument where I can stick a 15 mL Falcon tube and measure the reduction of light intensity from a light source.
Quote
Turbidimetry measures the cloudiness or turbidity of a solution. As demonstrated in Fig. 17.4B, the photodetector is placed such that it is in direct line with the incident light and the solution, usually referred to as either a 0° or 180° angle. The light source should emit a wavelength in the near ultraviolet range (290-410 nm).
https://www.sciencedirect.com/topics/medicine-and-dentistry/turbidimetry

Now UV leds are easy - but UV detectors not so.  As a suitable compromise I'd suggest a blue LED and a silicon photodiode as the sensor.

https://smile.amazon.co.uk/20pcs-Photodiode-Photosensitive-Diode-Sensitive/dp/B07Y2QJJCL/ref=sr_1_2?dchild=1&keywords=photodiode&qid=1611216224&sr=8-2

Receive wavelength Range (nM) 400-1000

I have a circuit here you could use https://forum.arduino.cc/index.php?topic=722227.0 post #13.

You can use a square wave (led on / off / on) to reduce the effect of ambient light on your tests.  

Needs a bit of engineering - maybe a cardboard tube to hold the LED and photodiode.

Have a look at this thread also  https://forum.arduino.cc/index.php?topic=700105.new#new
I'm trying to help. If I find your question interesting I'll give you karma. If you find my input useful please give me karma (I need it)

Gigiux

#14
Jan 23, 2021, 09:58 am Last Edit: Jan 23, 2021, 04:40 pm by Gigiux
Thank you for the links, but first I need to load the firmware. The hint is that `for (int i=1;  i=3; i++) {` only runs only once? But it is inside void loop(), hence that should be already an infinite loop. Or should I use something like:
do {
 Block of statements;
}
while(1);

Go Up