cd /news/machine-learning/grading-tomatoes-with-an-esp32-and-m… · home topics machine-learning article
[ARTICLE · art-88779] src=hackaday.com ↗ pub= topic=machine-learning verified=true sentiment=· neutral

Grading Tomatoes with an ESP32 and ML

Pmalfa31 developed a tomato grading system using an ESP32 and machine learning that sorts standard and cherry tomatoes by color and size, with a web simulator available for testing. The system uses two learned datasets, processes optical sensor data, and includes heuristic validity checks to reduce miscategorizations.

read1 min views1 publishedAug 8, 2026
Grading Tomatoes with an ESP32 and ML
Image: Hackaday (auto-discovered)

If you’ve ever worked with produce, you might know about grading. In addition to deciding if, say, a strawberry is good or not, they also have to sort them by color. Turns out, you don’t care if one package of berries is a bit redder than another, but you do care if one package has too much color variation. [Pmalfa31] applied an ESP32 and machine learning to grading tomatoes. The system knows in advance if you are processing standard tomatoes or cherry tomatoes and uses two different sets of learned data depending on which you select. The program receives raw data from an optical sensor and then processes it to remove empty belt images, compute statistical information, and group readings for a single fruit together.

One thing we liked was the program’s heuristic checking of validity. It knows the approximate size of the tomato, so the code notes if the fruit seems too big for a cherry tomato or too small for a standard tomato. This reduces, but doesn’t eliminate, miscategorizations.

The code is a stack hog, so the program has to request a much larger stack. If you want to try it yourself, there is a simulator on the web available, so you don’t even need any hardware or tomatoes to try it.

Computers have lots of uses on a modern farm.

── more in #machine-learning 4 stories · sorted by recency
── more on @pmalfa31 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/grading-tomatoes-wit…] indexed:0 read:1min 2026-08-08 ·