Controlling servos with maestro and 1Sheeld cell phone sheld

This is a quick example. Just shows how to control servos powered with the maestro board and using standard servo library. In the youTube video, I put the code in the comments because youTube didn’t let me use brackets in the description.

As you can see, I just used the basic servo library and had to snip and strip the control servo wire to do this. I wrote this in the description, but I THINK (I don’t always get these communications protocols) that the right way to do that is using the TTL serial. I’m figuring that out now. I just got this working the way that made sense to me and the servos are $2 each so I wasn’t worried about it. And, the code is dead simple.

Hello.

Cool project! Thanks for sharing it with us.

I looked at your code in the YouTube comment section and noticed that you are using the Arduino’s Servo library. That library does not work with our Maestro, since it directly outputs RC servo signals which the Maestro cannot accept. How are you using the Maestro to control your servos?

- Amanda

I’m not.

  1. I’m using the maestro only to power the servos, but that’s a problem in and of itself if you’re trying to power a lot of servos. That was a total hack. But…

  2. since I put that video up, I was able to communicate with the maestro using the TX serial line. I used a library I found on github that used the “pololu” method, but I’m writing my own that uses the “compact” method. I haven’t integrated it with the 1sheeld yet, but that shouldn’t be an issue. I’ll repost when I get it.

If you are having problems powering more than one servo in your setup, I suspect that your power supply is not able to source enough current to your servos. We typically recommend budgeting around 1A per standard servo. However, we also do not recommend putting more than 6A through the power rails on the Maestro, so if you expect your servos to draw more than 6A total, you should probably power the servos directly from your power supply, separate from your Maestro.

It sounds like you might have not seen our Arduino library for the Maestro, which we link on all of the Maestro product pages under the “Resources” tab. The library uses the compact protocol by default as stated in the code comments in PololuMaestro.h. You can find some examples under the “examples” folder to help you get started.

- Amanda

Thanks. I had not seen the library when I first posted, but I eventually found it on gitHub.

Pretty easy to set up once I had that. The code is in the comment section of the youTube video. I left all the descriptions and citations from the Pololu Library header in the code, and just combined it with the 1Sheeld calls. I commented out the entire “else” section in loop(). You could – for instance – use that to re-set the servo’s to a default position when no button is pushed. This is all powered off the 6V battery pack.

There are also TX/RX pins coming off the 1shield, but I couldn’t get those to work.

I have an idea for a “toy” (for lack of a better word) using this set-up, but it’s a long way off.

Thanks. The mini is a very nice product.

I’m glad you like the Maestro! Thanks for the updated video.

It looks like you are powering both your Arduino Mega and 1Sheeld from the Maestro’s 5V (out) pin, which is not a good idea since the Maestro’s 5V out pin can only source about 100mA of current. You might consider powering the Arduino and shield from another power source.

By the way, it sounds like you are having trouble implementing the Maestro into your setup. I would be happy to help you troubleshoot more if you make a new thread under the “Servo controllers and servos” category of the forum.

- Amanda

1 Like

Thanks, Amanda. I’ll look into powering the Duino from another source. I assume that I still need a common ground for it and the maestro?

I have ZERO electronics background, so what looks like trouble is really just me learning on the go. I’ve smoked a couple servos already – fortunately no boards – but I just think it’s just the price of education. I never figure out why the “right way” works until I see the “wrong way” not work. Does that make sense?

Thanks.

Yes, all of the electronic components in a system should generally share a common ground. I think it is common for people starting to learn electronics to rely on trail and error until they learn some of the underlying theory.

- Amanda