{"product_id":"arduino-tds-sensor-module-in-pakistan-water-quality-sensor-for-arduino-v1-0","title":"Arduino Tds Sensor Module Water Quality Sensor For Arduino V1.0","description":"\u003ch1 style=\"margin-bottom: 1em; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003eTDS Meter V1.0 Module Water Quality Sensor for Arduino\u003c\/h1\u003e\n\u003cdiv\u003e\n\u003cspan style=\"font-weight: bold;\"\u003eTDS sensor\u003c\/span\u003e kit is compatible with Arduino controllers, plug and play, easy to use.\u003cbr\u003eIt can be applied to measure TDS value of the water, to reflect the cleanliness of the water.\u003cbr\u003eTDS (Total Dissolved Solids) indicates that how many milligrams of soluble solids dissolved in one liter of water. In general, the higher the TDS value, the more soluble solids dissolved in water, and the less clean the water is.\u003cbr\u003eTherefore, the TDS value can be used as one of the references for reflecting the cleanliness of water\u003cbr style=\"margin-bottom: 0px;\"\u003eMeasuring the TDS value in the water is to measure the total amount of various organic or inorganic substances dissolved in water, in the unit of ppm or milligrams per liter (mg\/l).\u003c\/div\u003e\n\u003ch2 style=\"margin-bottom: 1em; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003e\u003cspan style=\"margin-bottom: 0px;\" class=\"mw-headline\" id=\"Technical_Parameters\"\u003eTechnical Parameters\u003c\/span\u003e\u003c\/h2\u003e\n\u003ch3 style=\"margin-top: 0px; margin-bottom: 1em; font-weight: 500; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003e\u003cspan style=\"margin-bottom: 0px;\" class=\"mw-headline\" id=\"TDS_Meter:\"\u003eTDS Meter:\u003c\/span\u003e\u003c\/h3\u003e\n\u003cul style=\"padding-left: 2rem; margin-top: 0px; margin-bottom: 1rem; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px; letter-spacing: -0.14px;\"\u003e\n\u003cli\u003eInput Voltage: DC 3.3 ~ 5.5V\u003c\/li\u003e\n\u003cli\u003eOutput Voltage: 0 ~ 2.3V\u003c\/li\u003e\n\u003cli\u003eWorking Current: 3 ~ 6mA\u003c\/li\u003e\n\u003cli\u003eTDS Measurement Range: 0 ~ 1000ppm\u003c\/li\u003e\n\u003cli\u003eTDS Measurement Accuracy: ± 10% F.S. (25 ℃)\u003c\/li\u003e\n\u003cli\u003eModule Interface: XH2.54-3P\u003c\/li\u003e\n\u003cli style=\"margin-bottom: 0px;\"\u003eElectrode Interface: XH2.54-2P\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cdiv\u003e \u003c\/div\u003e\n\u003ch3 style=\"margin-top: 0px; margin-bottom: 1em; font-weight: 500; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003e\u003cspan style=\"margin-bottom: 0px;\" class=\"mw-headline\" id=\"TDS_Probe:\"\u003eTDS Probe:\u003c\/span\u003e\u003c\/h3\u003e\n\u003cul style=\"padding-left: 2rem; margin-top: 0px; margin-bottom: 1rem; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px; letter-spacing: -0.14px;\"\u003e\n\u003cli\u003eNumber of Needle: 2\u003c\/li\u003e\n\u003cli\u003eTotal Length: 60cm\u003c\/li\u003e\n\u003cli\u003eConnection Interface: XH2.54-2P\u003c\/li\u003e\n\u003cli\u003eColor: White\u003c\/li\u003e\n\u003cli style=\"margin-bottom: 0px;\"\u003eOther: Waterproof Probe\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cdiv\u003e \u003c\/div\u003e\n\u003ch2 style=\"margin-bottom: 1em; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003e\u003cspan style=\"margin-bottom: 0px;\" class=\"mw-headline\" id=\"Shipping_List\"\u003eShipping List\u003c\/span\u003e\u003c\/h2\u003e\n\u003cul style=\"padding-left: 2rem; margin-top: 0px; margin-bottom: 1rem; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 14px; letter-spacing: -0.14px;\"\u003e\n\u003cli\u003eTDS Meter V1.0 for Arduino x1\u003c\/li\u003e\n\u003cli\u003eWaterproof TDS Probe x1\u003c\/li\u003e\n\u003cli style=\"margin-bottom: 0px;\"\u003eXH2.54-3Pin Jumper Wire x1\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cdiv\u003e\n\u003cbr\u003e\n\u003cdiv\u003e\u003cspan style=\"margin-bottom: 0px;\" id=\"more-36432\"\u003e\u003c\/span\u003e\u003c\/div\u003e\n\u003ch2 style=\"margin-bottom: 1em; line-height: 1.043em; font-size: 1.643em; color: rgb(51, 62, 72); font-family: Inter, 'Open Sans', HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; letter-spacing: -0.14px;\"\u003e\u003cspan style=\"margin-bottom: 0px;\" class=\"mw-headline\" id=\"Test_Code\"\u003eTest Code\u003c\/span\u003e\u003c\/h2\u003e\n\u003cpre style=\"font-family: var(--bs-font-monospace); font-size: 0.875em; direction: ltr; unicode-bidi: bidi-override; margin-top: 0px; margin-bottom: 0px; overflow: auto; color: rgb(51, 62, 72); letter-spacing: -0.14px;\"\u003e\u003ccode style=\"font-family: var(--bs-font-monospace); font-size: inherit; direction: ltr; unicode-bidi: bidi-override; color: inherit; overflow-wrap: break-word; word-break: normal; margin-bottom: 0px;\"\u003e#define TdsSensorPin A1\n#define VREF 5.0 \/\/ analog reference voltage(Volt) of the ADC\n#define SCOUNT 30 \/\/ sum of sample point\nint analogBuffer[SCOUNT]; \/\/ store the analog value in the array, read from ADC\nint analogBufferTemp[SCOUNT];\nint analogBufferIndex = 0,copyIndex = 0;\nfloat averageVoltage = 0,tdsValue = 0,temperature = 25;\nvoid setup()\n{\nSerial.begin(115200);\npinMode(TdsSensorPin,INPUT);\n}\nvoid loop()\n{\nstatic unsigned long analogSampleTimepoint = millis();\nif(millis()-analogSampleTimepoint \u0026gt; 40U) \/\/every 40 milliseconds,read the analog value from the ADC\n{\nanalogSampleTimepoint = millis();\nanalogBuffer[analogBufferIndex] = analogRead(TdsSensorPin); \/\/read the analog value and store into the buffer\nanalogBufferIndex++;\nif(analogBufferIndex == SCOUNT)\nanalogBufferIndex = 0;\n}\nstatic unsigned long printTimepoint = millis();\nif(millis()-printTimepoint \u0026gt; 800U)\n{\nprintTimepoint = millis();\nfor(copyIndex=0;copyIndex\u0026lt;SCOUNT;copyIndex++)\nanalogBufferTemp[copyIndex]= analogBuffer[copyIndex];\naverageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * (float)VREF\/ 1024.0; \/\/ read the analog value more stable by the median filtering algorithm, and convert to voltage value\nfloat compensationCoefficient=1.0+0.02*(temperature-25.0); \/\/temperature compensation formula: fFinalResult(25^C) = fFinalResult(current)\/(1.0+0.02*(fTP-25.0));\nfloat compensationVolatge=averageVoltage\/compensationCoefficient; \/\/temperature compensation\ntdsValue=(133.42*compensationVolatge*compensationVolatge*compensationVolatge - 255.86*compensationVolatge*compensationVolatge + 857.39*compensationVolatge)*0.5; \/\/convert voltage value to tds value\n\/\/Serial.print(\"voltage:\");\n\/\/Serial.print(averageVoltage,2);\n\/\/Serial.print(\"V \");\nSerial.print(\"TDS Value:\");\nSerial.print(tdsValue,0);\nSerial.println(\"ppm\");\n}\n}\nint getMedianNum(int bArray[], int iFilterLen)\n{\nint bTab[iFilterLen];\nfor (byte i = 0; i\u0026lt;iFilterLen; i++)\nbTab[i] = bArray[i];\nint i, j, bTemp;\nfor (j = 0; j \u0026lt; iFilterLen - 1; j++)\n{\nfor (i = 0; i \u0026lt; iFilterLen - j - 1; i++)\n{\nif (bTab[i] \u0026gt; bTab[i + 1])\n{\nbTemp = bTab[i];\nbTab[i] = bTab[i + 1];\nbTab[i + 1] = bTemp;\n}\n}\n}\nif ((iFilterLen \u0026amp; 1) \u0026gt; 0)\nbTemp = bTab[(iFilterLen - 1) \/ 2];\nelse\nbTemp = (bTab[iFilterLen \/ 2] + bTab[iFilterLen \/ 2 - 1]) \/ 2;\nreturn bTemp;\n}\u003c\/code\u003e\u003c\/pre\u003e\n\u003c\/div\u003e","brand":"Digilog Electronics","offers":[{"title":"Default Title","offer_id":43962561724481,"sku":"b122,krt123","price":1200.0,"currency_code":"PKR","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0727\/2805\/1777\/files\/61MV2RrCELL._SL1227.jpg?v=1779576489","url":"https:\/\/stem.pk\/products\/arduino-tds-sensor-module-in-pakistan-water-quality-sensor-for-arduino-v1-0","provider":"stem.pk","version":"1.0","type":"link"}