DMX Receiver + OLED Display + Rotary Encoder

Hi all,

For a project I’d like a Arduino (preferably nano) to be able to do the following things:

  1. Read DMX value from specific DMX-address (using RS485).
  2. Convert read DMX value and output it as PWM (which later on will be converted to 0-10V to drive a VFD)
  3. Create a simple menu on a 128x64 OLED I2C display, controlled by a rotary encoder with switch, to be abled to change the DMX address (and for the below)
  4. (optionally), create a ‘standalone’ mode where the ‘device’ can work without receiving DMX. In this mode, the PWM output can be controlled manually by a percentage or slider on the menu (using the rotary encoder).

Ok, first things first. I think it’s advice-able to approach this project in smaller pieces, so to make each point work in it’s own before blending it all together.

(1.) Therefore, I’d like to try the link below (ArDMX) as soon as my ordered RS485’s come in to make part 1 working.

(2.) This shouldn’t be to hard and is mostly already captured in the link from #1. As soon as my PWM–>0-10V converter comes in I’ll give the electronics a try on this part.

(3.) This is where it gets harder for me. I’ve been searching for good code examples/tutorials on how to easily program simple menus but haven’t found anything usable yet. Also, reading of the rot. enc. isn’t going so smoothly currently, a really lot of bouncing and ghosting is going on.
Do any of you guys have good examples or thoughts about how to achieve a simple menu, I’ve put a small example/mockup of how I’d like the menu to be in the attachments of this post.
Furthermore, the DMX address to have a look at is being defined before the setup void in the ArDMX example. Would it even be possible to change the address by using the menu? Would this always require a reboot before it becomes active?

(4.) This one is optional and might only be interesting later on. On the other hand is this a nice way to test #2.

For now, I’m curious if any of you can help me with #3, later on I’ll let you know how the other points are going (when the hardware is delivered).
Maybe someone has some example of how to easily make small menus, combined with a rotary encoder?

Thanks in advance!

Small extra question:
Would it even be possible to read the DMX data (using the externals MAX RS485) ánd outputting data to the OLED using i2c? I’d like to this with a regular Arduino Nano, due to it’s low price and small footprint.
Wouldn’t the two serial data connections give problems?

Thanks in advance!

You should be fine using a Nano with DMX as long as your not using Serial. If you want to read/write DMX and use Serial then I would suggest the Pro Micro 32U4 like this. I have successfully used this exact module in a couple of DMX projects.
I have never used the ArDMX code as I prefer the DMXSerial library because it works with the Leonardo (Pro Micro) but it should be fine reading DMX from the UART and displaying data on an I2C display.

Let the code read an entire universe of DMX data and just pick out the channel you need. To keep to DMX timing rules you have to read at least 23 channels anyway so less messing about if you just read all 512 (assuming the sender is sending them all).

Hi Riva, thanks for your reply.

If I understand you correctly, it should be possible to use a Nano and use it for:

  1. Read DMX values (using the DMXSerial library)
  2. Display data on an I2C display

Correct? Or should i really need a Pro Micro for this?

Thanks in advance!

If I understand you correctly, it should be possible to use a Nano and use it for:

  1. Read DMX values (using the DMXSerial library)
  2. Display data on an I2C display

Correct? Or should i really need a Pro Micro for this?

Yes, your fine with using a Nano but be aware the DMX will be using the same serial pins as you use to connect to a PC over USB to program/debug with (unless your programming using an ISP programmer) so you may need to disconnect DMX hardware to program over USB.

Hi all,

Who can help me setting up the menu? I'm struggling with it.

What the menu should contain is:
Main page (showing current speed and direction (optionally also current dmx address))
--> click brings up two options: "Set DMX Address" & "Mode"

When "Set DMX Address" is clicked, the current DMX address (1-512) should be displayed, and the user can change it by rotating the encoder. Confirm with a click (which brings you back to the main page).

When "Mode" is clicked, the user can select either "Manual" or "DMX". When "Manual" is selected, the user should be able to set some parameter to a value and optionally also the direction.

I've tried to use the example provided here:

This looks like a really nice menu.

This obviously doesn't work with my I2C display, so i've changed the display setup from:

//U8G2_SH1106_128X64_VCOMH0_1_4W_HW_SPI u8g2(U8G2_R0, 10, 8); //Original code


U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);   // All Boards without Reset of the Display

Unfortunately this one gave some undefined pixels in the bottom of the screen and only showed the main screen (did see some small movement on the 'slider bar' however when rotating the rotary encoder, but it didn't go to a completely other screen/page).
Therefore I've also tried it with this setup line:

//U8G2_SSD1306_128X64_ALT0_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);   // same as the NONAME variant, but may solve the "every 2nd line skipped" problem

But this gave even worse results (no display at all).

Another problem is that this code already used a lot of memory, which is not ideal as the DMX part is not in yet.

Can anyone help me in writing the correct code for this display (and ultimately also the rest) to get to work?

Thanks in advance!