Damaged Arduino, Hard Drive, and USB Hub

I'm working on a project to speed control two computer fans I have that do not operate with PWM. Things went terribly wrong and I'm not sure why. I need help figuring out what happened and how to prevent it from reoccurring.

Here's what happened: While modifying code on a Leonardo connected to my computer (via USB hub) I noticed my desk lamp dim for a split second, a small "pop" sound from my speakers, and an immediate clicking sound from my external hard drive. I did some investigating afterwards and found my USB hub now only supplies power and no longer transmits or receives data; the same for the Leonardo, it only powers on but is not recognized by the computer. My external hard drive is no longer recognized and makes a terrible clicking sound whenever it's powered up.

My setup is shown below.

My best guess is that something went wrong with the 12V source being connected to the Leonardo's Vin while the Leonardo was connected to the computer via USB, but I'm not sure what exactly.

How can I prevent this from happening again? Is a USB hub sufficient enough to prevent damage to my computer if something like this were to happen again?

Thanks!

Got a schematic with part numbers? Not enough info thereo tell what that is supposed to be doing.

It may be that one of your power supplies disagreed about what the ground voltage was, which would result in a short circuit through the ground lkine.

Here is the schematic for the project. The purpose of the project is to sense temperature via the temperature probe and then control the digital potentiometer to vary the current going to the DC fans. My goal is to speed control the non-PWM computer fans that I have.

The project was working as intended for about 30 minutes. After some time, while the Arduino was connected as shown in the schematic, and also connected to the computer, the damage problem occurred without anything changing. I hadn't altered anything physically, or in the code, for a few minutes before the damage happened.

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
#include <SPI.h> //include the SPI library

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

const int ChipSelectPin = 10; //set pin 10 as the chip select
int digipotval = 0; //value for digital pot (10 kOhm in 256 steps)

void setup(void)
{
  pinMode(ChipSelectPin, OUTPUT); // must set the ChipSelectPin as output
  SPI.begin(); // initialize SPI library
  Serial.begin(9600);
  sensors.begin();
}

void loop(void)
{ 
  double temp;
  sensors.requestTemperatures();
  temp = (sensors.getTempCByIndex(0) * 1.8 +32.0);  
  Serial.println(temp);
  delay(1000);
  
  if(temp > 75.00)
 {
  digipotval = 104; //runs fans at 50% speed
  digitalPotWrite(17, digipotval); //function definedbelow
  delay(10);
 }
   
   if(temp > 77.00)
 {
  digipotval = 100; //runs fans at 70% speed
  digitalPotWrite(17, digipotval); //function definedbelow
  delay(10);
 } 
   
}

//this function performsthe four steps necessary to communicate with the
//MCP41010; 1)select the chip; 2)send the command byte 3)send the data byte
//4)de-select the chio.
//

int digitalPotWrite(int command, int value) {
digitalWrite(ChipSelectPin,LOW); //take the CS pin low to select the chip
SPI.transfer(command); //send the command and ...
SPI.transfer(value); //...the value bytes via SPI
digitalWrite(ChipSelectPin,HIGH); //take the CS pin high to de-select chip
}

The digital pot is only good for 1mA of current.
If you didn't have resistors between pin 6 and the transistor base, you are likely to have damaged the MCP41010.

2N2222A is only good for a few hundred mA as well. They may have overcurrented and could be dead also.

As to how those failing got back to the Arduino, I can't say.

CrossRoads, thank you for your reply.

I was under the assumption that the 10k resistor in series with pin 7 of the digital potentiometer would limit the current into the IC to 0.5mA. Is that resistor necessary there as well as putting one between the IC and the transistor?

If the two fans draw 160mA in total, should I do anything more to protect the transistors, or is that type of current okay with the transistors I'm using?

For future projects, is there any general protection I can provide between the Arduino and my USB hub to prevent any kind of unforeseen damage?

Thanks!

Would buying a powered (or unpowered) USB hub prevent my computer from being damaged if this were to happen again?

Possibly the wholesale damage might have occurred in the following manner:

The transistors overheated due to over current and shorted out emitter to the base, thus sending 12 volts back into the digital pot. The digital pot went and fed back 12 volts into the Arduino. That in turn sent 12 volts back through the USB port, damaging the USB hub, external hd and computer USB port. Check the transistors to see if emitter-base is shorted. Most unusual and unfortunate incident.

Anyway, in that situation isolation between your USB ports using this:
http://dangerousprototypes.com/2014/05/08/usb-isolator-project/
would have helped. Then again most persons aren't taking this type of precaution.

donovanpl123, thanks for your input.

I checked both of the transistors for shorts and found a 0.667 ohm resistance between the base and emitter of the transistor that connects directly to the digital potentiometer. All of the other terminal pairs showed > 200Mohm when I checked them with my multimeter.

Should I place a resistor between any transistors from now on to prevent damage from occurring?

BluePenguin:
I'm working on a project to speed control two computer fans I have that do not operate with PWM. Things went terribly wrong and I'm not sure why. I need help figuring out what happened and how to prevent it from reoccurring.

Here's what happened: While modifying code on a Leonardo connected to my computer (via USB hub) I noticed my desk lamp dim for a split second, a small "pop" sound from my speakers, and an immediate clicking sound from my external hard drive. I did some investigating afterwards and found my USB hub now only supplies power and no longer transmits or receives data; the same for the Leonardo, it only powers on but is not recognized by the computer. My external hard drive is no longer recognized and makes a terrible clicking sound whenever it's powered up.

My setup is shown below.

My best guess is that something went wrong with the 12V source being connected to the Leonardo's Vin while the Leonardo was connected to the computer via USB, but I'm not sure what exactly.

How can I prevent this from happening again? Is a USB hub sufficient enough to prevent damage to my computer if something like this were to happen again?

Thanks!

You connected 12 v to the Leonardo Vin while plugged to USB at the same time?
I bet that is the issue. 12 volt went through usb and blew all

Also, why dont your fans work with pwm? Ive worked with pc fans with pwm and Mosfet as transistor, and works fine. I use at least 20 khz as pwm frequency to drive small fans.

about the hard drive.

I was unbelievably lucky to have secured a box of garbage.

oh... about the hard drive...

did I mention I got a box of garbage?
well my mother board blew the power supply or the caps, not sure which went first, but the surge fried the hard drive.

all my stuff up tot that point.

in that box of garbage was the exact same make and model hard drive.
tried it in a different computer and it was toast. the only the NSA destroys the platters like that.

anyway, I had one hard drive with a bad controller and one hard drive with bad platters.....

exact same make and model, swapped the board and I now had a hard drive with bad platter AND a fried controller.

oh, the other one worked perfect, got years more out of it, still have it and recovered all my data.

mart256
Is it always a bad idea to have an Arduino connected via USB at the same time as a source connected to Vin?

BluePenguin:
mart256
Is it always a bad idea to have an Arduino connected via USB at the same time as a source connected to Vin?

Ive not seen Leonardo schematic but Vin and Usb seems to go both to the regulator, I means they are connected together I guess.
Its not a good idea connecting 2 power supplys in parallel specially if they are diferent voltage level (usb is 5 volt and fan supply is 12 v).

mart256:
Ive not seen Leonardo schematic but Vin and Usb seems to go both to the regulator, I means they are connected together I guess.
Its not a good idea connecting 2 power supplys in parallel specially if they are diferent voltage level (usb is 5 volt and fan supply is 12 v).

That is helpful! I hadn't though about the two sources being in parallel. I'll remember to disconnect any external sources before connected the Arduino to the computer next time.

Thanks!

BluePenguin:

mart256:
Ive not seen Leonardo schematic but Vin and Usb seems to go both to the regulator, I means they are connected together I guess.
Its not a good idea connecting 2 power supplys in parallel specially if they are diferent voltage level (usb is 5 volt and fan supply is 12 v).

That is helpful! I hadn't though about the two sources being in parallel. I'll remember to disconnect any external sources before connected the Arduino to the computer next time.

Thanks!

I checked schematic they are not directly connected, instead there is a supply selector. But 12 volt is the limit and may have burn something on the selector that made them being in parallel and boom. So next time unplug Vin if using USB for safer use.

Note: You still can connect both gnd together ( arduino gnd and external supply gnd) , that is neccesary to drive transistor and motors and it is safe.

Hi since when has 2N2222 been PNP?
Its and NPN transisor.
And where is the base current limit resistor?

Tom..... :slight_smile:

TomGeorge:
Hi since when has 2N2222 been PNP?
Its and NPN transisor.
And where is the base current limit resistor?

Tom..... :slight_smile:

I must have chosen the wrong transistor image when drawing the diagrams. I meant to put them as PNPs. Good catch!

I'm not very familiar with transistors. Why is a resistor needed to limit the current to the base? My intention in designing the circuit was to limit the maximum current through the digital potentiometer to be < 0.5mA so that the transistor would be protected. Is what I did sufficient or am I missing something?

BluePenguin:
I checked both of the transistors for shorts and found a 0.667 ohm resistance between the base and emitter of the transistor that connects directly to the digital potentiometer. All of the other terminal pairs showed > 200Mohm when I checked them with my multimeter.

When checking bipolar transistors, you need to select the diode function on the meter. Between the emitter and base will read 0.6, but when you reverse the leads you should get a high resistance. Same goes for the collector and base. Between the collector and emitter you should get a very high resistance either way.

Should you put a resistor in the base? I stand corrected, but the circuit seems to be a type of emitter-follower circuit with a voltage divider on the base. Also, when you move the pot towards the negative rail, you would oversaturate the base-emitter junction and possibly damage the transistors. Usually in a emitter-follower config. there is no resistor inserted in the base. Maybe the 10k resistor should be on the other leg of the pot. In any case seems like the output voltage would never go above 4.3 volts since the pot is tied to 5 v. You prob. should be using some other circuit.