Introduction: Two Wire (DMX) Interface With Screen and Buttons
DMX is a protocol used to control stage lighting fixtures and special effects. Each device has it's own channel(s) which it responds to. This channel is user selectable by a DIP switch or a display with buttons.
There are multiple ways to select an address but the most commonly used ones are with a DIP switch or with a display with buttons. When using a DIP switch you need 9 input pins (8 for the address and one for the mode).
An option that looks a bit better and gives you more options is by using a 7 segment display and some buttons. This method uses 12 pins for the display, 4 for the buttons and you might want some status leds as well. This means you have almost no pins left when using an arduino Uno / mini or something similar.
To solve this problem I designed a module which uses a digital interface to control a 4 digit 7-segment display, 4 buttons and 3 status leds and only uses 2 digital pins and 2 pins for 5V and Ground. Besides you save pins this module is digital as well, this means you can tell it what to display and the module will remember. The module takes care of dimming the display as well.
Of course this module can be used for everything you want and is not limited to use with a DMX fixture!
Step 1: What You Need
The main part of this module is a TM1637 which is a module for driving leds. With a microcontroller like an Arduino you can send bytes to tell which leds to turn on. This module can also dim the leds with a PWM signal. It is not possible to dim leds separately. All components are placed on a custom PCB but you can use a breadboard or protoboard as well.
If you want to make the product as the picture this is what you'll need:
1 x PCB for the interface module https://www.pcbway.com/setinvite.aspx?inviteid=993...
If you use this link you get your first 10 pcb's for free and you support my new projects.
1 x 0.56" 4 digit display (red) common anode 12 pins https://www.aliexpress.com/item/2PCS-0-56-4-Digit-...
1 x TM1637 DIP https://www.aliexpress.com/item/Si-Tai-SH-TM1637-D...
1 x pinheader straight or 90 degrees (4 pins) https://www.aliexpress.com/item/10Pcs-Lot-40-Pin-2...
3 x 3mm led, red , orange and green. https://www.aliexpress.com/item/5Colors-20PCS-100P...
4 x tactile pushbutton 2 pins https://www.aliexpress.com/item/20Pcs-Middle-2-pin...
besides the parts you need some common tools for assembling:
- soldering iron
- solder with flux
- plier to cut the leads
Step 2: Get the PCB
The aegle files and gerber files are included in this step. I ordered my PCBs here:
With this link you can get your first design for 10 pcb's for free to try, you help me as well because I get a litlle discount when you use this link to order.
The gerber files are created by PCBways and turned out pretty well. I ordered 10 pieces with a blue color and white text.
Instead of using a PCB you can solder all parts to a protoboard as well.
Step 3: Assembly
Assembling this module is not hard at all if you have some soldering skills. First break away 4 pins from the pinheader strip if you didn't already. Solder them in place next, I started with the pinheaders because they tend to fall out when upside down. Next I soldered the LEDs, the short lead (negative side) is on the right side, which is marked, new version of the PCB will have a - sign. After the LEDs I soldered the 4 tactile buttons, than the TM1637 chip. Pin 1 is on the top left and is marked with a dot. The last part I soldered is the display, the holes are pretty tight so it will take some time.
After all the parts are soldered in place, I trimmed all the leads and checked for errors.
Step 4: Testing and Code
After you finished assembling it is time to test the module. Connect the 5V to the microcontrollers 5V, GND to GND. The CLK and DIO pins can be defined in the software but defaults are pin 2 for CLK and pin 3 for DIO.
Download the code and upload it to your Arduino. This code might work on other microcontrollers as well but is not tested yet.
The Arduino code is configured to update the screen and read the buttons every 200ms. This is done so the CPU can be used for other tasks. Changing the address is done using the up and down button, the address will automatically be saved after 2 seconds. The address is stored in the EEPROM and is loaded in the setup. The address is kept in the EEPROM even when the power is disconnected.
The status leds can be controlled by sending a byte to the module for the 8 leds. At the PCB only 3 leds are connected but the code allows for 8. The code will be improved in the future to maken turning leds on and off easier.
The buttons are connected as a keypad matrix and a maximum of 16 buttons can be used. multipress is not supported at the moment but this might be added in the future if possible.
At the moment I'm working on a library to make using this interface module even easier but this might take a while.
Step 5: Improvements to Make
After I ordered and tested the PCB I found some small improvements, if you have some improvements or bugs please leave them in the comments. Please explain it as well because I like to learn how I can improve my projects!
At the moment this are the improvements I'm working on:
- Adding a small capacitor to the board for voltage stabilisation
- Adding a sign for the led polarity
- Using larger holes for the display
- Writing a libary for the code to make using it easier
- Writing code for turning on and off leds easier
I entered the make it glow contest with this instructable, if you like it I please vote for me :)
Sometimes I have PCB's laying around, if you want a bare PCB I Sell them for €4,- a piece. I have some finished ones as well which you can buy for €10. shipping cost are not included (ships from the Netherlands). Send me a message if you want one, I might have some laying around!
Participated in the
Make it Glow Contest 2018