Help me stop frying my Arduinos

I'm using the Duemilanove and external circuitry to receive and process MIDI data, create a PWM signal, amplify the PWM signal, and drive solenoids A rough diagram of the chain of command would be

MIDI --> Optocoupler --> Arduino --> TLC 5940 (PWM chip) --> SN7544 (quadruple H-bridge chip) --> Solenoid

(Yes, there are resistors between the Arduino and the various chips; I followed the instructions on instructables.com for the MIDI In portion and the instructions in the TLC library, etc.)

I've gotten the whole setup to work--until I fry the Arduino. I power the Arduino with 12V from a voltage regulator in the external circuitry, and sometimes during the testing, the voltage regulator on the Arduino becomes very hot. Subsequently my computer won't recognize that a device is plugged in to the USB port, and the Arduino is effectively dead. I'm not sure if the problem occurs after a specific amount of time or if one solenoid driver circuit is particular is causing a problem. I've operated the whole thing for several minutes with a certain solenoid driver circuit without incident; other times, the voltage regulator on the Arduino heats up quickly.

I suspect that there is a short somewhere, maybe in one of the solenoid driver circuits, that is drawing a lot of power from the board. The easiest solution that I can think of is to place a series resistor of 220 or so ohms between the ground of the external circuitry and the Arduino. That would prevent excessive current from being drawn from the Arduino, I believe. Does that make sense? Thanks.

It's very difficult to understand what you're trying to do from that description. Can you post a schematic?

You should measure the current going into the Arduino. The power dissipated in the
linear regulator is (Vin - Vout) * Iout. Chances are you exceeding the devices
maximum temperature ratings. I do not know which regulator is on your board but
if you are drawing over 90mA you should look up the specs.

(* jcl *)

I thought solenoids were not a good candidate for use with PWM? One, they usually react way too slow for common PWM frequencies. Two, every time they lose power (signal goes off), they kick energy back to the rest of the control circuit.

I made a board which drives 8 12VDC solenoids from an i2c client (PCF8574/A) latch chip. You command the eight solenoids' state all at once. It uses some HEXFETs to control the solenoids from logic levels, and each solenoid gets a protection diode to avoid backflood.

Thanks for the replies. To take the questions in order

  1. I'll put a schematic together and post it soon, but I think it's possible to answer my question in the abstract without knowing the particulars of the circuitry. That question is, assuming the external circuitry is drawing to much current from Arduino, wouldn't placing a resistor between the Arduino ground pin and the ground of the circuitry limit current consumption?

  2. Solenoids are excellent candidates for PWM! Placing a diode over the connection to the solenoid takes care of the reverse voltage, and the point of the PWM is simply to fake an analog voltage, not to move the solenoid at the PWM frequency (although that would be cool). For an example of how solenoids can be used with PWM to create variable loudness drum beaters, see Rotomoton - automated percussion instrument by Godfried-Willem Raes.

That question is, assuming the external circuitry is drawing to much current from Arduino, wouldn't placing a resistor between the Arduino ground pin and the ground of the circuitry limit current consumption?

Maybe, but then the device that's "downstream" of the resistor will receive a lower voltage than it would before. This may or may not cause it to malfunction, depending on the device. And if you put the resistor in the Ground side, any signals to/from the Arduino will fail to work because you will no longer have a common Ground connection. The only way to deal with this problem is to add another, larger, external power supply.

Your ground point is your signal reference. It is a bad idea to change the reference point between boards. If you want to limit the current put a resistor in series with the positive side not the ground.

You would better off not drawing high currents through the Arduino linear
regulator. Get a separate regulator for the high current devices.

(* jcl *)

I should have made clear that I'm not powering the solenoids from the same power source. I have an 18V supply that I send to the H-bridge chips, which powers the solenoids. The same 18V is stepped down to 12V by a voltage regulator, and I send that to Vin of the Arduino. I use the 5V supply from the Arduino to power the logic on the various chips in the circuit.

The suggestion about placing the resistor (probably 220 ohms) between the circuitry and 5V+ is well-taken. In theory, this shouldn't cause a large voltage drop because the rest of the circuitry uses higher resistance values, and the voltage drop would be proportional to 220/(total resistance of the circuit). If my hunch is correct, sometimes the total resistance of the existing circuit drops significantly, causing excessive power consumption. But this resistor would place a floor on the total resistance.

In my experience, it doesn't take much to get the regulator hot with a 12V input. I put a 9V regulator before it. With 9V into the Arduino it ran much cooler.

If your system works but not for long then you are drawing too much current out of something. Simply placing a resistor in the circuit is not going to help you because you are not targeting the over current you are just limiting the current and so giving a voltage drop.

n theory, this shouldn't cause a large voltage drop because the rest of the circuitry uses higher resistance values,

If that were the case then you wouldn't be blowing up your circuits in the first place.

Something is getting too hot look at this:-

http://www.thebox.myzen.co.uk/Tutorial/Power.html

That is why a schematic is useful because we can see what you have missed.