Raspberry Pi GPIO pin to Pololu maestro servo voltage?

Hi,

If I connect a GPIO pin from the Rpi to a maestro controller servo channel pin as an input, do I need to worry about converting the 3.3v coming from the pi to 5v which the maestro expects? Will the hi signal be detected at the 3.3 voltage at all?

I envisioned having a script running on the maestro looking at the input value on a channel connected to the pi, and wondered whether it would register as something higher than 0?

For example, if I had a pushbutton on the pi, and when I push it, I set a particular GPIO pin high, and that pin is connected to one of the signal servo pins on the maestro, and I want it to make the servo move to a particular position, etc… How do I wire that up?

I will be using the micro-maestro 6-channel servo controller which I already have working with 3 servos through the scripting built with the maestro control center.

Most 5 V devices recognize a 3.3 V signal as a “high”. There is no electrical problem connecting a 3.3 V output pin to a 5 V input pin, so do the experiment and see if it works. There is a problem connecting a 5 V output to a 3.3 V input, so in that case you must use a resistive voltage divider or other voltage level converter.

I tried it out and it works! In maestro control center, the input value for the connected pin displays as between 196 and 197 when I set the pin high on the Rpi.

Good to know.

Now I’m wondering about hooking up the UART of the Rpi to the RX and TX pins on the maestro, and whether it will be recognized at the 3.3v level, or whether I’d need to add a MAX3232 RS232 To TTL Converter Module in order to get things working between the two devices…

I recommend the Maestro users guide pololu.com/docs/0J40/5.b

Hello.

The Maestro’s microcontroller is only guaranteed to register a digital voltage on the RX line as high if it is over 4 V. However, several customers have successfully controlled the Maestro from 3.3 V systems using the RX line and it worked. Connecting to the Maestro’s TX line will be a bigger problem. The Raspberry Pi does not have 5V-tolerant inputs as far as I know, so you would need some kind of level shifting to avoid damaging it. You might try making a voltage divider using two resistors or getting a level-shifting board like this one from Sparkfun:

sparkfun.com/products/8745

Keep in mind that connecting the Maestro’s TX line is only necessary if you want to get information back from the Maestro.

–David

[quote=“DavidEGrayson”]Keep in mind that connecting the Maestro’s TX line is only necessary if you want to get information back from the Maestro.
[/quote]

I will eventually want to get a distance reading from an HC-SR04 Ultrasonic Sensor module that I have, so I guess I need to be concerned about hooking that up to an output from the maestro at 5v going back to a 3.3v input on the Rpi…

Or I can try wiring the HC-SR04 directly into the Rpi GPIO, and bypass any need for input from the maestro, but the output from the HC-SR04 is at 5v, so I would still have the same problem about converting a 5v to 3.3v going back into the Rpi GPIO pins, right?

Yes, that is right. --David