Watch the Video

map Project Overview

I've always wanted to create a spectrometer that is so small it can fit into one's pocket and just barely larger than a cuvette itself. Working with bulky commercial spectrometers in labs, I was wondering about applications of such a small spectrometer. That's when I discovered the perfect combination – the M5StickC microcontroller and the AS7341 spectral sensor. My goal was simple: create an ultra-compact spectrometer that anyone could use. While commercial spectrometers offer high precision, they're often expensive, bulky, and require a computer connection. I wanted something different – a standalone device that could fit in your pocket, complete with its own display and interface, without requiring external equipment such as connection to a mobile app or a computer. The kind of tool that could democratize spectroscopy for educators, students, and citizen scientists.

stars Features

  • Advanced Spectral Sensing: AS7341 sensor with 11 readable elements and 350-1000nm coverage

  • Portable Computing: M5StickC with built-in battery, display, and USB-C connectivity

  • Compact Design: Fits in your pocket, barely larger than a cuvette

  • Standalone Operation: No computer or mobile app required

  • Multiple Applications: Environmental monitoring, water quality testing, soil analysis, and laboratory use

  • Easy Programming: MicroPython support for simple modifications

  • Real-time Display: Built-in TFT screen for immediate spectral visualization

  • Component Selection: Carefully chosen components for optimal performance:

    • AS7341: 11 readable elements, 350-1000nm coverage, built-in LED control, low power consumption
    • M5StickC: Built-in battery, USB-C, Grove port, programmable buttons, TFT display, IMU, compact size
  • Software Tools: OpenSCAD for 3D designs, CURA slicer, Thonny IDE for programming

  • Applications:

    • Water Quality Testing: turbidity, chlorine, pH, hardness
    • Biological Monitoring: ammonia, nitrates, phosphates
    • Soil Analysis: pollutants, heavy metals, contamination
    • Laboratory Use: protein quantification, enzyme assays

description Bill of Materials

  1. M5StickC ($20)
  2. AS7341 spectral sensor ($16)
  3. Grove connector ($2)
  4. M2 screws (2x) ($1)
  5. M2 heat-set inserts (2x) ($1)
  6. Black 3D printer filament ($10)
  7. White reflector (Optional)

Required Tools:

  • 3D printer
  • Soldering iron
  • Screwdriver
  • OpenSCAD (optional)
  • 3D printer slicer software
  • Thonny IDE

gesture Assembly

  1. Cut and solder the Grove connector to 15cm length
  2. Connect Grove cable to M5StickC
  3. Flash firmware using Thonny
  4. Test spectral sensor functionality
  5. 3D print main body and cap
  6. Install M2 heat-set inserts
  7. Mount AMS sensor using M2 screws
  8. Press-fit M5StickC into body
  9. Connect Grove connector
  10. Apply black tape for light isolation

electrical_services Wiring

  1. Grove connector to M5StickC:
    • Red wire to VCC
    • Black wire to GND
    • Yellow wire to SDA
    • White wire to SCL
  2. AS7341 sensor connection via Grove port

attach_money Purchase

  1. M5StickC from M5Stack Official
  2. AS7341 sensor from DFRobot
  3. Grove connector from M5Stack
  4. Hardware from Mouser