Introduction: Smart World Map With Data Screens and DMX Programmable Lighting

Our non-profit serves in many parts of the world but like any non-profits, the needs far outstrip the resources. We became interested in a way to create awareness of global need in different parts of the world as well as inform about work we were doing in various countries. We wanted an educational tool to inspire, inform, awe and motivate. The resulting idea was birthed!

The smart map is about 14 feet long and CNC cut from 1/2" MDF, illuminated by a series of inexpensive DMX stage lights, and controlled by three inexpensive PCs. Those three computers control three distinct functionalities of the map:

  1. The upper LCD screen is controlled by one PC and displays the heading video
  2. The lower LCD screen is controlled by the lower PC and displays the content video of equal length
  3. The third PC controls the QLight + DMX lighting software.

All three computers are then synchronized through three arduino nanos which communicate with one another over i2c bus to create seamless, beautiful, perfectly timed transitions. About one hundred videos are played in random, non-repeatable order. Once the videos are displayed the videos are shuffled and then start again. The content of the Smart Map is pulled from a simple Dropbox folder. Drop a video in the specified folder and it will be automatically added into the mix on the next cycle! It's a simple, elegant way to keep the content fresh and engaging.

The map is controlled via a smart phone, runs on a schedule and has received great feedback. We are thrilled with the result and happy to share the idea with the Instructibles community. The secondary benefit for me personally is that I document what I did in the most certain case that six months down the road I'll forget how the thing works!

Supplies

  1. A few stationary DMX Lights. In my case 12 was the right number. Mini Sound Activate DMX Control 12 LED RGBW
  2. A couple moving head DMX spot lights
  3. A couple of moving head wash lights.
  4. Three arduino nanos purchased on ebay.
  5. Aideepen 5pcs Nano Screw Terminal Adapter Shield Expansion Board Nano V3.0 AVR ATMEGA328P-AU Module for Arduino

  6. Three computers. I chose these, but any would do. Mini PC Windows 10 pro, Beelink J45 Intel Apollo Lake J4205 Processor 8GB/128GB SSD
  7. Enttec USB DMX controller
  8. A fistful of Noiseblocker fans. NB-BlackSilentFan XM1 40mmx10mm

  9. Two low profile LCD TV's. Samsung UN65LS03NAFXZA Flat 65” LED 4K UHD These were the most expensive component of the project by far. Cheaper displays could have been selected but the low profile nature of these displays were important for the aesthetic as well as clutter free wiring on a brick wall.

Step 1: Build Challenges and Feature Requirements

This project is admittedly complicated and I'd love to hear of simpler solutions but our particular build requirement had several features that drove us to these more complicated solutions. We needed the following feature set:

  1. Completely automated. No human intervention to start or stop the map.
  2. Dual screens. Both top and bottom screens need to be synced and have no evidence of transition between videos (this is harder to do than it first seems).
  3. Runs on a schedule. We wanted the map to be able to turn on and off based on a schedule.
  4. Dropbox compatible. Updates to the map need to be done remotely by simply managing a dropbox folder which contains the videos
  5. Uses Open Source or Freeware. We were on a limited budget for software so the solutions needed to be open source or free.

Our solution utilizes autohotkey, python, arduino c++ as well as q light controller plus dmx software. The solution is rock solid, robust, reliable and has worked flawlessly. We love the result!

Step 2: Prepare the Wall and Map

We selected a wall that would create interest as a background against our white map. Additionally, the lights can not not perfectly match the country profiles so the brick functioned as a medium to absorb light that spills off the edge of the map. This turned out to be both aesthetically pleasing and effective!

This project does not require any special kind of map. It could be painted, a poster board, conceptual artwork, etc. In our case we wanted it to have dimension and a bit of relief off the wall so we chose 1/2" MDF CNC machined to specifications and then shimmed 1/4 inch off the wall with 1/4" MDF standoff strips . The overall cost of materials was exceptionally reasonable and we were very pleased with the result!

Original source files for the map are attached and included. Source files are in *.3dm format which is a Rhino3d format.

Step 3: Prime, Paint and Hang

In our case, the map needed priming before painting. We actually loved the color and texture of the primer so we ended up not painting the map at all and left it up primer white. Great! Saved us some work and a step! To attach the primed map pieces to the brick wall, we used a vertical adhesive made for attaching stone or tile to vertical surfaces. The stuff is surprisingly tacky and does a phenomenal job of adhering even the large heavy land masses to the wall. To position the pieces correctly we used a projector to cast the original image and align the pieces. Simply press the pieces to the wall, wait about 8 seconds and they are secure!

Step 4: Install the Monitors

For screens we chose the Samsung UN65LS03NAFXZA Flat 65” LED 4K UHD. There are several features which make this particular screen especially exceptional for the project at hand:

  1. Flush mount against the wall. The bracket itself is designed to consume no more than a 1/4 inch.
  2. Low Profile TV. A low profile TV keeps the overall aesthetic consistent. In other words the thickness of the map and the thickness of the TV are identical.
  3. Minimal cord mess. Since this was being mounted on a brick wall we could not easily route the cords through the wall. All power, data, and communication cords go through a tiny wire no large than a thin piece of spaghetti. It really is impressive!
  4. Proximity of inputs to PCs. The HDMI input satellite box could be located near our PC's for minimal cord length, improved data transmission and lower cost in cabling.

We were very impressed with these high quality, albeit expensive TV's!

Step 5: Architecture and Software Flow

Architecture:

Here is a diagram of how the system works at a big picture level. I'll walk through the relevant code blocks and key them to the diagram above. Full source code is available here: https://github.com/jdwolin/DMX-Smart-Map

1. The program chain begins with the the Master.ahk script. First it draws a black box to hide any windows elements that might want to get in the way. Between videos you will see nothing but black (this black box). It also hides the pesky mouse.

<p>Gui, Color, black
Gui -Caption
Gui, Show, x0 y0 w3840 h2160
SystemCursor(0)
WinHide, ahk_class Shell_TrayWnd
WinHide, Start ahk_class Button,
existtest := 1</p>

Next we need to randomize the *mp4 video files in the folder and create an array of names. The beginning of the code block looks like this (see full code for this example idea built out).

<p>Loop Files, C:\Users\Missions Main\Dropbox\FCBC Missions Map\Videos\Live\*.mp4  ; Recurse into subfolders.<br>{
 NumberArrayIndexer++ ; array index object
 FileArray.Push(A_LoopFileName) ; populate the array with filenames a_loopfile
 NumberArray.Push(NumberArrayIndexer) ; fill up the array with non zeros.
}</p>

Before we leave this script autohotkey fires ffplay.exe which plays this selected video on the attached monitor.

<p>RunWait, cmd /c ffplay "%userprofile%\Dropbox\FCBC Missions Map\Videos\Live\%testelement%" -fs -autoexit, , hide  </p>

2. One of the *mp4 files is selected at random. Now we need to send this filename to the other PC's. This is the function of the arduino nanos. We begin this process by sending the selected *.mp4 video filename to a python script. This python script will communicate over RS232 to the first nano. Here's the relevant part of the master.py script. As you can see, a serial port is opened and we wait for the arduino to reply.

<p>serPort = "COM3"<br>baudRate = 9600
ser = serial.Serial(serPort, baudRate)
print ("Serial port " + serPort + " opened  Baudrate " + str(baudRate))
startMarker = 60
endMarker = 62
waitForArduino()
testData = []
testData.append("<" + filename + ">")
runTest(testData)
ser.close</p>

3. Once the arduino replies we send it the filename of the first video we want to display. This is the function runTest(testData). Great function name, I know.

4. Now a chain reaction occurs where that file name is then to sent to the other Arduino Nanos over i2C using the popular Wire.h library. Such a great library for easy, quick communication between arduinos!

void loop() {
int val = digitalRead(headingpin);  
if (val == HIGH) {   
getDataFromPC();   
replyToPC(); } }

Each of the arduinos runs a loop similar to this one. Basically they are listening for a HIGH on an datapin and if they detect that it forward the information on to the next Nano.

5. Heading.py takes the video name off the RS232 serial stream and uses ffplay to play the heading video. The heading video is in a different folder than the main video but has the exact same name.

<p>if waitingForReply == True:</p><p>            while ser.inWaiting() == 0:
                pass
            
            dataRecvd = recvFromArduino()
            path = "C:\\Users\\Missions Map Top\\Dropbox\\FCBC Missions Map\\Videos\\Headings\\" + dataRecvd + ".mp4"
        
            os.chdir('C://Users/Missions Map Top/Dropbox/FCBC Missions Map/')
            print(path)
            subprocess.call(['ffplay', path, '-fs', '-autoexit'])</p>

6 and b. Heading.ahk is used only to draw a black screen and turn off the mouse similar to master.ahk. The triggering of actual videos happens through the python script above.

7. In a similar way the Lighting.py receives the filename of the video being processed. This time the script pulls from a folder, not with a video file, but a text file that contains a hotkey (ie. the text file might contain ^1 which in autohotkey land is ctrl+1.

8. Lighting.ahk executes that hotkey which is keyed to a lighting scene.

In this way the script cycles through all the videos in the original file array. Once the file array has been completed, the deck is shuffled and the whole thing starts again!

Full source code is available here: https://github.com/jdwolin/DMX-Smart-Map

Let's take a deeper look into the lighting setup as this might require some additional explanation.

Step 6: QLC+ DMX Lighting Control Software and Enttec

Download the QLC+ DMX Lighting Control Software and connect to ENTTEC USB controller and familiarize yourself with the software and how the software works. Here are the key things to understand for the purpose of this project.

Physical Lighting Setup:

The physical setup requires a computer PC running the QLC+ lighting software. Out of one of the USB ports of the PC you will connect the ENTTEC DMX controller. From there you will daisy chain each of the DMX lights used in your setup. The ENTTEC DMX controller is a 5 pin DMX device and 99 percent of DMX fixtures on the market today are 3 pin devices so you will need a 5 pin to 3 pin converter like the one sold here. Once you get your chain setup correctly (PC -> ENTTEC -> DMX Lighting string) you can begin the software setup

Wiring will get messy quick so we opted for a cutom built light bar that hides the mess. You can see all the wires buried in this custom build plywood channel. All excess DMX cable as well as power cable and power strip are neatly contained.

Fixture Definition:

DMX works by physically setting the address of each of your lights (aka fixtures) and then assigning those physical addresses to the software itself. Most lights have up and down arrows along with a screen so you can physically set this address. So for example, the first light might be a 4 channel fixture. Each of those channels controls one aspect of the light (ie. Red, Green, Blue and White). So we would assign light #1 to channel #1 which would take 4 channels. Given that the first 4 channels are taken by this first fixture our second light should be physically set to channel #5. More complicated lights can be dozens even hundreds of channels depending on the complexity so you need to know how many channels each fixture consumes. You can see how our fixtures are listed in the software. Our first six channel light begins at address #5. Using the up and down arrows on the light we set it arbitrarily to #5 as our first address (It could have just as easily been #1 or #20 or anything else we choose). We then sequentially added our lights after that. Both our motion head lights are 14 channel lights which you can see reflected in the setup as well.

Scene Creation:

The fixtures, once defined, are used to create scenes. Scenes are simply combinations of lights that are grouped together to create a certain look. In our case we might create a scene called India that turns the map a gradient blue and then positions the spotlight on the country itself. We create a button in the 'virtual console' tab at the bottom and then assign a hotkey (i.e. ctrl + i) to this scene. Now any time we press that hotkey it recalls this India scene! This functionality will be used to sync the video content with the lighting scenes as described in the previous step.

Once the master.ahk is executed the whole thing begins to operate. It's quite fun to watch!

Step 7: Automation and Get Creative

The final step was to automate the whole project. The easiest idea here was simply to use cheap wireless outlets.

Using the gosund outlet we setup the bios so that when power is detected the computers turn on automatically. Using the connected gosund app we can now schedule a start time we'd like the map to turn on. A few steps are necessary to ensure automation after that.

  1. Remove windows passwords on PC's so that they boot to the desktop without need for user intervention
  2. Add autohotkey and python scripts to startup menu. This is done by typing "run" in the start menu. Now type "shell:startup" This will open a folder into which you can drag any programs you'd like to launch on startup.
  3. Use task schedule to shut the system down.

One random side note before we sign off. We found the DMX fans in the lighting to be extremely loud and annoying. We ended up replacing all of them with NSB quiet fans. This involved tearing down the lights resoldering fans and reassembling (read: total pain). It was a big project but worth it for the quieter setup. This is just a fair warning for those who might spring at the cheap Chinese dmx lighting units. I have no idea if more expensive lighting units are quieter, but I can testify to the ear grating annoyance of the fans I have listed here.

Hopefully this stimulates ideas for an interactive, educational, inspirational map that you can use in your environment. We loved creating this project and would love to hear other ideas, similar projects or feedback on how we can improve!

Thanks for taking a look.

Maps Challenge

Second Prize in the
Maps Challenge