Go Down

Topic: xbee's for stepper motor control (Read 2259 times) previous topic - next topic

I couldn't reply to topics from the old forum, and while I know this is an Arduino forum I want to accomplish this without an Arduino so I'm starting a new topic with high hopes.

I don't know anything about the Xbee's and their capability so here's what I'd like to do and hopefully someone can tell me if it's possible or not.
I want to use a rotary encoder (US Digital S1) to send a signal to an Xbee, transmit that signal to a receiving Xbee that outputs to a motor controller (US Digital MD2S) that's driving a stepper (Maybe this one).

I'm sure it's not this easy, so if this set up doesn't work maybe there's an alternative on the top of your head?


I'm not sure if the Xbee actually has the capability... but check out the ATtiny85 or 13 @ sparkfun. It's like the ATMega328 in your arduino, but a lot smaller.

If that looks good, I can tell you some more info on using it.

Ah bummer. I'm trying to find a wireless solution that doesn't require soldering, or at least very minimal amounts of soldering. What's the missing link? Data interpretation for the Xbee's? Would I have to connect Arduino's or something to make it work?


ATtiny's are 8 pin DIP Packages... No soldering required. Just put it into a mini breadboard w/ the Xbees.

Good Luck!

What capability is the xbee lacking? Interpretation of the a/b quadrature data from the encoder? Would I need two attinys to do the reading and converting? I've never designed my own microcontroller but I'll give it a shot if it's within my brains grasp. I had thought about just transmitting PWM but I can find a prebuilt stepper controller that reads PWM, and it seems like servos aren't going to be able to track over 360 degrees of movement.
Thanks for your help this far.


**My clipboard in broken. I can post some of the links. You'll have to find them. Sorry :( **

The stepper you pointed out has 4 pins. ATtiny's have 8 pins, including power. So 6 pins left. 2 for stepper motor data (other 2 are power.), 2 for rotary encoder (plus 2 for power). That should work.

If you decide to use the ATtiny:

You probably don't need that $150 controller. Check out this:

arduino.cc/en/Tutorial/MotorKnob  (tutorial)

and you'll need an H-bridge from sparkfun. (COM-0315)


Get the EasyDriver from sparkfun (ROB-10267)

If you look under the "Documents" section for a Portuguese tutorial... you'll have to translate it.

IMPORTANT: Stepper is rated for 12V you will need a 12V power supply for it, NOT ARDUINO POWER PINS!

Good Luck!

How would I transmit the data with only one attiny? I'm even more confused now. I have read from a couple sources that the easydriver generates audible noise. The expensive controller is silent and microsteps to a far more detailed range. I could try servos and insulate them in a project box to try and limit the noise, but even with servos I wouldn't be able to get more than 360 degree rotation right? I need to spin an incremental or absolute rotary encoder and have some type of near-silent motor accurately track the encoder movement in both directions. Wirelessly. Im flexible on the exact ratio, but it should be something like 1 spin of the encoder is 1 revolution of the motor.  There are expensive solutions, I was just hoping there was some way to do it without spending $2500


Or without spending $150. Please tell me what you want to do, completely. Don't include parts, just what your input is and what your output is.

This is the end goal follow focus

The priorities of this project over a rag tag system I already have built are that it be wireless and near silent.


OK. So you want to spin rotary encoder, which sends signal over RF to change camera's focus.

1. Does it have to be rotary encoder? What about a potentiometer?
2. Does it have to be an Xbee? You can get General Radio transmitters/receivers from sparkfun for about $5 each.

But, sticking to your original idea, I don't the xbees have the power to control steppers. But I'm not 100% sure...

Pots won't give me full 360 degrees of accuracy unfortunately. Unless everything I've read about continuous rotation pots has been incomplete or inaccurate. I can find analog encoders that do the same thing as a pot, but the issue is still the type of signal. I don't think I'd have a problem making a pot wireless, or even an encoder that does PWM since I could probably hack a futaba remote and receiver or send PWM through the xbees directly. The issue comes down to what type of signal works with which motors. I need quiet and full continuous and repeatable rotation and it seems like a stepper is the best I can find, but then it becomes a matter of finding a stepper controller that accepts PWM. Ive seen some microchips that say they do just that, unfortunately building a stepper motor controller from scratch is outside my realm of intelligence. I like a challenge but I know my limits.
I really appreciate your help though.


What if you got a full rotation servo?


Say your pot has 180 degrees rotation. Adding a 1:2 gear set onto the pot will give it 360 degrees:

Pot has a 50 tooth gear on it. You spin 25 tooth gear. Twice the range. Ta da. As long as your ADC has high enough resolution, you can add larger and larger gears!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131