
The Coffee Chip is a hardware-based color classifier designed to automate the quality control of coffee beans. Unlike software-based solutions, this project uses a high-speed digital state machine implemented in an ASIC to process signals directly from a color sensor.
ui[0] pin. An internal 26-bit counter measures the number of pulses received within a specific time window (controlled by the system clock).S2 and S3 pins (uo[2] and uo[3]).ui[2] and ui[3]) for quick calibration.R_min and R_max thresholds on-the-fly via the ui[1] pin, enabling fine-tuning for different coffee varieties without changing the hardware.To validate the Coffee Chip, follow these steps:
clk pin.rst_n to low for at least 10 clock cycles, then pull it high to start the system.ena (Enable) is high.ui[0].uo[0] through uo[3] to the sensor's S0, S1, S2, and S3 control pins.uo[4] (Green LED), uo[5] (Yellow/Red LED), or uo[6] (Red/Dark LED) to see the classification result.uo[7] will pulse high every time a full measurement cycle is completed.ui[4] (cfg_sel) to high.ui[1] pin to update the internal classification thresholds.To fully utilize this project, the following external components are required:
uo[4], uo[5], and uo[6].| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | sensor_in | sensor_s0 | |
| 1 | uart_rx | sensor_s1 | |
| 2 | s0_config | sensor_s2 | |
| 3 | s1_config | sensor_s3 | |
| 4 | cfg_sel | led_unripe | |
| 5 | led_optimal | ||
| 6 | led_overripe | ||
| 7 | debug_ready |