avrdude not in sync

Hello,

I just got my arduino a couple days ago and have just started to play with it.

My first project was to see if i can generate a magnetic field through a coil of wire. However, when i connect the coil i made to the arduino it gives me an out of sync error when trying to upload the program, if i disconnect the coil, it loads fine.

I am not sure how many turns i have in the coil, i believe it to be in the 50 - 75 range.

What is the reason that this would cause the arduino to go out of sync? Also if i try to send something out with serial (ex Serial.println(“Hello World!”)) without the coil attached it sends fine, but if i try and run the same program with the coil attached i get a random assortment of letters… seems to be most often an uppercase E.

My only thought is that it need more power? I am running it off usb currently

Any ideas?

What is the reason that this would cause the arduino to go out of sync?

You should show us your wiring diagram for your coil, but I bet your drawing too much current through the coil and causing the USB thermofuse to open up which removes +5vdc power for the board. You really should drive a coil with a switching transistor and use external power rated for the current that your coil draws.

Lefty

That makes sense.

The coil is just some loops of wire wrapped around an iron core...really nothing fancy.

Do you know of an equation that relates the number of loops to the amount of current being draw?

I will look into a switching transistor and using an external power source to power the coil. Ideally i would just power it on the arduino but it seems like i might need a smaller coil for that, which isnt a big deal.

If you are just powering the coil with DC voltage, then it's not the number of turns directly but rather the DC resistance of the total coil. How are you wiring the coil to the Arduino?

Lefty

depending on what you're doing you might be happy limiting the current with a resistor to save the arduino.

Are you trying to generate RF energy or make a magnet? Actually, with the iron core I guess it's a magnet.

I did try putting a 10 ohm resistor in front of the coil to see if that would make a difference...which it didn't.

Yes i am trying to make a magnet.

EDIT: I am wiring the coil by taking the tx pin out to a breadboard which goes to one side of a resistor and then the coil is in series behind that and then back to the ground on the arduino from the back end of the coil.

Connecting anything to the Tx and Rx pins is going to interfere with uploading sketches or any other serial communication. No wonder you are having problems.

I am wiring the coil by taking the tx pin out to a breadboard which goes to one side of a resistor and then the coil is in series behind that and then back to the ground on the arduino from the back end of the coil.

Well an Arduino digital output pin can only supply up to 40ma of current safely before damage to the pin can result. So the total resistance of the coil and any series resistor had better be higher then 125 ohms. 200 ohms would be a better total resistance.

If you haven’t already damaged the output pin, you should stop trying it the way you are going. It’s going to take possibly hundreds of turns of wire depending on wired diameter and loop dimensions.

If you drive a switching transistor from the digital output pin then you could drive a coil to the collector current limit of the transistor’s rating, assuming you are using an external DC power source that can supply the desired current.

Think of your magnet coil as a motor and research this site for motor driver circuits and methods.
Lefty

Thanks for the input.

Sounds like a little research is in order before i try this again.

Thanks for the help.

So would you suggest getting an H-bridge and then putting the coil on the other side while supplying a separate power source to the vcc connection on the H-bridge?

This would allow the arduino to control whether the coil is on or off and the coil would not be drawing current directly from the arduino. Is that correct?

This would allow the arduino to control whether the coil is on or off and the coil would not be drawing current directly from the arduino. Is that correct?

Yes. However a H-drive shouldn't be required as that is so you can drive the current in either direction. For a simple magnet you only need to turn the current on and off, so a simple single transistor should do fine.

This circuit should be fine for you use as a solenoid is just a magnet coil. http://www.arduino.cc/playground/uploads/Learning/solenoid_driver.pdf

Lefty

excellent thank you i think that will work.

So just so i understand correctly. The H -bridge allows me to reverse the current going out to the motor as well as run it forward?

This would be used for controlling whether the motor went forward or backwards. Which means if i wanted to build a robot that had some small motors, i would use an H-bridge to control which direction the robot went.

Is that correct?

Edit: What amperage rating should i get the transistor at? Is 1 amp going to be enough?

Is that correct?

Edit: What amperage rating should i get the transistor at? Is 1 amp going to be enough?

  1. Yes, that is correct.

  2. Depends on what the resistance of your coil is. Then use ohms law amps = volts / resistance. The transistor's current rating should be rated at least double what is required for the coil.

Sounds like you might first have to obtain a digital multimeter first so you can wind a coil with enough resistance. A meter is a fundamental need in this hobby.

Lefty

I actually have a multimeter, i just stupidly forgot all about ohms law.

I am very new to hobby electronics and my college electronics education has only been digital logic circuits.

Thank you very much for your help.

Note to self... always remember V=IR