I'm very new with all this so bear with me. I've got an freetronics board (Arduino Uno clone) and basically want to hook up a basic DC motor to the motor shield. However right now after looking through all the tutorials it doesn't appear to run. I've done a bit of basic programming in C and maybe I'm missing something.
This is what I've tried uploading to the board but when I connect my battery (9V) it doesn't do anything whilst connected via USB and if it isn't the motor jitters a bit and stops straight after. I'm more than likely missing something very basic but having no past experience I don't have much of an idea. Here's a picture of my setup -> Imgur: The magic of the Internet. Essentially what I want is a basic template that lets me know the motor is under my control, like "run motor for x seconds". Thanks in advance.
Please provide a URL to your motor shield. I don't want to google and find the wrong one.
Basicly motor controls use 3 signals.
For motor A it would be ENA, IN1, IN2.
For the motor connected to the output for A to run, you need to have IN1 and IN2 different. To say not both HIGH, and not both LOW. Depending on which is HIGH and the other one of course being LOW, it determines the direction of the motor. Then making ENA high will run the motor. For speed control, you can use PWM on the ENA pin.
Do you see these three pins on the shield? What pins of the arduino are each connected to?
Hi zhongyan,
What are you powering it with? even small DC motors can require a few 100 ma of current, Tell me it's not that tiny 9v battery!! you need 4 x AA cells at least. When the USB is connected the Uno runs from that, otherwise in uses power from the socket or vin, via an on-board 5V reg. THe driver on the shield is more then likely to be a L293/298 which uses transistors for the H bridge so you lose almost 1.5V across them too.
Hope this helps, give me a shout, done the odd buggy-bot or 2.
zhongyan:
Sorry, it's a 2-Channel H-Bridge Motor Driver Shield by freetronics.
Hi zhongyan
You can't power the motor shield and board directly from USB.
If you're trying to run the whole lot from that 9V battery - check the voltage, as others have said the voltage drop through the IC won't help (and that battery won't last long either!)
For more see - HBRIDGE Motor Driver Shield Quickstart Guide | Freetronics