Help a Student! Arduino Uno to run both a Stepper and a DC

Hi there!

This is my first post in this forum, and it’s a needed one. I’m totally new to electronics, but due to being challanged with a chapter in my education, i find myself wrestling the beasts of arduino.

What i want to do is:

Making a Steppermotor control a little “carridge” on a rail. On this “carridge” i want to have a little dc motor(for weight reasons). The dc motor is supposed to make a rope (with a magnet on the end of it) go up and down.

Following this schematic: http://www.azega.com/controlling-a-step … n-arduino/ i’ve actually got the stepper-motor to run, but it’s really slow. I can’t really figure out why. The motor i’m using is a Sanyo Denki 103H7121-0144. I first thought it was something with the power, so i plugged the power into “Vin” and plugged a 12V 1A AC/DC into the arduino port. Sure, the difference is noticeable soundwise, but it still can’t go faster even though we change the code. Is there some other way of bringing power in or am i just missing something?

The dc motor is hard. We know it can go in both directions by switting the pos/neg, but we don’t know how to control it on the board. Everywhere online that i look, i keep hearing about shields but I don’t really know what shields do and here in Stockholm, Sweden, it seems you can’t buy a ready made Motor Shield.

I need sooo much help. I think you guys are awesome so i trust you to guide me in the right direction.

I also want to control this with a joystick, where the stepper is the X-axis and the dc is the Y-axis, but don’t worry about that for now. I think i can figure it out by myself.

Hi nudelkopp,

To answer your question about the stepper motor I would suggest you start with finding the datasheet. There you should find what voltage and current the motor is rated for. I looked around a little bit but wasn’t able to find a datasheet for the exact model you mentioned, but it looked like most of the other models of the motor used more than 12v to power them. When dealing with the higher power you should also remember that the arduino can only handle certain amounts of power. from the wall-wart type adapter it will only allow 500ma of current to be sourced, So you’ll probably want to hook up an appropriately rated supply for the motor that is separate from the arduino. The Atmega that has the arduino boot loader on it also only wants around 5v of power to run it directly. So be careful when hooking up your 12v lines to it especially if you’re going through the Vin and Gnd.

As for the DC motor there are a couple things you can do to control it. First of all you’re going to probably want some other source of power for it (separate from the arduino again), and then you can control it’s direction using either an h-bridge or a simple relay to switch the flow of power… There are a lot of tutorials for doing this on the internet so look around. If you need some place to start check out the arduino.cc website under lessons or tutorials. There are lots of really great tutorials around than should get you where you want to be.

nudelkopp,

Most likely your problem stems from not supplying enough voltage to the stepper motor. While you have a 12v wall adapter the arduino board does not have a direct line to that from what I understand. What you most likely want to do is get a barrel jack adapter and power one rail of the breadboard with 12v then use 7805 and power another rail with 5V. This way you have a 12v supply for the motor and 5v for the arduino. The other reason for this is you don’t want to be pulling all of the current through the arduino board like the tutorial is because of how much more power your motor takes down. Definitely get a hold of a data sheet and know what you are dealing with.

As for controlling the DC motor for up/down use what you need to do is keep both lines of the motor high and have a way to select which line you dump to ground. I could tell you exactly how to do that but then what fun would learning be.

Best of luck.

-Sal

nudelkopp,

In general, the advice about not trying to run your motor power through your Arduino is correct. That’s true for reasons of voltage, current, and electrical noise. Even if you can’t find motor driver Arduino shields in Sweden, it seems unlikely that you can’t find motor driver ICs from which to build the appropriate circuit. The part for which to look is an “H-bridge”, such as an L298. That’s what’s used on the Ardumoto shield.

Failing that, you could build your own out of transistors. If you do a bit of searching here, you should find some guidance.

All that said, it appears you can buy a motor driver shield for Arduino in Sweden [here or [here.

Happy Hunting,

Eric

PS: If anyone is curious, SparkFun maintains a [convenient list of distributors, sorted geographically.](Distributors - SparkFun Electronics)](http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=689816&groupid=74954&sortafter=0&sortafterchild=0&refcode=p)](elektronik byggsatser komponenter mätinstrument @ Electrokit)