Connection
The probe contains a connection wire with three pins connected. Connecting it to the extension is therefore very simple - you just need to distinguish the polarity correctly.
We connect everything to the expansion board only when it is turned off. After connecting, we test the correctness of the connection.
- A (blue) – connect to the analog input of the micro:bit.
- + (red) – positive power supply 3,3 V.
- – (black) – ground GND.
Program
Measurement
The principle of the program is that we read 10 values from the analog-to-digital converter (ADC), from which we calculate the arithmetic average. This eliminates random fluctuations caused by interference. The resulting analog value is then converted to voltage - the micro:bit uses a reference voltage of 3,3 V and a resolution of 10 bits (1024 steps). The measured voltage is then converted to a TDS value according to the formula recommended by the sensor manufacturer. The resulting TDS value is displayed on the LCD display, or it can be easily displayed directly on the micro:bit or other output device with a modified program.




