This work presents the design of a portable and compact low-cost electronic prototype for detecting Cd <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2+</sup> in matrices associated with cocoa crops. It is based on a C12882AM solid-state detector and an 8-bit MCU. Acquired data can be visualized through a computer interface, allowing users to collect and visualize data on the fly or to set up a continuous analysis experiment. It can analyze absorbance spectra in the range of 450 to 750 nm. The RhB1 chemosensor was used to detect Cd <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2+</sup> concentrations from the absorbance peaks. Different metrics were determined in terms of the repeatability test, coefficient of determination R <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2</sup> , limit of detection (LoD), limit of quantification (LoQ), precision of Y/X response factors, and relative standard deviation (RSD). The results show the adequate performance of the prototype, since it can analyze Cd <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2+</sup> samples with a performance comparable even to that of commercial laboratory equipment in the range of 0.1 ppm to 0.7 ppm Cd <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">2+</sup> .