top bar


Revision as of 09:19, 27 June 2014 by P.nanda (Talk | contribs)

Summary: Adapter for the Arduino electronics prototyping platform
Author: Nico Stuurman
License: LGPL
Platforms: Linux, Mac, and Windows
Since version: 1.3.18
Automated Serial Port Setup: Yes
Peripheral device discovery: No
Wiki page: Nico Stuurman
Pariksheet Nanda
Roy Wollman

The Arduino is a low cost programmable digital IO board. It has some digital inputs and digital outputs and can communicate with the computer through a serial interface (that is hidden in a USB connection). A very nice and simple programming language makes the Arduino very simple to program. The Micro-Manager interface to the Arduino consists of an Arduino program (the 'firmware') that you need to upload to the Arduino first. The current version of the Micro-Manager has facilities to use the Arduino as a shutter, and as a shutter that only opens when a TTL is set high (for instance, when the camera is exposing). Also, timed sequences of TTL output can be setup. There are also facilities for programmable analogue out, however, those need connection of a DA chip and requires constructions of a 'daughterboard'/'shield'.

Figure: Functional pinout set by firmware version 2
(Image source .svg file)


Arduino Software

Download and install the Arduino Software for your platform. Establish a connection with your Arduino using the instructions that come with the Arduino software (this includes installing a driver for the USB to serial adapter built into the Arduino.


Then download the firmware source code and copy into the Arduino editor. Send to the Arduino, and your Arduino is programmed to work with Micro-Manager.

Hardware Configuration Wizard


Add the Arduino-Hub. You may want to set the "Verbose" property of the port to 0 to avoid extensive logging of the communcation with the device, especially if you are using the input functionality (which queries the Arduino every second).

Pre-Initialization Properties Description
Logic Inverted causes digital inputs and outputs to be considered HIGH when 0 Volts and LOW when +5 Volts.
Serial Setting Value
AnswerTimeout 500
BaudRate 57600
DelayBetweenCharsMs 0
Handshaking Off
Parity None
StopBits 1
Verbose 0

Peripheral Devices Setup

Name Description
Arduino-Switch Digital output pattern set using a single byte. Bit 1 corresponds to Arduino ouput pin 8, bit 2 corresponds to output pin 9, etc... Bits 7 and 8 are not used. e.g. setting the switch to value '5', will set output pins 8 and 10 high and the others low.
Arduino-Input As of version 1.3.47, the Arduino adapter can also report the digital (0 or 1) and analog (0-1023) state of the analog input pins 0-5 on the Arduino. You can either have it report all analog pins or only a specific one (you set this with the "Pin" pre-initialization property).
Initialization Properties Description
Pin If you want to report multiple individual pins, choose All, otherwise choose the individual 0-5 Pin number to read.
Pull-Up-Resistor Choose whether the Arduino should use its internal 20 kOhm internal pull-up resistor.

Test Communication

In Arduino boards from Duemilanove and on pin 13 also controls the built in LED. Therefore you can test the configuration by changing the Arduino-Switch state to 32 in the Device/Property Browser and than chose Arduino as your shutter and just open/close it in the main MM window. You should see the built-in LED light changes when you close / open the Arduino shutter.

Usage Notes

Switch Mode

When used directly (not via trigger mode) the Arduino Shutter is the device that will change the voltage on the pins specified by the State of the Arduino-Switch (as described above). You'll need to add three devices to your configuration, the hub the switch and the shutter. The Hub takes care of all communication and you don't need to worry about it. The Switch is where you set the pattern you want and opening/closing the shutter will actually change the voltage on the pins as determined by the Switch pattern.

Digital IO

You'll need to think in binary to get this right, meaning that to get pin 13 to open, you need to flip bit 5 which means you want to send 2^5 = 32. Similarly pin 10 will be bit 2 which is 2^2=4. Here is a simple table Nico send to the mailing list in an email to help (me :) with powers of 2:

bitpinnr when high

Project Tutorials

© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact