I think I fried my first Arduino, help me understand where I went wrong.

Well I recently start learning about Arduino and just started my first project and unfortunately I think I already fried my Arduino Uno :frowning:

So I purchased the Ardunio starter kit from this website (Starter Kit), it came with the following Mosfet Transistors: IRF520N which I was hoping could power the peristaltic pump that I ordered, and it did! ... for about 1 minute...

I connected everything together and powered it with a 12v 1200mA power supply, hit the switch and the pump started working, it was kind of slow but I didn't get a change to measure the flow rate to see if it was slow or not. After about a minute the pump started to slow down and then finally stopped working. I noticed the board was getting pretty warm, not too hot to touch but noticeably warm. I let it cool off and then connected the board via USB and tried to upload the program again, but I got the following error message:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x51
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Here is a photo of the rig, it's pretty simple so you can probably figure out what is happening but I'll try to explain it.

I have a power wire running from Vin to the left power channel on the breadboard and a ground wire running from Gnd to the ground channel. Starting at the top of the breadboard I have a jumper wire running from the + channel to pin a3 on the breadboard which is connected to the + side of a push button. I connect the - end of the push button to a 10K ohm resistor which connects to the - channel of the breadboard. I also have a jumper wiring running from the - side of the push button to pin 2 on the Uno and another jumper carrying power from the - side of the push button to the + channel on the right side of the bread board (I think this was my mistake, but more on that later). The idea there being I have a push button that when it's pressed sends power to both pin 2 and the right half of the bread board. Next moving down I connect pin ~9 from the Uno to the left pin on my IRF520N transistor and I connect the right pin on the transistor to the - channel on the breadboard. I connect a jumper from the middle pin of the transistor to the - wire for the pump (c16 - f25). I also have a diodes anode connected to the middle pin of the transistor running to the + power channel to prevent a back pulse. I connect the + wire for the pump to the + channel on the breadboard and finally jump the - power channels together so both sides of the breadboard share a common ground.


(note: view the image in a new tab to see it full size)

As I said above I am thinking the mistake was to run a jumper wire from the - side of the push button (b5) to the + power channel on the right side of the breadboard. In retrospect I'm thinking this provided a channel for a back pulse to send an EMP to the board frying it. I am thinking I should have run a second diode inline with that jumper cable. Say connecting the jumper from b5 - g2 and then connecting a diodes anode to h2 and its cathode to the + power channel.

Thoughts?

Please make and post a clear wiring diagram -- hand drawn is fine, avoid Fritzing. Be sure to show all power supplies and ground connections.

It is extremely difficult to make sense of the photo or your written commentary.

Next moving down I connect pin ~9 from the Uno to the left pin on my IRF520N transistor

"left pin = gate". Please use the correct notation. Evidently you have not used a resistor between the gate and the pin. This is a bad idea and if you are following someone else's instructions, you should choose another design.

As noted in another post, the IRF520 is not appropriate for the Arduino.

jremington:
Please make and post a clear wiring diagram -- hand drawn is fine, avoid Fritzing. Be sure to show all power supplies and ground connections.

It is extremely difficult to make sense of the photo or your written commentary.
"left pin = gate". Please use the correct notation. Evidently you have not used a resistor between the gate and the pin. This is a bad idea and if you are following someone else's instructions, you should choose another design.

As noted in another post, the IRF520 is not appropriate for the Arduino.

Sure I did my best to draw out the diagram. I have zero electrical background so it's mostly just a copy of the guide I was using where I tried to draw the changes I made from the original design, I'm not sure it's 100% accurate but hopefully it helps.

Also here is a photo of the design I was following, you'll notice I don't use the 9v battery and am instead trying to use a 12v 1200mA (max) power supply plugged into the power connector on the board. I'm also connecting a 12v pump instead of the little DC motor the diagrams call for.

Hi,
A bit puzzling, but you cannot connect an I/O pin, that is pin 2 to 12V.

The circuit in brown uses the USB as UNO supply, hence the 10K and pin 2 connected to 5V.

To power everything off your 12V, you should have left them connected to 5V and just connected the 12V to Vin.

Sorry but it looks like you have cooked the 328, is your UNO a DIL plug in IC or a surface mount square IC?

Tom... :slight_smile:

TomGeorge:
Hi,
A bit puzzling, but you cannot connect an I/O pin, that is pin 2 to 12V.

The circuit in brown uses the USB as UNO supply, hence the 10K and pin 2 connected to 5V.

To power everything off your 12V, you should have left them connected to 5V and just connected the 12V to Vin.

Sorry but it looks like you have cooked the 328, is your UNO a DIL plug in IC or a surface mount square IC?

Tom... :slight_smile:

I don't know what the difference between a DIL plug in IC and a surface mount square IC is.

I think I understand what you're saying about the wiring, I drew out the wiring diagram that I think you're saying I should have used, does this look like what you were saying to do?

Hi,
As below.


Tom.... :slight_smile:
PS, Can you post your images with size about 1M, yours are 3M and it takes minutes for the thread to load.

Hi, me again.
As your UNO has a DIL 328 IC, you can purchase 328 with bootloader already installed, so all you need to do is replace the IC.

Tom... :slight_smile:

TomGeorge:
Hi, me again.
As your UNO has a DIL 328 IC, you can purchase 328 with bootloader already installed, so all you need to do is replace the IC.

Arduino bootloader-programmed chip (Atmega328P) : ID 123 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Tom... :slight_smile:

Awesome thanks!

You can also wire it safer by using the push button to connect pin 2 to Gnd instead of +5, and use the internal pullup resistor for pin 2, leaving the resistor for pin 2 out.

byte pin9 = 9;
byte pin2 = 2;
void setup(){
pinMode (pin2, INPUT_PULLUP); turn on internal pullup resistor
pinMode (pin9, OUTPUT);
}
void loop(){
  if (digitalRead(pin2) == LOW){ // button pressed?
  digitalWrite (pin9, HIGH); // yes, turn on LED
  }
  else {
  digitalWrite (pin9, LOW); // no, turn off LED
  }
}

I have zero electrical background so it's mostly just a copy of the guide I was using

Unfortunately you chose a guide written by someone who also has very little to zero "electrical background". It appears to be full of bad advice.

Take a close look at Tom George's schematic in reply #5. The resistors R2 and R3 are important! If you leave R2 out, you may even destroy the port pin.

It is a great idea to look at several designs before choosing one, and attempt to educate yourself. If you see obvious discrepancies, ask before building something and you may avoid problems like this. However, all of us have fried circuitry too, mostly by not paying attention.

HI,

Since you have just started learning arduino I advise you to go through this link which I find really helpful to the newcomers.

Also, I advise you to check the voltage (shoud be <5v except on Vin, from my knowledge. you can get more information from datasheet) before connecting it the arduino to prevent it from frying anywhere in the future.

TomGeorge:
Hi,
As below.


Tom.... :slight_smile:
PS, Can you post your images with size about 1M, yours are 3M and it takes minutes for the thread to load.

Thank you for the diagram that's very helpful. I guess I need to read up more on resistors and how they work as I'm totally lost why you need the extra 220 and 10k ohm resisters in the circuit.

I've also been watching some videos and it seems like using a power relay might be a might simpler/safer way to accomplish providing 12v power to the pumps.

My explanantion (which might be partially or fully wrong). The 220 Ohm limits the current on the arduino pin; the 10k makes sure that the fet can be fully switched off.

Why use a bulky relay of you can do it with a small fet? And you will have a hard time controlling the speed of the motor (if needed) or dimming lights when you use a relay :slight_smile:

I'm totally lost why you need the extra 220 and 10k ohm resisters in the circuit.

sterretje is basically correct. Until you've learned quite a bit of electronics, take our word for it!

Hi,
Does your UNO get hot with only the USB plugged in?

If not you may have just fried the pin, try using another pin 10 or 11 and re-coding the sketch to use that pin.

You may be able to to keep programming without using pin 9 until your new 328 arrives.

Tom.... :slight_smile:

jremington:
sterretje is basically correct. Until you've learned quite a bit of electronics, take our word for it!

Oh trust me I'm totally taking your guys word for it! :slight_smile:

TomGeorge:
Hi,
Does your UNO get hot with only the USB plugged in?

If not you may have just fried the pin, try using another pin 10 or 11 and re-coding the sketch to use that pin.

You may be able to to keep programming without using pin 9 until your new 328 arrives.

Tom.... :slight_smile:

Well since I am unable to upload sketchs to the board I'm pretty sure it's more than just a fried pin. However when I plug it in via USB the board does not heat up and the pin 13 LED lights up.

My 328 shipped today so hopefully I'll have it Monday or Tuesday. It's a bummer I got my pH meter today too and I can't even play with it!

TomGeorge:
Hi,
As below.


Tom.... :slight_smile:
PS, Can you post your images with size about 1M, yours are 3M and it takes minutes for the thread to load.

Okay after doing a bunch of reading and thanks to sterretje explanation I think I am starting to understand your diagram. I have some questions though

  1. If I understand correctly you include the 10k ohm resister and a 220 ohm resistor so you can put the transistor into closed mode by ensuring that the current on the gate pin is lower than the current on the drain and source pins when pin 9 is set to LOW and then when pin 9 is powered sending 5v to the gate it will have a higher charge than the drain and source putting the transistor into short circuit mode sending 12v to the pump, is that correct? How much power is going to the drain pin, is it 0?

  2. I'm not sure how to tell if the 12V circuit is using the resistors in parallel or series, it looks like series to me but I'm not sure. Assuming it is series why do I need to bring the resistance up to 10,220 ohms? That seems like a pretty insignificant bump in resistance. Maybe the idea is the source has a 10k ohm resistor because of the shared ground and the gate needs to be a just slightly higher resistance so you bumped it up with a 220 ohm resistor.

  3. On the push button circuit why do you need a 10k ohm resister to protect pin 2 from 5V power? Shouldn't something smaller be sufficient? Using Ohms law a 10k ohm resistor on 5V means you're limiting pin 2 to only .5mA which seems unnecessarily low since from what I read a pin can handle a maximum of 40mA. Maybe the common ground means you actually need to protect pin 2 from 12V instead of 5V but even then the pin would only be getting 1.2mA.

  4. Is this transistor being used as a switch or an amplifier?

efarley:
... It's a bummer I got my pH meter today too and I can't even play with it!

Ok, I'm curious now. What are you making?

ChrisTenone:
Ok, I'm curious now. What are you making?

I am automating a DIY hydroponics system so that the pH and EC of the solution remains within an acceptable tolerance while allowing me to be lazy :slight_smile:

  1. You will need to learn about how MOSFETs work in order to understand why those resistors are necessary. The 220 Ohm resistor limits current into ground via the gate capacitance.

  2. The 12V circuit does not have any resistors in it. The MOSFET gate is completely isolated from the 12V circuit.

  3. The button resistor is a pull-down, required because of the extremely high impedance of the input.

  4. The transistor is being used as a voltage controlled switch. If you use the wrong one, like the IRF520, it will not turn on completely when activated by an Arduino output.