Hi Everyone,
I'm completely new to Arduino, and electronics, and this is my second project with it. What I need to do is very simple; get a couple of DC motors activated by PIR sensor. I'm using a motor shield because I would like to expand the circuit to include more DC motors in the future. For simplicity, I've opted out to use only one motor for now.
The circuit seems to be working very well as long as my Arduino is hooked to my computer via USB port. So the code seems to be ok. However, It seems that I cannot unhook the circuit from my computer and rely only on the external battery.
Is there a way to achieve that?
These are the steps :
The Circuit Part :
Motor Shield mounted on top of Arduino Uno
DC motor (the generic hobby motor) is connected to M1
Power supply on the motor shield is connected to a 9V battery and the Shield's power Jumber is removed and Led light is on indicating that it's using the external power supply properly.
PIR sensor is connected to 5V, Pin 2, and Gnd.
I have included a picture of the circuit and code for reference.
Thank you for your help.
Why can't You use the battory? What is the problem?
Checked the condition of the battory? Still 9 volts or more when it is cinnected to Your circuit?
The motor shield is actually connected to a battery. The problem is once I disconnect my Arduino from my computer the whole circuit stops working. Unfortunately I don’t know how to check the battery while it’s connected to test it, is there a certain device I should use for that ?
Thank you
Use a multimeter at any ground and battory+ point.
Else, what voltage do You measure at the disconnected battory?
Attach a diagram in another way. Circuit.jpg does not download properly.
Hi dhdhdhdh,
It has been a while since I've used the Adafruit Motor Shield but after a quick refresher, I've realized your problem is twofold:
- Based on your circuit image, you've removed the power jumper which means that the Arduino receives no power from your 9V battery. Thus, when you disconnect the USB cable from your Arduino, it is receiving no power.
- After reading Adafruit's guide you'll notice the following quote:
You can't run motors off of a 9V battery so don't waste your time/batteries!
This is because 9V batteries provide very little current and thus are not very well suited to powering motors, if I were you, I would use a wall wart or if your project is mobile, AA batteries.
All the best,
John Wolf
Progetto Company