I built a machine that can predict whether peanut M&Ms actually have peanuts in them. It does this using a custom 3D scanner and scale in order to calculate the density of these candies. Since chocolate is slightly more dense than peanuts, this allows the machine to predict whether a peanut is actually in the center of each candy.
Below are links to some of the example code and/or libraries that I integrated into my project.
Raspberry Pi - Arduino Serial Communication
Convex Hull Volume Calculation
HX711 - Raspberry Pi Interface