iotempire / iotempower

IoTempower is a framework and environment for making the Internet of Things (IoT) accessible for everyone
MIT License
24 stars 21 forks source link

Support Project: Pocket Spectra #148

Open mbz4 opened 18 hours ago

mbz4 commented 18 hours ago

https://github.com/scientistnobee/Pocket-Spectrometer

combines m5stickc and a AS7341 (https://www.dfrobot.com/product-2132.html) light sensor to deliver a pocket spectroscope

Image


to support the project will need these things:

mbz4 commented 18 hours ago

Pocket Spectra Readme:


Pocket Spectrometer Project

The Vision

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.

Why This Matters

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.

Bill of Materials (BOM)

3D-Printed Components

Hardware Tools Required

Software Tools Required

Reasoning for choosing the particular Electronic Components

AS7341 Spectral sensor: Advanced Spectral Sensing

The AS7341 sensor is crucial for this project:

M5StickC: Portable but powerful mini computer

The M5StickC is the perfect platform for this project because it packs incredible functionality into a tiny package:

Build Instructions

Hardware Assembly

  1. Cut the Grove connector to 15cm length and solder the wires
  2. Connect the Grove cable to the M5StickC
  3. Flash the firmware using Thonny
  4. Test the spectral sensor functionality
  5. Disconnect the Grove connector
  6. 3D print the main body and cap (no support required)
  7. Install M2 heat-set inserts using the soldering iron
  8. Mount the AMS sensor to the body using M2 screws
  9. Press-fit the M5StickC into the body from the top
  10. Connect the Grove connector from the bottom
  11. Apply black tape to cover the AMS sensor and wires

Firmware Setup Instructions

1. Prepare M5StickC

  1. Power on the M5StickC
  2. Quickly press the M5 button after restart (using reset/PWR button) until you see the settings screen
  3. Select "Switch Mode" using the M5 button
  4. Choose "USB Mode" from the options

2. Set Up Thonny IDE

  1. Download and install Thonny IDE
  2. Open Thonny
  3. Navigate to Tools > Options > Interpreter
  4. Configure settings:
    • Set interpreter to "MicroPython (ESP32)"
    • Select the correct COM port for your M5StickC
    • Click OK and reconnect
  5. Once connected, you can write and test code directly in the IDE
  6. Best practice is to write your code in main.py for automatic execution on startup

Applications

The Pocket Spectrometer has numerous practical applications:

Environmental Monitoring

Biological Applications

Environmental Testing

Laboratory Use

Technical Implementation

The code is written in MicroPython for simplicity and accessibility, making it easy to modify for various applications. Most of the AI tools nowadays are good with python code, so would be handy to have the code in micropython.

Future Work

Troubleshooting Tips for software