The goal is to make a motor spin when a button is pressed, while both the Arduino and motor draw power from the same source, a makeshift 7.2 volt battery comprised of 6 x AA batteries(1.2v).
Is this setup safe for the board and components?
Every time power is plugged in, the motor starts for about half a second; any way to prevent this?
The motor spins, but not ever time. When the button is pushed, sometimes the motor doesn't have enough energy to spin up, and will only do so when giving it a light twist.
Since this design was based on one of the books projects, what is the point of the transistor? Can't I just connect pin 13 to one of the motor leads and have it work that way?
I assume you're using a logic level fet.
Then two more resistors should be used.
A 10k resistor from Arduino pin to ground, and a ~220ohm resistor between pin and gate. First image here.
But the main problem might be that you're using pin13 for the motor.
The processor flashes the onboard LED (= pin13) on/off during bootup.
Try changing the code/wiring to pin12.
Leo..
Moving from pin 13 to 12 did the trick, and now the motor doesn't spin on boot. The mosfet I'm using is a (IRF520). I think I added the resistors you suggested, but what did adding them accomplish, exactly?
However, I'm still having the problem where the motor doesn't have enough power after the first time I click the button. If I connect it straight to the power source, it starts right up, but then the Arduino isn't powered. Is 7.2 volts not strong enough to power both the Arduino and run the motor?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
You need to produce a diagram that shows the proper components, such as your MOSFET.
Please label the pins/leads on your components.
The IRF520 is not a logic level MOSFET, so you will not be turning the MOSFET fully ON.
I don't seem to be getting the option to embed an image directly into the post. All I have is "insert an image", which requires an image URL, and Attachments at the bottom. How do I post a pic. that is from my desktop, just as you did? Also, I googled CAD circuit, and came up a website called Tinkercad, the same website that I made the picture of my circuit. Would a good picture be the same exact one except with a labeled transistor? Is there anything else that would need labeling there?
I'm attempting to post an image of the MOSFET after uploading to a website:
Is there a way to embed directly into the post from my computer?
Edit: So uploading worked this time, but when I click your image to open the source link, it just gives me a download, which leads me to believe that you somehow embedded it straight from your hard drive?
Hi,
You attach the image file like I did.
Then save the post.
Right click on the image file name and "Copy link address".
Modify your post, and select "Insert an Image", paste the link address, then insert.