I'm struggling with a setup I've build to control eight 12v motors with TIP120 transistors. I've included a fritzing sketch so you can see my wiring setup. I know you experts don't like fritzing so please forgive me I can't draw a wiring schematic. I'm using an Arduino Mega with the transistors plugged into pins 3, 5, 6, 7, 8, 9, 11, and 12. There is a 2.2K resistor between the TIP120 base and the Arduino. Each motor has a diode to prevent voltage kickback to the TIP120. The motors are powered via a 12v power supply (the sketch shows 9v battery) and the Arduino is powered via USB but is grounded to power supply. One thing to note that is not depicted is that all of the TIP120's are mounted to a single aluminum heat sink with silicone grease.
Through out my project I will be changing the PWM of each motor. Currently I am trying to power 4 while the other 4 are turned off. The sketch is as follows:
const byte Motor1 = 3;
const byte Motor2 = 5;
const byte Motor3 = 6;
const byte Motor4 = 7;
const byte Motor5 = 8;
const byte Motor6 = 9;
const byte Motor7 = 11;
const byte Motor8 = 12;
void setup(){
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
analogWrite(Motor1, 0);
analogWrite(Motor2, 0);
analogWrite(Motor3, 0);
analogWrite(Motor4, 0);
analogWrite(Motor5, 100);
analogWrite(Motor6, 100);
analogWrite(Motor7, 100);
analogWrite(Motor8, 100);
}
void loop() {
}
Here's my problem: No matter what I set the PWM to on any of the pins, ALL of the motors will power at that speed. I want motors 1-4 off and 5-6 PWM to be 100. With this sketch all motors are powered at PWM 100. What am I doing wrong?
I noticed that the back of the transistors has continuity to the collector pin. The silicone grease should prevent any contact to the heatsink. However, if the transistors are all shorted to the heatsink via the collector, could this be my problem?

