|Summary:||Adapter for the Arduino electronics prototyping platform|
|Platforms:||Linux, Mac, and Windows|
|Automated Serial Port Setup:||Yes|
|Peripheral device discovery:||No|
|Wiki page:||Nico Stuurman|
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'.Image source .svg file)
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 build 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.
In Micro-Manager, use the hardware configuration wizard to add the Arduino. Set the serial port to 57600 baud.
The Arduino 'Switch' sets the digital output pattern 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. So, setting the switch to value '5', will set output pins 8 and 10 high and the others low.
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. To do so, add the "Arduino-Input" device in the Hardware Configuration Wizard. You can either have it report all analog pins or only a specific one (you set this with the "Pin" pre-initialization property). You can also define whether or not the Arduino should use its internal 20 kohm internal pull-up resistor using a pre-initialization property. If you want to report multiple individual pins, you can add this device multiple times.
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 shuter 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.
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.
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:
|bit||pin||nr when high|
- TTL control of multiple LEDs by David Knecht.
- Detect tube lens position of Nikon Ti Eclipse
- Control laser shutter with Arduino by Rocco D'Antuono.