Using Vixen 3 with Arduino

XxFriction

New member
Hello there,
This is my first time using this website, I must admit, it is full of really awesome work.

but I have just started using vixen and I seem to have a lot of trouble,
basically I want to do the followings:

-Control a normal (one colored) LED connected to Arduino from Vixen 3 (completed).
-Control two Arduino boards at the same time from Vixen 3 (completed).
-Control RGB LED (the ones with 4 wires) from Vixen 3 (I can't figure out what code or vixen effect to use, only thing I can do is to control each pin independently, so I only have 6 colors possible, how do I fully control the RGB LED colors from vixen ?).
-Control WS2812B single LED or a complete strip from Vixen 3.
-Control a servo motor from Vixen.
-Control the speed of a DC water pump from Vixen.

I need a little guidance, maybe people have done these before, so if you know any thread or code that have these possibilities I would really appreciate if you point me towards them.
thank you so much.
 
Essentially you will be 'reading' channel values in your Arduino sketch, you can then decide what to do with those bytes. In all cases but a single LED, you don't want to be connecting devices directly to pins.

Control RGB LED (the ones with 4 wires) from Vixen 3 (I can't figure out what code or vixen effect to use, only thing I can do is to control each pin independently, so I only have 6 colors possible, how do I fully control the RGB LED colors from vixen ?).

There are a few options here. Ideally you want to make use of the PWM outputs which is available on some of the arduino pins (3, 5, 6, 9, 10), since this will allow dimming. So - connect via a logic-level MOSFET or similar. The MOSFET will also allow you to interface your 12V LED strip to the Arduino's 5V outputs. Basically you want to read three channels of serial data from Vixen (there are many examples online of how to do this, some better tha others), then analogwrite() this to 3 x PWM pins. You would add an RGB node in Vixen as if it was a pixel.So you can define any of 255x255x255 colours- you are absolutely not limited to the 6. Use the 'pulse' effect on a single RGB element - you can select any RGB color and also define how it changes over time.

WS2811 - there are lots of examples online reading serial data and using the FastLED library to control the LED strip

Servo motor - read channel of serial data then use a relevant arduino library to control your servo with the value (0->255)

DC water pump - probably best to use a motor shield for this, again you want to read the serial data from vixen and control the motor speed with the value of a channel. If you don't need speed control just use a relay and program this to be 'off' for 0->127 and 'on' for 128->255, say.

All this ie possible, it may need to be split across multiple boards on different COM ports. As an alternative to Serial ports, you might want to look into adding a network shield and using e1.31 streamed data from Vixen instead. It's more complex though and it sounds like you're fairly new to all this - so I'd start simple with the serial / multiple board approach.
 
Last edited:
This video shows how to control WS2811, and the sketch is one of the better ones/
https://youtu.be/oY6IoPM-sFY
Beware though there is an error in the section at 04:28 which discusses the 'header'. The sketch is expecting a leading zero so 30 pixels would read >>030<< not >>30<< as the video suggests.

You could easily adapt this sketch to do all the other operations you mention above, within the limits of what the board can support.

I should add that in Vixen you probably want to add a single colour element for the servo, water pump and single LED examples.A single element outputs one byte (0->255). As mentioned, for a length of 'dumb' RGB strip, you would add a single RGB element = 3 bytes. For WS2811, you add an RGB element for each pixel, so number of bytes is number of 'elements' x 3. You can mix single colour and RGB elements in the same display config.
 
Last edited:
Thank you so much for your helpful tips, I really appreciate your help,
So far I managed to control a WS2812B LED Strip completely, now the remaining ones are controlling both Servo and DC water pump,
I will work on this further and let you know if it works.

again, thank you so much.
 
Back
Top