Help with trying to make an Arduino-powered MIDI keyboard-controlled ferrofluid pattern-making exhibit!

Hi guys, apologies for the long title. As it says, I'm trying to create a science exhibit that best explains a scientific phenomenon, while being fun and user-friendly. In this case, electromagnetism.

Essentially, I want to hook a MIDI keyboard to a USB host shield on a Duemilanove I have lying around. The arduino reads those inputs, and outputs a designated pattern or single pin current to some electromagnets strapped under a tank of ferrofluid. When someone comes by and plonks on the keyboard, pretty patterns SHOULD HOPEFULLY rise and fall in the tank.

Attached is a diagram for easier explanation.

I have a couple of issues, though.

1. The arduino coding, which I haven't started with. A quick google search returned a post from Circuits@Home, where Colin from MAKE uses a modified PS3 script to recognise USB MIDI inputs.

This is my first real Arduino project. I've only tinkered with the I/O before this, nothing major.

2. A Duemilanove can only output 0.2 watts from a single pin (correct me if I'm wrong). Is this enough to drive a reasonably strong electromagnet? Are there some conditions I need to fulfil? Number of coils, materials for the core, etc.

3. I plan to make the ferrofluid with vegetable oil and toner. Will any old oil and toner do? Most websites come up with a specific variety, but that model usually isn't available in my area. I don't understand toner nomenclature at all lol.

4. Is it possible to wire/program the Arduino to allow a small speaker/synth to output sound, while having the current to power a set of electromagnets? I expect there to be about 12.

That's all for now. I'll update if I make any discoveries/progress! Thanks so much!

Picture of Help with trying to make an Arduino-powered MIDI keyboard-controlled ferrofluid pattern-making exhibit!
SvdSinner5 years ago
You need to become familiar with the model needed for controlling big things with a micro-controller.

In general, and overly-simplified:
1) A micro-controller can only directly power small electronics, and can be damaged if you try to draw too much current.
2) For medium sized loads, you can simply use a general purpose NPN transistor to amplify the power. Connect your output pin to ground via 10K hold-down resistor, then connect your output pin (2nd connection) to a 1K resistor, and the other end of the 1K resistor to the base of your transistor. the collector should hook to the ground of your load, and the emitter to ground. Power your load from a source capable of supplying enough power. This will allow you to control your device On/Off as needed.
3) For higher power loads, you might need a relay. (NOTE: If you want to stay away from soldering irons, you can buy ready-made relay boards for Arduino, use them, and ignore most of the rest of my post.)
4) For any load involving any kid of inductive coil (motors, electromagnets, relays, etc.) you have to use protection diodes to prevent transient loads from destroying your Arduino. Don't miss this step.
5) Always power big loads from a sufficient power supply, and then do the on/off switching on the ground side of the load.

Hope this helps.