Computers
Computer Parts
Custom PC Builder
DIY/ Maker
{$smarty.capture.menu}
Activity
Categories
Discussions
Computers
Computer Parts
Custom PC Builder
DIY/ Maker
Inland TDS Meter V1.0 - Micro Center
<main> <article class="userContent"> <h2 data-id="inland-tds-meter-v1.0"> Inland TDS Meter V1.0</h2><div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6031942/uploads/D735GJUI9Z2B/image.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6031942/uploads/D735GJUI9Z2B/image.png" alt="image.png" height="443" width="663" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <h2 data-id="description">Description</h2><p>TDS sensor kit is compatible with Arduino controllers, plug and play, easy to use. It can be applied to measure TDS value of the water, to reflect the cleanliness of the water. </p><p>TDS (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. Therefore, the TDS value can be used as one of the references for reflecting the cleanliness of water. Measuring 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). Its Electrode can measure conductive materials, such as suspended solids, heavy metals and conductive ions in water. The module comes with four 3.2mm fixed holes, easy to mount on any other devices.</p><h2 data-id="technical-parameters">Technical Parameters</h2><p><strong>TDS Meter:</strong></p><p>· Input Voltage: DC 3.3 ~ 5.5V</p><p>· Output Voltage: 0 ~ 2.3V</p><p>· Working Current: 3 ~ 6mA</p><p>· TDS Measurement Range: 0 ~ 1000ppm</p><p>· TDS Measurement Accuracy: ± 10% F.S. (25 ℃) </p><p>· Module Interface: XH2.54-3P</p><p>· Electrode Interface: XH2.54-2P</p><p> <strong>TDS Probe:</strong></p><p>· Number of Needle: 2</p><p>· Total Length: 60cm</p><p>· Connection Interface: XH2.54-2P</p><p>· Color: White</p><p>· Other: Waterproof Probe</p><h2 data-id="shipping-list">Shipping List</h2><p>· TDS Meter V1.0 for Arduino x1 </p><p>· Waterproof TDS Probe x1 </p><p>· XH2.54-3Pin Jumper Wire x1 </p><h2 data-id="hookup-guide">Hookup Guide</h2><div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6031942/uploads/844GILTCOKFG/image.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6031942/uploads/844GILTCOKFG/image.png" alt="image.png" height="315" width="665" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <h2 data-id="test-code%3A">Test Code:</h2><pre class="code codeBlock" spellcheck="false" tabindex="0">#define TdsSensorPin A1 #define VREF 5.0 // analog reference voltage(Volt) of the ADC #define SCOUNT 30 // sum of sample point int analogBuffer[SCOUNT]; // store the analog value in the array, read from ADC int analogBufferTemp[SCOUNT]; int analogBufferIndex = 0,copyIndex = 0; float averageVoltage = 0,tdsValue = 0,temperature = 25; void setup() { Serial.begin(115200); pinMode(TdsSensorPin,INPUT); } void loop() { static unsigned long analogSampleTimepoint = millis(); if(millis()-analogSampleTimepoint > 40U) //every 40 milliseconds,read the analog value from the ADC { analogSampleTimepoint = millis(); analogBuffer[analogBufferIndex] = analogRead(TdsSensorPin); //read the analog value and store into the buffer analogBufferIndex++; if(analogBufferIndex == SCOUNT) analogBufferIndex = 0; } static unsigned long printTimepoint = millis(); if(millis()-printTimepoint > 800U) { printTimepoint = millis(); for(copyIndex=0;copyIndex<SCOUNT;copyIndex++) analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; averageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * (float)VREF/ 1024.0; // read the analog value more stable by the median filtering algorithm, and convert to voltage value float compensationCoefficient=1.0+0.02*(temperature-25.0); //temperature compensation formula: fFinalResult(25^C) = fFinalResult(current)/(1.0+0.02*(fTP-25.0)); float compensationVolatge=averageVoltage/compensationCoefficient; //temperature compensation tdsValue=(133.42*compensationVolatge*compensationVolatge*compensationVolatge - 255.86*compensationVolatge*compensationVolatge + 857.39*compensationVolatge)*0.5; //convert voltage value to tds value //Serial.print("voltage:"); //Serial.print(averageVoltage,2); //Serial.print("V "); Serial.print("TDS Value:"); Serial.print(tdsValue,0); Serial.println("ppm"); } } int getMedianNum(int bArray[], int iFilterLen) { int bTab[iFilterLen]; for (byte i = 0; i<iFilterLen; i++) bTab[i] = bArray[i]; int i, j, bTemp; for (j = 0; j < iFilterLen - 1; j++) { for (i = 0; i < iFilterLen - j - 1; i++) { if (bTab[i] > bTab[i + 1]) { bTemp = bTab[i]; bTab[i] = bTab[i + 1]; bTab[i + 1] = bTemp; } } } if ((iFilterLen & 1) > 0) bTemp = bTab[(iFilterLen - 1) / 2]; else bTemp = (bTab[iFilterLen / 2] + bTab[iFilterLen / 2 - 1]) / 2; return bTemp; } </pre><h2 data-id="test-result">Test Result</h2><p>Done uploading the code, open the serial monitor and set the baud rate to 115200.</p><div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6031942/uploads/B99UCGIMEI26/image.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6031942/uploads/B99UCGIMEI26/image.png" alt="image.png" height="698" width="582" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <p>Place the TDS probe into water; it can measure the TDS value of the water and show the value on the monitor.</p><div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6031942/uploads/AN4PCHMHL9AX/image.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6031942/uploads/AN4PCHMHL9AX/image.png" alt="image.png" height="496" width="661" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <div class="embedExternal embedImage display-large float-none"> <div class="embedExternal-content"> <a class="embedImage-link" href="https://us.v-cdn.net/6031942/uploads/KT1G0GKO8Z4F/image.png" rel="nofollow noreferrer noopener ugc" target="_blank"> <img class="embedImage-img" src="https://us.v-cdn.net/6031942/uploads/KT1G0GKO8Z4F/image.png" alt="image.png" height="383" width="665" loading="lazy" data-display-size="large" data-float="none"></img></a> </div> </div> <p><br></p> </article> </main>