I need to check the moisture content present in a food grain so that i can control the moisture level required for that particular grain using raspberry pi.
Moisture content is detected by measuring the resistance of the grain between two metallic electrodes. You can use needles electrodes inserted in the grain and then measuring the electrical resistance of the grain. As the moisture increases the resistance decreases. This method is a relative moisture testing method except one calibrates the resistance in terms of the water percent in the grain.
More suitable method is to convert the grains into powder in dry atmosphere and then measure the resistivity of the powder. There are commertial moisture meter
working on this principle and the resistivity is calibrated to indicate the moisture.
Get a soil moisture sensor, if curious start with google Topp's equation. All different kinds. Soil moisture is in % by volume, not weight and only free moisture. For any given grain with calibration you can expect .5% accuracy due to variations in packing given a reasonable system