Build your own MIDI projects
Frequently Asked Questions.
MIDI & Music
MIDI and Music Information
Control of Linear Actuator with MIDI Volume

MIDI Linear Actuator

This project uses relays to control a Firgelli Automations linear actuator without feedback. The relays are controlled by the MIDI Volume (Control Change number CC7) command which is read by the microcontroller and converted into one of the only 3 states of operation:

1) The Linear Actuator is stopped,

2) The Linear Actuator is extending,

3) The Linear Actuator is retracting.


Using the MIDI Volume CC7 command allows the user to automate the control of the linear actuator, either in real-time or the MIDI data can be recorded into a MIDI sequencer and then played back to repeat the sequence as required. 




MIDI Linear Actuator


PRICE:  €85.00



The MIDI Linear Actuator unit utilizes:

  • An Arduino Board including a suitable pre-programmed Atmega microcontroller,
  • A 2.1mm power socket, and associated LED,  
  • MIDI Control Change (CC7) Volume control value is used to control the Linear Actuator, but may be  pre-programmed to  any value, 
  • A 2 relay board, to extend or retract the Linear Actuator,
  • A MIDI IN/OUT Board,
  • A MIDI 5-pin DIN input socket,
  • A MIDI 5-pin DIN output socket,
  • MIDI channel is selectable via a 4-way DIP switch.



The MIDI Linear Actuator also requires:

  • A 12v  DC power source


Circuit Schematic:


A circuit schematic of the Arduino/MIDI board shows the Input/Output connections for both units. The relay board circuit schematic is also available. 



At power-on (or reset) the software waits for the Volume Control (CC7) Change command to approximately reach mid-position, which is signified by turning On the LED connected to Pin 13 on the Arduino board.


Now the main program reads the Volume Control (CC7) Change value and if it remains in the mid-position then both relays are Off and the Linear Actuator is stopped.


if the Volume Control (CC7) Change value increases above a certain threshold Relay 1 is switched On, (Relay 2 is Off), and the Linear Actuator starts extending. This also lights LED1 (LED2 is Off). Also the LED connected to Pin 13 on the Arduino board is now Off.


If the Volume Control (CC7) Change value decreases below a certain threshold Relay 2 is switched On, (Relay 1 is Off), and the Linear Actuator starts retracting. This also lights LED2 (LED1 is Off). Also the LED connected to Pin 13 on the Arduino board is now Off.


If the Volume Control (CC7) Change value returns to the mid-position then both relays are Off and the Linear Actuator is stopped.


Her is a diagram showing the Mapping of the Volume Control (CC7) Change value for the different options.


The design uses two SPDT (single pole double throw) relays which have three connections for each relay, the Common (C), normally open (NO) and normally closed (NC). With two SPDT relays you can start, stop and change direction of the actuator.

As shown in the wiring diagram below, you connect the ground (GND) to the normally closed terminal of the two relays, and you connect the  +12VDC to the normally open terminal of the two relays.  You can either make a junction to split each wire in two, or use a short jumper wire.  You connect the two actuator wires to the common terminal, one to each relay.


A benefit to using the two SPDT relays to control the linear actuator is that when neither relay is triggered you've got a "brake" function.  This makes the actuator stop immediately rather than drift to a stop.















     *Click to Enlarge*

The MIDI IN and OUT connectors use  5-Pin 180 degree DIN sockets. Note that the MIDI IN/OUT wiring is polarised and the correct pins should be used.












DIP Switch Selections



4 3 2 1
on on on on 1
on on on off 2
on  on  off on 3
on on off off 4
on off on on 5
on off on off 6
on off off on 7
on off off off 8
off on on on 9
off on on off 10
off on  off on 11
off on off off 12
off off on on 13
off off on off 14
off off off on 15
off off off off 16

Table 1 MIDI Channel



Power Supply:

The same 12 Volt DC power supply can be used to power the Arduino board and the Linear Actuator via the relay contacts. 


The external 12 volt power can come either from an AC-to-DC adapter (wall-wart). The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. A low dropout 5 Volt regulator on the Arduino provides improved energy efficiency.


The regulated +5 Volt from the Arduino is used to power the MIDI board and the Relay board.