Skip to content

ESP32-based mini microscope for fluidic device observation

Notifications You must be signed in to change notification settings

beniroquai/Matchboxscope

 
 

Repository files navigation

Matchboxscope

This is a repository for the smallest standalone low-cost open-source DIY incubator-contained microscope that can be used for a gazillion different applications. Sounds interesting? Continue reading!

The core component of this device is a ESP32 microcontroller that is packed with a small Camera (OV2460) and microSD card slot, which makes it a perfect match for your microscopy project. In the most minimal version, you don't need anything but the ESP32-CAM and perhaps some chewing gum to raise the objective lens in order to create a finite corrected microscope.

However, we wanted to make the microscope a bit more practical and created some 3D printed parts that will realize the following devices:

The Anglerfish: This device is well preserved in your beloved jars and hence watertight. Why? Throw it in your nearby pond and collect data how microfilm grows on the jars' surface. Fun! Follow the BLUE PILL 🔵

The Matchboxscope: This is a simple self-contained microscope, e.g. for tacking snapshots of your microfluidic chips, your parasite containing slides or just for fun. It comes with a minimum number of parts, but offers a spring-loaded z-stage. Also ideal for your incubator-contained microscopy experiments! Follow the RED PILL 🔴

The Z-Stacker: It adds an automatic focusing unit to the Matchboxscope in order to create temporal Z-stacks of your beloved cell cultures. It needs more electronics, but still relies on the ESP32-CAM only. Lots of fun, too. Follow the GREEN PILL 🟢

Still curious? Continue Reading by clicking on individual device sub-pages!

How to install

In order to get the code compiled and uploaded to your ESP32 camera board, a number of steps have to be carried out to prepare the system.

Compile and Upload

This code is written for the AI_THINKER

  1. Download the Arduino IDE 1.8.X from here
  2. Install the ESP32 IDF tool through the Arduino board manager; Add the following link to the settings (a more in-depth tutorial can be found here): https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json When installing the board, go for the version 2.0.3
  3. (OBSOLETE!) Install the ESP32Cam library following this link and their README
  4. Clone this repository
  • MatchBoxscope: Choose the latest release for the MatchBoxscope, open the .ino and flash the project (v0.1)
  • Anglerfish: We will provide a ready-to-use software solution soon
  • IncubatorMicroscope: We will provide a ready-to-use software solution soon
  1. Compiling: Under Toolsselect your board (DEV Module), port and enable the PSRAM enable 4MB external PSRAM.
  2. Compile and Upload

ATTENTION for Android users: The Wi-Fi in access point mode (AP) does not offer internet, hence Android uses available cellular/mobile data and won't open the local address (192.168.4.1). Solution: Switch off mobile data or disable Wifi+

Wi-Fi settings:

Please have a look in the Wi-Fi settings to adjust them according to your network configuration:

`cpp boolean hostWifiAP = true; // set this variable if you want the ESP32 to be the host const char* mSSID = "Blynk"; const char* mPASSWORD = "12345678"; const char* mSSIDAP = "Matchboxscope"; ``

Upload files to SPIFFs

For the HTML and CSS files, you can upload the files to

Software

Anglerfish Code

Getting many images in an autonomous "diving" experiment is key. For this, we wrote a firmware that enables you to find the focus and as soon as you're done, the microcontroller goes into deep-sleep mode to save energy. The following steps are important to carry out before your experiment.

The protocol

  1. Assemble unit and charge battery
  2. Upload software and insert SD card
  3. Then connect the battery to ESP32 and watch the camera stream via Wi-Fi and adjust the focus so that you can see the surface (of the jar) in focus. That's what the screws and springs are for. You do this once.
  4. Either with a switch (awkward, because you have to solder), or via Wi-Fi (switch in Webgui/HTTP endpoint), deactivate the focus mode.
  5. Microscope goes into deep-sleep mode and wakes up every X minutes to take a photo and save it on the SD card.

In the deep-sleep setting, it consumes virtually no power.

Problem/thoughts:

  • It is not possible to detect whether it is deep-sleep or disconnected from the power supply, so we built in this funny construct with the date/time of flashing the ESP32. So you can reset the EEPROM variable for focus mode (yes/no) when you (re-)flash the microcontroller
  • the SD card and the LED flash hinder each other a bit because they both run on the same pins (yup). But I think we managed to get everything working by relying on the 1-bit mode of the SD card (slower, but more stable); also important: Initialize the SD card before any GPIO assignment (i.e. in setup())
  • The same code could also be used in an incubator-contained microscope, for example, to observe the growth of cells. But for this it would be important to keep the Wi-Fi stream running :)

Videos

That's the software for the Matchboxscope:

And a more in-detail tutorial on how to use the software:

Get Involved

This project is open so that anyone can get involved. You don't even have to learn CAD designing or programming. Find ways you can contribute in CONTRIBUTING

License and Collaboration

This project is open-source and is released under the CERN open hardware license. Our aim is to make the kits commercially available. We encourage everyone who is using our Toolbox to share their results and ideas, so that the Toolbox keeps improving. It should serve as an easy-to-use and easy-to-access general purpose building block solution for the area of STEAM education. All the design files are generally for free, but we would like to hear from you how is it going.

You're free to fork the project and enhance it. If you have any suggestions to improve it or add any additional functions, make a pull-request or file an issue.

Please find the type of licenses here

REMARK: All files have been designed using Autodesk Inventor 2019 (EDUCATION)

Collaborating

If you find this project useful, please like this repository, follow us on Twitter and cite the webpage! :-)

About

ESP32-based mini microscope for fluidic device observation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 40.7%
  • HTML 37.8%
  • Python 12.4%
  • Jupyter Notebook 5.9%
  • C 3.2%