Introduction: Stagmo

Stagmo is an affordable solution to microscope stage automation, and, in conjunction with free imageJ plugins, can be used to make large image montages of your favorite slides with relative ease. The goal of Stagmo is to enable researchers of all levels to automate tedious tasks of slide digitization. Professional stage automation systems can be cost prohibitive (~ 20,000 USD). This system can be built for less than 100 dollars, and when combined with open source software solutions, increase slide digitization by over 600 percent. The designs presented here are for standard stages on Olympus Bx series microscopes, but the general concepts can be applied to a variety of scopes. Stagmo attaches to the existing stage using a clamp and can be removed, leaving the microscope in its original condition. Since Stagmo is removable, it can be extremely useful for the traveling researcher.

To build a Stagmo of your own you will need the following parts:

1 Arduino

1 motor control Arduino shield (make sure it can control 2 stepper motors)

2 Stepper motors

1 pcb perf board

Assorted Resistors

4 buttons

1 switch


2 long bolts

2 nuts

1 AC/DC power supply

1 sheet of 1/4 inch lexan

4 pulley wheels

4 thick rubberbands

Felt pads

For my build, I utilized the tools I had. Mileage may very:

Dremel with rotary cutting bit and drill bit

Hot glue gun

Duck tape

Step 1: Step 1: Designing Your Frame.

The basic design of Stagmo is a frame that attaches to the moving stage and secures stepper motors at the positions of the mechanical stage knobs. For the Olympus BX series I used, the basic design is a plate (A) laying horizontally on the microscope stage with a vertical plate (B) running parallel to the mechanical stage knobs. Two bolts attached the horizontal plate (A) to the bracket plate (C). When tightened, this bracket (C) secures Stagmo to your microscope. Depending on your build quality and materials, you may find the vertical plate (B) requires reinforcement. I recommend utilizing an additionally triangle plate (D) as reinforcement.

A starting layout is seen in figure XX.

One you have decided on your frame. Trace and cut the frame out on your lexan sheet using the best tools in your tool box. I utilized a dremel with a rotary blade. Don't forget eye protection and a respirator.

After your parts have been cut out. You can assemble the pieces. I utilized hot glue sticks in my build, because they were handy and affordable. More elegant solutions are available, but what is ultimately important is a sturdy frame.

After you have assembled your frame, drill two holes in horizontal plate (A) and corresponding holes in the bracket plate (C). Position these holes so that they bridge a portion of the microscope stage.

Step 2: Step 2: Adding Motors and Hardware

Now that your frame has been assembled, its time to add the hardware.

Before attaching the motors to the frame, fix the pulleys to the motor axle. I found my pulleys in a cheap hobby kit and they attach via friction. More elegant build solutions include timing gears/pulleys.

Attach the stage frame to the microscope and find a position to attach the stepper motors where one can move the X-axis knob and the other can move the Y-axis knob. For my build, the best orientation can be seen in picture. Although duct tape doesn't produce the prettiest builds, its an easy way to mount motors in this application. Use strips of duct tape to attach the stepper motors to the frame. Make sure to use several layers of duct tape. Since the motors will heat up with use, additionally layers help limit the amount of change the tape will undergo with heat.

After attaching the motors, try and secure the belts so that one motor can turn the X-axis and the other can turn the Y-axis. Since this is a friction based system, I found that multiple pulleys per stepper motor with multiple bands ensured accurate drive. If you use rubber bands as belts, be aware that they will stretch and lower the precision of the stage movement.

Now that the motors are attached, assemble the Arduino and motor shield. Attach the stepper motors to the motor shield.

Step 3: Step 3: Control Panel

There are many different ways you could control Stagmo. You may want to invest in an LCD display, or control the Arduino over serial. A simple solution involves a series of buttons, resistors and a single switch. The control panel presented here is inspired by:,8558.0.html .

The schematics for this button panel used in my project are included. This control panel uses 4 buttons and one switch to enable manual control of the stage and a programming mode to set the parameters of automation.

Solder your perf board to match the schematic.

After finishing your board, attach the loose gnd wire to the arduino gnu and the loose input wire to the Arduino A0.

Step 4: Step 4: Programming the Arduino

This project utilizes the stepper motor library provided by Adafruit and example code found on the arduino website:,8558.0.htm... created By: Michael Pilcher.

The basic actions of this provide code is as follows. Under one switch position, the button control panel moves the stage in incremental steps in either the x or y position. Under the other switch position, the height and width (in fields) of the POI to digitize can be entered by button presses and the system initiated. After initiating stage movement, Stagmo moves the stage in a snake like pattern across the sample (see image), pausing a designated amount of time at each field to allow the user to focus and digitally capture an image. Each field is in a relatively known. Capturing software should be set up to record images in series with sequential names.

This code will need to be calibrated manually to your stage. This is a trial and error calibration. The number of steps the stepper motor needs to turn to move the sample will depend on your microscope, the objective lens and the digital camera. This may require some tedious trouble shooting. Roughly 20-25 percent overlap for each field in the x and y direction is preferable.

Step 5: Step 5: ImageJ and Image Stitching

This project relies heavily on an image stitching plugin developed for imageJ by Stephan Preibisch. This plugin can be found here:

This plugin assumes that images are name in a sequential manner and are stored in the same directory. It allows you to specify the relative location of each image through the pattern they were captured (e.g. snake left to right), and the number of columns and rows. This plugin can be set up to be batch automated. A basic image macro to control this script is:

run("Grid/Collection stitching", "type=[Grid: snake by rows] order=[Right & Down ] grid_size_x=***NUMBER of COLUMNS*** grid_size_y=***NUMBER of ROWS*** tile_overlap=35 first_file_index_i=1 directory=[***Image Directory***] file_names=***DIRECTORY/Image Name***_{iiii}.jpg output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save memory (but be slower)] image_output=[Fuse and display]");
run("RGB Color");
run("Save", "save=[***OUTPUT IMAGE NAME AND DIRECTORY***]”);

Make sure to replace text backed with *** with relevant information.

At this point you should be ready to go. There are many ways to improve this system, and, if you do, please let me know.


amberrayh (author)2015-06-04

This looks like a great automated microscope. Thank you for sharing your build! I hope we see more from you in the future.

About This Instructable




More by jarred_h:Stagmo
Add instructable to: