This Instructable will be about building a four-line cablecam/motion control unit.
The principle is nothing new see CATCAM.
Its based around four motors/winches and a control unit that controls the motors.
- Arduino UNO (or any other Arduino)
- 2x Motorshields R3 (as one shield can only control two motors)
- MIDI Interface (will be a step of this Instructable)
I made an animation of the principles:
And a Top View Version of the above video:
And there is video of the nearly finished version driving two motors:
A "new" idea is to generate the control signals via MIDI.
If you think about where MIDI comes from and what its meant to do, the idea is not so special any more.
Think of all the MIDI sequencers and control devices that are around, let alone the various software automation posibilities in DAW.
Also touchOSC was a big concern when choosing MIDI, as it lets you build MIDI interfaces for mobile devices. That will let me control the motors via my iPad or iPad driven sequencer.
Perfect for timelapse AND realtime control.
A FEW WORDS ABOUT MIDI
MIDI (M usial I nstrument D igital I nterface) was invented somewhere in the 80ies by Dave Smith, one of the great synth masters of the universe, and some other guys.
So far about the IMPORTANT history facts :)
Whats more important is what it does and how the protocol looks like.
As you can see on the image, MIDI is a serial protocol, meaning that there is a stream of bits (0/1) coming in, that conists of all the relevant information.
All you got to do is tell the script to look at specific parts of that protocol depending on what you want to extract.
In this case, what we need are the CC commands normally used by faders or knobs to change settings on synthesizers mixing desks or whatever you want to control via MIDI.
Because it would be very timeconsuming to write a dedicated script for all MIDI functions and their dedicated names we use an Arduino-Library, the so called:
MIDI LIBRARY FOR ARDUINO
Just like all Libraries you activate/can use the functions by uploading it with your script.
All we got to do, to interface with the Arduino now, is build a small interface with a DIN-MIDI socket.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: MIDI to ARDUINO-Interface
The MIDI library uses the Rx-Pin on the Arduino, so thats where the MIDI signal will enter the controller.
The Interface is a pretty simple design, taken off of the MIDI-Specifications (see image taken from their page)
This specifications says that you need an optocoupler and a diode to save both the MIDI host and the MIDI slave.
By using light as medium the optocoupler makes sure that the arduino and the MIDI device are not connected electricaly but still are able to communicate(via light).
I LOVE stripboards, so everything in this Instructable will be based on Stripboards.
On the photo, you can see the interface on the breadboard and to the right side its planted on the prototype stripboard. I will have to turn the strips 90 degrees, because i need more space for the box i want to fit it into.
Step 2: MOTORSHIELDS
If you dont want to harm your shields, you got to skip this step and find another way for the problem that:
MOTORSHIELDS ARE NOT MEANT TO BE STACKED.
Screw this, is what i thought and clipped a lot of pins on the second shield(the one thats on top of the other)
The reason for this is that the motorshield communicates via 6 pins.
On all shields.
So when you stack two of them together, you get two more motor outs, but they will do the same as the first ones, cause they communicate over the same pins.
What i did is to clip all pins that the second one "would" use to communicate with the UNO and made a jumperbrisge to send 6 different pins of the Arduino to the shield.
See the picture for more details.
Or the fritzing schematic.
Step 3: ENCLOSURE
If you dont want to put it in a box or have another one, you can skip this step.
I bought a nice little box, probably made for beeing used as an outdoor lightswitch or some sort of that.
Its watertight (was, before i cut it) has an o ring and the Arduino fits PERFECTLY.
All i had to do is clip all pins on everything including the Arduino itself to get the height down.
See the photos for mor details
The only space where i could fit in the connectors for the motors and the MIDI-socket is to the left and right side, around 50x50x7mm.
Step 4: SHIELDs PCBs
The shield consists of three parts:
- the main shield
- the side-shield for the MIDI-IN plug
- a second side-shield for a fan or additional circuits on the other side
I used rows of male and female connectors to connect the shields and the Arduino and all traces are intact for now.
As i read on sparkfun not too long ago, you should name and date your revisions, so on one photos there are all versions of my shield from left to right, first to final version.
I managed to plant the MIDI IN circuit on the small side shield, see the last photo.
I will upload a stripboard-fritzing layout asap.
A video of the test run: