Servo Actuated PixelBlaze Spotlight

Hey everyone!

I’m new to the community, so hi!

I just received my PixelBlaze and I’m so happy with it!

I’m hoping I can synchronize the patterns to a set of two servos supporting a ring of LEDs to create a tiny moving spotlight. Similiar to these big ones you would see at a concert:

image

My plan is to use another microcontroller to read the output serial stream from the PixelBlaze like an Output Expander would and use that to control the position of the two servos.

Wish me luck!

  • Keenan
1 Like

Here’s the code for reference of an output expander. Should be pretty easy to port this to another microcontroller.

You might want to look at what @zranger1 did with his Processing code, which also reads the output of the PB, I believe.

Alternatively, the PB itself could power a few servos, so that you actually move as part of a pattern. Essentially you’d build a PB powered spotlight, and movement would be controlled directly by the PB, as well as the light

Thanks for the suggestion! I’ll check that out!

Yes my end goal is definitely to move the servos as part of the pattern. Unfortunately, since the PixelBlaze software isn’t open, I can’t modify it’s source directly to allow that. I hope to eventually create a custom attachment board for the PB like the sensor board that will have servo connections, read the data stream and allow the control.

@wizard, does PB expose enough of the pin control to do PWM ?

The C code that reads PB serial output, in versions for Windows, Linux and Arduino, lives here: https://github.com/zranger1/pbxTeleporterServers.

If you want to go this route, what I’d consider is dedicating one of the expander board’s channels to servo control, and setting fake “rgb” values for pixels in that range to the motor movement values you need. You can use the rest of the channels for LEDs as usual, and unless you’re doing a huge amount of calculation, motor control I/O won’t slow down your pattern at all.

Simpler to prototype would be having your motor controller use the Pixelblaze’s websockets API to periodically query a motor position variable in the pattern. If the amount of data being transferred is small, you can poll the Pixelblaze several times a second without visibly slowing pattern execution.

Not yet, I’ve been looking at that. There’s a number of ways to do it, and the PWM peripheral is one but adds a bit of complexity.

Thanks for the tips everyone!

@zranger1 I don’t see an arduino library in that link you posted? Was that a mis-communication or is it just hiding?

  • Keenan

It’s in the ESP8266 subdir – it’s actually written for the ESP using the Arduino IDE and library. The UART setup may be a bit different depending on which board you use, but the code that reads the data should work on most Arduino-like microcontrollers.