Raspberry Pi Pico W DMX Controller and DMX Quick Start for Beginners
by JanosN4 in Circuits > Raspberry Pi
1576 Views, 17 Favorites, 0 Comments
Raspberry Pi Pico W DMX Controller and DMX Quick Start for Beginners
This guide is aimed at beginners or beginners with DMX - who can also do a bit of soldering.
I am not a lighting professional but have spent dozens of hours on figuring out what's a good starter kit for lighting. I have tried different "budget" USB-DMX adapters as well as tried ESP32 based software. You can get a cheap USB-DMX adapter (eg. "USB to DMX Control Cable RS485 Serial Converter Adapter FTDI XLR 3Pin Stage Lighting Device Cable") and it's not a bad start, but then you'll find the inconvenience of running cables around from your PC or even notebook, especially if fixtures are further away. The other downside is most of these USB to DMX cables are "big-banging" type, and don't buffer output, so if the computer software starts lagging lights might flicker and I'm not fully sure the timings are perfect.
While wifi ArtNet to DMX would not really be good for professional environments with a lot of potential wifi interference and noise, it's great and convenient for home and hobby use. With wifi you can have your laptop anywhere too.
I spent dozens of hours looking around the net and constructing various gateways, also tried different ESP32 based ones but the Raspberry Pi Pico (W) has a great advantage of having PIO (programmable IO) which means it can do the DMX output signal timings really well. A good DMX signal must be sent with consistent timing and without gaps.
For the project, some soldering skills are needed but connections are minimal and easy to make..
This project builds on and remixes Taylor Mingo's great work on "ArtNet to DMX node", but remixing and reworking both hardware and software. The 3D enclosure is fully my work and I have also rewritten the original software.
Supplies
- For the DMX Controller (ArtNET DMX)
- Raspberry Pi Pico W
- RS485 adapter
- "RS485 Module MAX485 TTL RS-485 for Arduino, Raspberry PI"
- OR "RS485 module to TTL with Isolation Single Chip Microcontroller UART Serial Port"
- XLR 3-pin base
- "3 Pin Female XLR Socket Chassis Panel Mount 3 Pole Solder Connector Metal Nickel"
- SSD1306 display module (optional, but recommended)
- "0.96" OLED I2C White Blue SSD1306 Display Arduino"
- Micro-usb cable
- 3D printer for printed case OR make your own (not pictured)
- Arduino IDE 2+
- Some DMX fixtures. Some cheap ones I found and are good for a start are:
- NOTE! I recommend these to my best knowledge but I am not responsible if they are not the best quality. Personally I found these to be of good value and great for hobbist use
- ALIEN 8 LED RGBW 4IN1 DMX Wall Wash Lamp - around 20-25 EUR
- https://www.aliexpress.com/item/1005005065081848.html?spm=a2g0o.order_detail.order_detail_item.4.469cf19cOUmdYA
- Led 6/12x3w RGBW Stage Light Flat Scenic - around 20-25 EUR
- DMX Cable
- DMX Control Cable (3m or 5m)
- DMX Terminator
- Software
- QLC+ (Q Light Controller+) (Linux, Windows and macOS)
- Freestyler (Windows) https://www.freestylerdmx.be/
- DMX Control https://www.dmxcontrol.de/en/
- 3D enclosure
- Thingiverse: https://www.thingiverse.com/thing:6714974
Build the DMX Controller
First gather the components and print the 3D enclosure (Thingiverse: https://www.thingiverse.com/thing:6714974 )
If you don't have a 3D printer you can buy a generic transparent electric box and then you can cut openings with a drill or dremel tools.
Solder and connect the Pico W board to the OLED. Having the OLED display module is optional and you can actually get going without it but it looks nice and is recommended.
Connections:
- GP4 (I2C0 SDA) to SDA
- GP5 (I2C0 SCK) to SCL
- 3V3 to VCC
- Note that you will need to also connect this same 3V3 pin to the communication module too because there is only one 3V3 pin on the Pico W.
- GND (Pin 8) to GND
Connect the Pico W board to the RS485 module (you will need to reuse the same 3V3 pin for power supply). I have gone with a non-isolated RS485 module because it was more easily available but for DMX an isolated module is recommended. I think it's good enough for playing around, home or hobby use.
Connections:
- GPIO0 to TX on RS-485 adapter module
- 3V3 to VCC on adapter module
- GND (Pin 3) to GND on adapter module
And finally, connect the RS485 module GND/A+/B- to the DMX output socket as on the image. Be careful to run the wires through the opening before soldering so you don't end up with soldering done.
The build is based on "Powerful Art-Net to DMX Node With the Pi Pico" by Taylor Mingos ( https://www.techandtransit.com/lighting/pi-pico-artnet-to-dmx-node/ ) but I have changed it to use only one DMX port which was enough for me and it's also much simpler to start with. Technically you could add a second or third port easily, though software would also have to be modified slightly.
Upload Firmware
Get the source code from Github: https://github.com/john4242/artnet-pico-gateway
If you don't have Arduino IDE (2.3+) yet, download it from https://www.arduino.cc/en/software
You can plug in the Pi Pico W into the computer USB port. Open the Arduino IDE.
- Select Tools -> Board -> Raspberry Pi Pico W
- Use Tools -> Manage libraries and install the following libraries
- ArtnetWifi by Nathanaël Lécaudé, Stephan Ruloff (Tested with 1.6.1)
- Pico-DMX by Jostein (Tested with 3.1.0)
- Adafruit SSD1306 (Tested with 2.5.10)
- Adafruit GFX Library (Tested with 1.11.10)
- Adafruit BusIO (Tested with 1.16.1)
- (Optional) Go to Preferences and Show verbose output during [x] compile and [x] upload
- I like to set this so I can see progress better
- Open the source code by opening folder src/artnet-pico from the Arduino IDE
- Open the "config.h" tab to set your Wifi connection details. The Output A Universe is set to "universe 1", you can change this later if you need but best to leave it as 1 for start.
- #define WIFI_SSID "yourssid"
- #define WIFI_PASSWORD "yourpassword"
- #define OUTPUT_A_UNIVERSE 1
- (Optional) Press the verify (check mark) icon to compile the source and verify it compiles
- Press the Upload (right arrow) button to upload it
- Once it's uploaded and runs, you can open the Serial monitor (top right magnifier icon)
First Test (without Lights)
Once you have uploaded the firmware, you can start the Arduino serial monitor, you should see messages like this:
Connected to YourSSIDName
IP: 192.168.1.115
If you don't see these messages things might still be fine. There is no reset button on the Pi Pico, what I did is just unplug/plug the USB cable and start serial monitor again (quickly enough).
If you have the OLED display you can just check the status on that.
After this, you won't really see anything else until you start sending data with one of the DMX software.
When you do that you will see something like this on the serial monitor:
DMX: Univ: 1, Data Length: 512, Sequence: 191, Data: 24 136 0 85 0 0 0 0 186 66 0 0 0 0
Setup DMX Cables With Lights
LED light fixture setup
- This can vary based on your exact model, but you have to make sure to set DMX address 001 for it
- On my light this looks as "d001", on one of the pictures it's upside down when it looks like "I00P"
- There are 4 buttons, Menu,Up,Down,Enter
- Press the menu button multiple times until you get to the "d___" on the display (DMX address)
- With the up/down buttons make it "d001" which means "dmx address = 001"
- Press Enter to set. Don't touch led module after
- Some LED fixtures have DIP switches, please refer to the manual in that case
Cabling
- DMX controller (Raspberry Pi Pico W)
- Plug in the micro USB cable from a charger to give it power
- Plug in the XLR-3 DMX cable one end
- LED lamp
- Plug in the other end of the XLR-3 DMX cable other end into the input
- Terminator - don't forget to plug in the terminator into the module output. In the future you can chain multiple modules and terminator is only needed at the last one
In the future you can expand it to multiple fixtures and chain them up but to get started it's best to start with one and make sure it works.
Setup and Testing With QLC+
Q Light Controller Plus (QLC+) is a free and open source DMX light controller software which runs on Windows, macOS or Linux. You can download it from https://qlcplus.org/
I won't do a full walkthrough of QLC+ the aim is just to show you enough to test the DMX controller and the lights.
First, let's setup the ArtNet DMX controller network connection:
- Select "Inputs/Outputs" tab at the bottom and in the top right area and click ArtNet [x] Output for the line which is shows your local network IP address. For me this is "192.168.1.176" because my wifi router serves "192.168.1.x/24" network, but this might be different for you.
- While this device line is selected, also click on the "wrench" settings icon to check and set
- IP Address: this is 192.168.1.255 (network layer broadcast address). Usually this is x.y.z.255 if your network is a /24
- ArtNet Universe: set it to 1
- Transmission mode: Standard
Now let's add our light (fixture)
- Select "Fixtures" tab at the bottom
- Then the + sign at the top to add a new fixture
- Select Fixture model - Generic - Generic RGBW
- Mode = WRGB - Because our light has W (dim) in channel 1 and RGB are channels 2,3,4
- Address = 1 - this is the LED light's starting DMX address, because we set it to 001 on the light device
- You can set any name
- Press OK to add
At this point we have a DMX controller connection and a fixture defined, so we can go do "Simple Desk" tab at the bottom of the screen for immediate control.
- This gives you direct control of the channels and any changes are instantly sent to the controller and light
- Since we started from DMX channel 1 it's easy: push BOTH channel 1 and 2 to the max
- IMPORTANT: when you push W (channel 1) to the max, nothing happens. That is because it's only the dimming/intensity. You also need to then push one or all of R/G/B channel values up.
- You can play around and the light should react instantly!
If nothing happens, then you need to troubleshoot and make sure you did everything right.
- You can see these on the DMX controller
- Is the DMX controller connected to Wifi?
- Are the transmit leds blinking inside?
- On the computer, interface setting (QLC):
- Is the network setting correct?
- Are you on the same network, same subnet? Does broadcasting work (is broadcast address right)
- On the LED light device
- Are you sure you set the address correctly to 001?
- If it's a different light module than in my example, are you sure its channels are dimming (1), red (2), green (3), blue (4)
- Is cabling correct and connected?
- Have you added a terminator?
There are many great QLC+ tutorial videos on how to set up scenes and shows.
Setup and Testing With FreeStyler
Freestyler X2 is a free Windows software you can download from https://www.freestylerdmx.be/
After installation is complete, setup the DMX controller:
- Setup -> Freestyler setup
- Interface setup -> Universe 1
- Select type: Art-Net
- Two unlabeled above network adapter: these are the universes you want to send, set it to 1 and 2 (you'll only use 1)
- Network adapter: 192.168.1.176 (your your local network interface will be slightly different)
- Broadcast address: 192.168.1.255 (the local broadcast address, usually just replacing the last part of the network address with 255 if you're on a /24 network)
- Press Save
Setup the fixture:
- Setup -> Add/remove fixtures
- Select Generic -> RGBPSWITCH
- Press the [ > ] right arrow button to add
- Start at row: 1 (default)
- no. fixtures to add: 1 (default)
- DMX Universe: 1 (default, but make sure it's 1)
- DMX startaddress: 1 (it's 1 because we set the device address to 001 on the lamp)
- Add fixture to zone: 1 (default)
- Press Add
- You should see it on the right hand side in list of fixtures. Press Close.
Now let there be light!
- Click on the LED lamp fixture icon in the middle of the screen
- While it's selected, click on the Lamp and Color wheel icons on the top
- Make sure to slide and select BOTH the Lamp and the Color controls. Lamp window controls intensity, Colors is the RGB color you want
Setup and Testing With DMXControl
DMX Control 3 is a free light control software for Windows you can download from https://www.dmxcontrol.de/en/
I would say it has the steepest learning curve but it's very powerful and this was the one that had the most stable support for my cheap USB-DMX controller.
Setup the DMX Controller:
- Select tabbed window, top: DMX interfaces tab
- Select Non auto detect interfaces -> Artistic License -> Art-Net and press OK to add
- On the next screen
- Bind to: 192.168.1.176 (or whatever your local network interface is)
- Everything else as default should be fine, Send universe 2 should be 1 (we must be sure to send universe 1)
- You should see it appear in the DMX interfaces list
- Now here's a trick I needed to do, because otherwise my lamp was blinking (at a later step):
- Uncheck [ ] interface enabled
- Uncheck [ ] DMX-Out enabled from all but the first line
- Check the [x] interface enabled
- What this does is only enables Port 0 (universe 1) for sending and disables the rest. We don't need to send to the rest of the universes yet
Add the light fixture
- Select top tabbed window, Project Explorer tab
- Devices (left hand side tree)
- Press + Add device
- Device type on left hand side: Generic -> Generic dimmer + RGB, 8 bit
- Number of devices: 1
- Device name: any you like
- DMX start address: 1
- Press Add
- Now you should see this appear in the list of devices
Let's light it up!
- Select Stage view on the left hand side
- Select that black circle in the top left of the stage view window (click to select it)
- On the bottom, under Intensity, slide Dimmer to 100% (to up)
- Right to that is Color, choose any color
You should see the light instantly react and change color.
Troubleshooting
Some of the troubleshooting notes are mentioned in Setup and Testing With QLC+ step:
- You can see these on the DMX controller
- Is the DMX controller connected to Wifi?
- Are the transmit leds blinking inside?
- Double check all electric connections
- On the computer, interface setting (QLC):
- Is the network setting correct?
- Are you on the same network, same subnet? Does broadcasting work (is broadcast address right)
- On the LED light device
- Are you sure you set the address correctly to 001?
- If it's a different light module than in my example, are you sure its channels are dimming (1), red (2), green (3), blue (4)
- Is cabling correct and connected?
- Have you added a terminator?
Optionally you could buy a Logic analyzer for cheap on AliExpress/eBay "Logic Analyzer 24MHz 8 Channel 24M/seconds Logic Analyzer Debugger For ARM FPGA Logic Analyzer Logic 24M 8CH" and you can connect it to the Raspberry Pi output (not the DMX module output), TX and GND, then do a capture with a high enough rate, since DMX is 250 kbit/s I would say above 1 Msamples or better for more.