Arduino Colorimetric Food Safety Tester

Materials

  • Arduino Uno or Nano
  • Color sensor module (TCS34725 or APDS-9960)
  • White LED(s) for illumination
  • Color-reactive medium (phenol red, XLD agar, etc.)
  • Cotton swab & food sample
  • Jumper wires; breadboard/PCB (optional)
  • Display or indicator LEDs (optional)
  • Power source (USB or battery)

Prepare Color-Reactive Medium

  • Choose medium that shifts color with bacterial activity:
    • Phenol red → yellow in acidic conditions
    • XLD agar → red/yellow/black for Salmonella
  • Preparation:
    • Agar: pour, let solidify
    • Phenol red: soak paper strip, dry

Sample Collection & Application

  • Swab food surface with cotton swab
  • Transfer sample onto medium
  • Incubate or wait 10 minseveral hours10\text{ min} - \text{several hours} (room or warm temp)
  • Look for visible color change

Hardware Setup

  • TCS34725 wiring (Uno):
    • VIN5V\text{VIN} \rightarrow 5\text{V}
    • GNDGND\text{GND} \rightarrow \text{GND}
    • SDAA4\text{SDA} \rightarrow A4
    • SCLA5\text{SCL} \rightarrow A5
  • Mount white LEDs to illuminate strip
  • Optional: I$^2$C OLED or status LEDs (green = safe, red = contaminated)

Arduino Code Essentials

  • Install Adafruit_TCS34725 library
  • Initialize sensor; check colorSensor.begin()colorSensor.begin()
  • Use Serial at 9600baud9600\,\text{baud} to monitor RGB values
  • Set threshold ranges from calibrated tests

Testing & Decision Logic

  • Place reacted strip under sensor
  • Read RGB, compare with thresholds
  • Classify:
    • Safe: within safe range (e.g., yellow/green)
    • Contaminated: outside range (e.g., red, dark)

Optional Visual Feedback

  • Drive red/green LEDs for quick status
  • OLED message: “SAFE” or “CONTAMINATED”