Script to send digital outputs from maestro 24-channel

Hi guys,

I am a complete newbie to robotics. I need to control four RC servos and also send some 3 to 4 digital outputs from Pololu 24-channel Maestro to a solenoid, another Pololu 24-channel Maestro and perhaps two LED indicators. My program would look like this:

  1. On power-up all 4 servos go to zero position (1500um)
  2. Read digital input from switch 1 (enable the device)
  3. Send digital (analog?) output to LED indicator (indicating that the device is enabled)
  4. Read digital input (output from antother Pololu 24-channel Maestro) or read digital input from switch 2 (start sequence A) or switch 3 (start sequence B) or switch 4 (reset the program execution to start from line 1)
  5. Perform sequence A, B or C. Within sequence A and B I want to send digital (analog?) output to solenoid (12VDC)
  6. Send digital (analog?) output to another Pololu 24-channel Maestro to start the above program on that maestro

I learned how to write the script to run the servos and read inputs from switches and do the ifs, etc. but I am not able to send outputs. I just dont know how the script might look like. I read the manual but it is not clear for me.

Any suggestions? A simple script on how to send an output to a solenoid and to another Maestro would be greatly appreciated.

Hello,

The command for setting a digital output (for an Output channel) is basically the same as that for setting a servo position (for a Servo channel). As the Channel Settings section of the user’s guide explains, a position value lower than 1500 us (which is 6000 for the command parameter) means a low output (0 V), while anything else means high (VCC).

To use a digital output from one Maestro to trigger something on another Maestro, you could have the second Maestro spin in a loop, doing nothing, until it detects a high signal on the right input.

- Kevin

Thank you. I will try that.

Hi Kevin,

I tried the outputs according to your advice and it works OK for LED’s. I’ve got another question. What output voltage can you get on the output? I need to hook it up to a micro relay which in turn would energise a 12VDC solenoid. I need to know what coil voltage of the relay I should order.

Hello,

The Maestro’s outputs are at 5V, but they are not appropriate for driving a relay directly. You will need to use a transistor or something to drive the relay, and you might as well use that transistor to drive the solenoid directly. You could use our RC Switchwith Medium Low-Side MOSFET, which converts servo pulses directly to a 15A output.

-Paul

Hi,

While you’re on this subject, I’m looking to drive relays directly from a transistor. Please pardon my ignorance but what type of transistor can I use? And how do I connect the pins?

I’m looking to drive a few 12v relays on different channels of the Maestro off an external 12v power supply but how do I connect them? which pin goes where? Can I use the same external power supply to connect up all the relays with a common ground?

Any help will be greatly appreciated! Thanks!

XssX

Hello,

I just noticed that I never replied to your last post. Sorry!

Lots of kinds of transistors can be used to drive a relay, but you need to know what you are doing. I would search Google for something like “relay driver circuit”, since lots of people have explanations that are better than what I can provide. The easiest circuits will be the ones that use an N-channel MOSFET. Let me also say again that there is no point in using a relay to drive a solenoid, since you can just drive the solenoid directly with your MOSFET. If you do not know how to build the circuit yourself, I still highly recommend getting our RC Switch with Medium Low-Side MOSFET.

-Paul