0% found this document useful (0 votes)
242 views

Arduino Sensor Datasheets and Circuit Diagram

The document describes several sensors used to monitor water quality including a pH probe sensor, water level sensor, temperature sensor, total dissolved solids (TDS) sensor. It provides details on the pinouts, features, and specifications of each sensor. It also includes the circuit connection and code used to read data from the sensors and display the readings in serial monitor.

Uploaded by

Sugar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
242 views

Arduino Sensor Datasheets and Circuit Diagram

The document describes several sensors used to monitor water quality including a pH probe sensor, water level sensor, temperature sensor, total dissolved solids (TDS) sensor. It provides details on the pinouts, features, and specifications of each sensor. It also includes the circuit connection and code used to read data from the sensors and display the readings in serial monitor.

Uploaded by

Sugar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

pH probe module sensor (Analog output)

Pinouts:
TO – Temperature output
DO – 3.3V Output (from ph limit pot)
PO – PH analog output
Gnd – Ground for PH probe
Gnd – Gnd for board
VCC – 5V DC
POT 1 – Analog reading offset (Nearest to BNC connector)
POT 2 – PH limit setting

Features:
Working current: 5-10mA
Detectable concentration range: PH0-14
Detection Temperature range: 0-80 ℃
Component Power: ≤0.5W
Working temperature: -10 ~ 50 ℃ (nominal temperature 20 ℃)
Humidity: 95% RH (nominal humidity 65% RH)
Module Size: 42mm × 32mm × 20mm
Output: analog voltage signal output
With 4pcs M3 Mounting Holes
PH limit setting
Analog readout offset setting

https://www.botshop.co.za/how-to-use-a-ph-probe-and-sensor/
Water level sensor (Analog output)

Pinouts:
+: VCC
-: GND
S: Analog output

Features:
Operating voltage: DC 5V
Working current: less than 20mA
Sensor Type: Analog
Detection area: 40mm x16mm
Working temperature: 10℃ - 30℃
Operating Humidity: 10% ~ 90% non-condensing
Weight: 3g
Product Dimensions: 65mm x 20mm x 8mm

https://www.fecegypt.com/uploads/dataSheet/1480850810_water.pdf
Waterproof Temperature Sensor DS18B20 (Digital output)

Pinouts:
Yellow: Digital out
Black: GND
Red: Vcc

Features:
Power supply range: 3.0V to 5.5V
Operating temperature range: -55°C to +125°C (-67F to +257F)
Storage temperature range: -55°CC to +125°C (-67F to +257F)
Accuracy over the range of -10°C to +85°C: ±0.5°C
3-pin 2510 Female Header Housing
Waterproof Stainless-steel sheath
Stainless steel sheath

https://www.terraelectronica.ru/pdf/show?pdf_file=%2Fz%2FDatasheet%2F1%2F1420644897.pdf
Total dissolved solid (TDS) sensor (Analog output)

Pinouts:
Yellow/Blue: Analog out
Black: GND
Red: Vcc

Features:
Input Voltage: 3.3 ~ 5.5V
Output Voltage: 0 ~ 2.3V
Working Current: 3 ~ 6mA
TDS Measurement Range: 0 ~ 1000ppm
TDS Measurement Accuracy: ± 10% F.S. (25 ℃)
Module Size: 42 * 32mm
Module Interface: PH2.0-3P
Electrode Interface: XH2.54-2P

https://media.digikey.com/pdf/Data%20Sheets/DFRobot%20PDFs/SEN0244_Web.pdf
Shops where we bought the items:
pH sensor: https://www.lazada.com.ph/products/liquid-ph-value-detection-detect-sensor-module-
monitoring-control-for-arduino-bnc-electrode-probe-i270290150-s387326603.html?
spm=a2o4l.searchlist.list.7.43de6156hu0Sfd&search=1
Water Level: https://www.lazada.com.ph/products/water-level-sensor-module-i163222042-
s200830710.html?spm=a2o4l.seller.list.1.4bbc2520M0NSDo&mp=1
Ds18B20 Waterproof Temperature sensor: https://www.lazada.com.ph/products/ds18b20-stainless-steel-
package-waterproof-ds1820-temperature-probe-temperature-sensor-18b20-for-arduino-diy-ki-
i217955212-s284389340.html?spm=a2o4l.seller.list.1.e6f42520iTUYAc&mp=1
TDS Sensor: https://www.lazada.com.ph/products/analog-tds-sensor-meter-v10-for-arduino-i297320199-
s503872083.html?spm=a2o4l.searchlist.list.3.6bd66c9avTRi3U&search=1

Circuit connection:

Circuit Code:

#include <SoftwareSerial.h>

////TDS Sensor pin A0


#include <EEPROM.h>
#include "GravityTDS.h"
#define TdsSensorPin A0
GravityTDS gravityTds;
float temperature = 25,tdsValue = 0;
int tds;

//ph Sensor Pin A1


const int phPin = A1;
int phValue = 0;
unsigned long int phAveValue;
float b;
int buf[10],temp;
int tempe;
int pH;

//water level Pin A2


const int wLPin = A2;
float wLValue, level;
int water;

////Temperature Pin 2
#include <OneWire.h>
int DS18S20_Pin = 2;
OneWire ds(DS18S20_Pin);
int wTemp;

/// max & min values


int lLow, lHigh, tLow, tHigh, pLow, pHigh, eLow, eHigh;
int reading[1000];
int numReading = 1000;
int index =0;

void setup() {
Serial.begin(9600);
gravityTds.setPin(TdsSensorPin);
gravityTds.setAref(5.0); //reference voltage on ADC, default 5.0V on Arduino UNO
gravityTds.setAdcRange(1024); //1024 for 10bit ADC;4096 for 12bit ADC
gravityTds.begin(); //initialization

//Getting max and min values


lHigh=water;
lLow=99;
tHigh=wTemp;
tLow=30;
pHigh=pH;
pLow=7;
eHigh=tds;
eLow=300;
}

//temperature sensor parralled with 100k ohms S&+


float getTemp(){
byte data[12];
byte addr[8];

if ( !ds.search(addr)) {
//no more sensors on chain, reset search
ds.reset_search();
return -1000;
}

if ( OneWire::crc8( addr, 7) != addr[7]) {


Serial.println("CRC is not valid!");
return -1000;
}

if ( addr[0] != 0x10 && addr[0] != 0x28) {


Serial.print("Device is not recognized");
return -1000;
}

ds.reset();
ds.select(addr);
ds.write(0x44,1);
byte present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad

for (int a = 0; a < 9; a++ ) {


data[a] = ds.read();
}

ds.reset_search();

byte MSB = data[1];


byte LSB = data[0];

float tempRead = ((MSB << 8) | LSB);


float TemperatureSum = tempRead / 16;

return TemperatureSum;
delay(10000);
}

void loop() {

/////////////show Temperature //////////////////////


float temperature = getTemp();
wTemp = temperature;
//wTemp = (temperature*9/5)+ 32;
// formula C to F (0°C × 9/5) + 32 = 32°F

/////////////show Ph ////// value turns (-) with other sensors


for(int i=0;i<10;i++) {
buf[i]=analogRead(phPin);
delay(10);
}
for(int i=0;i<9;i++){
for(int j=i+1;j<10;j++){
if(buf[i]>buf[j]){
temp=buf[i];
buf[i]=buf[j];
buf[j]=temp;
}
}
}
phAveValue=0;
for(int i=2;i<8;i++)
phAveValue+=buf[i];
float pHVol=(float)phAveValue*5.0/1024/6;
float phAveValue = -5.70 * pHVol + 21.34;
phAveValue=phAveValue*(-1);
pH = phAveValue;

/////////////show Water Level /////up to 35mm-40mm


wLValue = analogRead(wLPin);
//level = (40/705)*wLValue;
level = (wLValue/600)*100;
water = level;

/////////////////show TDS /////// with other sensors 0--> 4ppm


gravityTds.setTemperature(temperature); // set the temperature and execute temperature compensation
gravityTds.update(); //sample and calculate
tdsValue = gravityTds.getTdsValue(); // then get the value
tds=tdsValue;
//Serial.print(tdsValue,0);

//ouputs
//Serial.print("TDS = ");
Serial.print(tds); //A0 float tdsValue | int tds //sensorVals[0]
Serial.print(",");
//Serial.print("pH = ");
Serial.print(pH);//A1 phAveValue | int pH //sensorVals[1]
Serial.print(",");
//Serial.print("Level = ");
Serial.print(water);//A2 level | int water //sensorVals[2]
Serial.print(",");
//Serial.print("Temp = ");
Serial.print(wTemp);//2 temperature | int wTemp //sensorVals[3]

//getting Max and min values


reading[index]=water;
index++;

if (index>=numReading) index =0;


//water level
if (water < lLow) lLow=water;
if (water > lHigh) lHigh=water;
//Temperaure
if (wTemp < tLow) tLow=wTemp;
if (wTemp > tHigh) tHigh=wTemp;
//pH Level
if (pH < pLow) pLow=pH;
if (pH > pHigh) pHigh=pH;
//Tds Level
if (tds < eLow) eLow=tds;
if (tds > eHigh) eHigh=tds;

Serial.print(",");
Serial.print(eHigh); //sensorVals[4]
Serial.print(",");
Serial.print(pHigh); //sensorVals[5]
Serial.print(",");
Serial.print(lHigh); //sensorVals[6]
Serial.print(",");
Serial.print(tHigh); //sensorVals[7]

Serial.print(", ");
Serial.print(eLow); //sensorVals[8]
Serial.print(",");
Serial.print(pLow); //sensorVals[9]
Serial.print(",");
Serial.print(lLow); //sensorVals[10]
Serial.print(",");
Serial.println(tLow); //sensorVals[11]

delay(1000);

You might also like