# AlgaeSense, a microscope-driven algae grower

An autonomous photobioreactor built on the Arduino UNO Q that periodically samples its algae culture into a viewing chamber, images it with a USB microscope, and uses OpenCV to track growth and flag contaminants.

- Category: Hardware (build)
- Made by: [Bhuvan Makes](https://www.hackster.io/bhuvanmakes) on Hackster.io
- Original: https://github.com/bhuvanbagwe/Project-AlgaeSense/tree/main
- On Afterware: https://afterware.xyz/p/algaesense-a-microscope-driven-algae-grower

## Can I build this?

- Difficulty: Advanced
- AI-buildability: 4/5 (Most of the difficulty is software on an off-the-shelf board, though the printed pump, plumbing and optics need hands-on work.)
- Time: 20 hours
- Parts: Arduino UNO Q, L298N dual H-bridge motor driver, 12V DC motor, USB microscope module, USB PD extender hub, 4x 1W white LED
- Tools: 3D printer, laser cutter, soldering iron

Estimates based on the original write-up. How the AI-buildability score works: https://afterware.xyz/ai-buildability

## Build sheet

- Board: Arduino UNO Q
- Sensor: USB microscope
- Method: OpenCV contour analysis
- Actuators: Peristaltic pump, aerator, LEDs

## Starter prompt

```
Based on "AlgaeSense, a microscope-driven algae grower" on Afterware: https://afterware.xyz/p/algaesense-a-microscope-driven-algae-grower

Write a Python program for an Arduino UNO Q that captures frames from a USB microscope, enhances contrast, applies thresholding and morphological filtering, and counts filament contours to estimate algae coverage. Have it send serial commands such as PUMP_SAMPLE 3000, AERATOR OFF and LIGHT 180 to the MCU side, and log each measurement with a timestamp. Run the cycle GROW, stop aeration, sample, settle, image, analyse, and repeat at a set interval.
```

## Story

AlgaeSense is a cube-shaped 3D printed housing that sits above an algae tank and holds the electronics. Growth LEDs are embedded in the housing. A 3D printed peristaltic pump pulls a small sample through silicone tubing into a microscope viewing chamber. Aeration pauses before each sample so bubbles and water movement do not interfere with imaging.

The Arduino UNO Q splits the work. Its MCU side drives the pumps, aerator, LEDs and sensors using simple commands such as LIGHT, AERATOR and PUMP_SAMPLE. The Linux side runs the USB microscope, an OpenCV pipeline (contrast enhancement, thresholding, morphological filtering, contour detection), logging and control decisions.

The author describes the system as an early warning tool rather than a toxin detector. It tracks filament density, contour size and morphology changes between samples, and it does not detect microcystins or dissolved chemicals directly. The prototype demonstrates automated sampling, imaging, detection, actuator control and logging as one repeating cycle.

## Resources

- [Code repository](https://github.com/bhuvanbagwe/Project-AlgaeSense/tree/main)
- [Arduino App Lab](https://www.hackster.io/arduino/products/arduino-app-lab?ref=project-fee1dd)

Tags: arduino uno q, opencv, microscope, algae, peristaltic pump, 3d printed, spirulina

AI assistants can search all Afterware builds through the MCP server at https://afterware.xyz/mcp (setup: https://afterware.xyz/agents).
