An electrophoresis chip-based setup for detection of different ions in buffer solution. The device is able to differentiate ions in, e.g., real soil or other solutions, and to detect concentration of a specific ion in the solution. Fabrication of the electrophoresis chip can use a soft lithography based molding process. The chip can be made out of PDMS on a glass substrate where on-chip valves were used to control timing of injecting sample and buffer solutions. Detection electrodes are used to detect the presence of ions over a period of several minutes. A controllable high voltage power supply system and related signal acquisition, processing and detection setup can be implemented with the sensor in a system. A microfluidic system for automated collection of soil sample through a porous ceramic and using vacuum suction can be used.