Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| hardware:diy_zedmd [2024/04/24 19:49] – [Step 2 : plug the hardware] nadenislamarre | hardware:diy_zedmd [2026/01/30 08:13] (current) – nadenislamarre | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | In this article, we will create a custom DMD. | + | In this article, we will help you create a custom DMD to use with Batocera. We are using ZeDMD as a basis as it's a cost-effective yet powerful solution, and now fully supported on Batocera 40+. |
| - | ===== The result ===== | + | ===== First, the final result ===== |
| {{: | {{: | ||
| {{: | {{: | ||
| - | ===== Step 1 : buy the hardware ===== | + | {{: |
| - | The list : | + | {{: |
| - | * 2 dmd pannels | + | |
| - | * 1 esp32 and its shield [[https:// | + | ===== Step 1 : purchase |
| - | * 16 male/male 10cm jumpers [[https:// | + | The shopping |
| - | * 1 power supply [[https:// | + | * 2 DMD panels |
| - | * 1 plug [[https:// | + | * 1 ESP32 and its shield [[https:// |
| + | * 16 male/male 10cm jumpers [[https:// | ||
| + | * 1 power supply [[https:// | ||
| + | * 1 plug [[https:// | ||
| You probably already have a plug at home. | You probably already have a plug at home. | ||
| - | Total price including shipping : 39€ (on 2024 april 8). | + | |
| + | Total cost including shipping: 39€ (on 2024 April 8). | ||
| {{: | {{: | ||
| - | ===== Step 2 : plug the hardware ===== | + | ===== Step 2 : Put the hardware |
| === Step 2.0 - external links === | === Step 2.0 - external links === | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | The original tutorials are not related to batocera.linux, | ||
| + | |||
| + | The hardware part is the same for Batocera. However, the course of action for software configuration at the end is a little bit different. | ||
| + | |||
| + | === Step 2.1 - Getting a power supply (for HD matrix) === | ||
| + | |||
| + | Based on the display being used, some pixels may be too bright (causing glare and artifacts) or too dark (not visible), so it is useful to have a power supply with adjustable voltage. A power supply with universal terminals and an adjustable voltage is preferred, with the ability to use voltages near 5 volts at 2 amps. The more finely you can tune the voltage the better for adjustment. | ||
| + | |||
| + | {{: | ||
| + | {{: | ||
| + | |||
| + | It's also possible to get a static power supply voltage and then reduce its voltage by use of diodes (be careful of heat if only using a small amount of diodes): https:// | ||
| + | |||
| + | == Cut your own power wire === | ||
| + | |||
| + | As an alternative to using a wall-wart power supply as pictured above, it is possible to splice a regular high-voltage power cable and connect that to a switch-mode power supply. | ||
| - | The original tutorials are not related | + | <WRAP center round alert> |
| - | The hardware part is the same for batocera. Just configuration actions/software at the end changes. | + | Incorrect wiring with power lines up to 240V can result in death by electrocution, exercise caution if choosing |
| + | </WRAP> | ||
| - | === Step 2.1 - Cut and prepare the power wire === | ||
| {{: | {{: | ||
| {{: | {{: | ||
| + | {{: | ||
| + | {{: | ||
| - | === Step 2.2 - Plug matrices together with data and power wire === | + | === Step 2.2 - Plug LED matrices together with data and power wires === |
| - | The data and power wire for the matrices are delivered | + | |
| + | The data and power wires for the matrices are usually bundled | ||
| Just plug them. Note that white arrows must go from left to right. | Just plug them. Note that white arrows must go from left to right. | ||
| {{: | {{: | ||
| {{: | {{: | ||
| - | |||
| {{: | {{: | ||
| - | === Step 2.2 - Plug the power === | + | === Step 2.2 - Plug the AC/DC power converter |
| - | Plug the 220V power on the AC. Take care of colors. Phase (brown) | + | Plug the 220V power on the AC (if you live in a 110V country, make sure you have the right AC/DC converter, and obviously the right plug). **Be careful** with the polarity |
| - | Plug the 5V. Take care of colors. | + | Plug the 5V connector, and make sure you connect the correct polarity. |
| - | The orange screw on right can be used to adjust the 5V voltage. It is usefully | + | The orange screw on right of the AC/DC converter |
| - | Too much voltage | + | |
| {{: | {{: | ||
| - | |||
| {{: | {{: | ||
| - | {{: | + | {{: |
| + | |||
| + | **Note**: If you build a 32x128 DMD (**not** a "DMD HD" with a higher resolution), | ||
| + | |||
| + | To do so, you need to connect the red power wire from the LCD panel to the VIN pin on the ESP32 (5V) and the black wire to the GND pin (ground). | ||
| === Step 2.3 - Microcontroller === | === Step 2.3 - Microcontroller === | ||
| {{: | {{: | ||
| - | Plug the esp32 in its socket. | + | Insert |
| - | Before | + | Before |
| < | < | ||
| ls / | ls / | ||
| </ | </ | ||
| - | The result can be an error (no such file or directory) or a list of files (/ | + | The result can be an error ('' |
| - | Plug it on a computer | + | Now, plug the ESP32 USB-C connecter to a USB port on that computer. |
| - | Rerun the command | + | Run the '' |
| < | < | ||
| Line 74: | Line 100: | ||
| </ | </ | ||
| - | in general, you'll get the error "no such file" | + | As a general |
| - | This mean that the esp32 can now be identified as file / | + | |
| - | In case you had / | + | In case you had a '' |
| - | Execute the following command | + | Execute the following command, and don't forget |
| + | **For Batocera 42 and later** (ZeDMD version 5.x.x required) | ||
| + | < | ||
| + | wget https:// | ||
| + | unzip ZeDMD-128x32.zip | ||
| + | wget https:// | ||
| + | unzip esptool-v4.8.1-linux-amd64.zip | ||
| + | chmod a+x ./ | ||
| + | ./ | ||
| + | </ | ||
| + | |||
| + | **For Batocera 41 and earlier** (ZeDMD version 3.x.x required) | ||
| < | < | ||
| wget https:// | wget https:// | ||
| Line 90: | Line 126: | ||
| </ | </ | ||
| - | The first line downloads the zedmd firmware for 128x32 matrix. | + | The first line downloads the ZeDMD firmware for a 128x32 matrix. |
| + | Note that batocera 42 requires ZeDMD 5.1.5 or over. And previous versions of batocera requires versions before 5.x. | ||
| - | The second line unzip it. | + | The second line unzips |
| - | The 3rd line downloads the tool used to flash the firmware. | + | The 3rd line downloads the tool we are going to use to flash the firmware |
| - | The 4th line unzip the tool. | + | The 4th line unzips that tool. |
| - | Th 5th line make the tool executable. | + | Th 5th line makes the tool executable. |
| - | The last line flash the firmware on the device / | + | The last line flashes |
| {{: | {{: | ||
| === Step 2.4 - Plug the microcontroller === | === Step 2.4 - Plug the microcontroller === | ||
| - | Check that your esp32 is the 30 pins model (by counting the number of pins). | + | Check that your ESP32 is the 30-pin model (by counting the number of pins). There are several models, some with another number of pins, but this one seems to be the most common. |
| - | Now, you must plug the data wire to the esp32 by respecting the pin codes as in the following images. | + | Now, you must plug the data wire to the ESP32 by respecting the pin codes as described |
| {{: | {{: | ||
| Line 113: | Line 150: | ||
| {{: | {{: | ||
| - | There are 15 pins to plug. | + | {{: |
| - | The pin E can be ommited. | + | There are 15 pins to plug in total. |
| - | The pin LAT is the pin STROBE. | + | The pin E can be omitted. |
| - | Example : plug a pin in the data cable on G1. G1 pin corresponds to pin io 26. Thus on the esp32 side, plug it in the io 26. | + | The pin called LAT is the pin STROBE. |
| + | |||
| + | Example : plug a pin in the data cable on G1. G1 pin corresponds to pin IO26. Thus on the ESP32 side, plug it in the IO26. | ||
| {{: | {{: | ||
| + | |||
| + | **Note**: if you don't use a dedicated power supply, plug the red wire from the LCD panel to the VIN pin of the ESP32 (+5V) and the black wire to the GRD pin (ground). | ||
| === Step 2.5 - Final assembling === | === Step 2.5 - Final assembling === | ||
| Line 130: | Line 171: | ||
| === Step 2.5 - First boot === | === Step 2.5 - First boot === | ||
| - | Plug the power. You should see the ZEDMD logo and the version. | + | Plug your DMD the power wall socket. You should see the ZeDMD logo and the version. |
| - | The logo may be not perfect as you can see on this picture. | + | The logo may be not perfect, as you can see on this picture, but no panic this is an easy fix: adjust the voltage to a slightly lower value to make it nicer (the orange screw on the power supply as explained at the beginning of this page). |
| - | Adjust the voltage to the lower value to make it nicer (the orange screw on the power supply). | + | {{: |
| - | === Step 2.6 - batocera.linux configuration === | + | ===== Step 3 - Batocera.linux |
| - | Plug with the usb c cable to the batocera | + | Plug your DMD with the USB-C cable to the Batocera |
| - | Go in menu > système | + | Go in **MAIN MENU** -> **SYSTEM SETTINGS** -> **SERVICES** |
| - | Move in the menu (change | + | Get back to the main menu, and switch to a different |
| {{: | {{: | ||
| - | ===== Step 3 : finalize the dmd hardware ===== | + | ===== Step 4 : finalize the DMD hardware ===== |
| + | |||
| + | Make sure you steadily lock the LED matrices, and if you're handy enough, make a nice case to wrap things up. | ||
| {{: | {{: | ||
| + | |||
| + | Create a case as you can. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ===== ZeDMD configuration ===== | ||
| + | If you've ZeDMD 5.x or higher (on batocera 42 or higher), by default, the rendering is not smooth. | ||
| + | You need to configure the minimal refresh rate and the USB package size via the command line tool zedmd-client. | ||
| + | You may need to configure the RGB order and the brightness. | ||
| + | |||
| + | First, shutdown the dmd_real service, then use zedmd-client -i to list your current dmd settings. | ||
| + | After configuration, | ||
| + | |||
| + | A usb package size of 1024 and a refresh rate of 60 is good on my device. Depending on the esp32 hardware, you may adjust values to get smoother animations. | ||
| + | |||
| + | < | ||
| + | # batocera-services stop dmd_real | ||
| + | # zedmd-client -i | ||
| + | |||
| + | ZeDMD Info | ||
| + | ============================================================= | ||
| + | ID: 3904 | ||
| + | firmware version: | ||
| + | CPU: ESP32 | ||
| + | libzedmd version: | ||
| + | transport: | ||
| + | device: | ||
| + | USB package size: 32 | ||
| + | WiFi SSID: could only be retrieved via WiFi | ||
| + | WiFi port: could only be retrieved via WiFi | ||
| + | WiFi power: | ||
| + | WiFi UDP delay: | ||
| + | panel width: | ||
| + | panel height: | ||
| + | panel RGB order: | ||
| + | panel brightness: | ||
| + | panel clock phase: | ||
| + | panel i2s speed: | ||
| + | panel latch blanking: | ||
| + | panel minimal refresh rate: 30 | ||
| + | panel driver: | ||
| + | Y-offset: | ||
| + | |||
| + | # zedmd-client --set-brightness=7 | ||
| + | # zedmd-client --set-panel-min-refresh-rate=60 | ||
| + | # zedmd-client --set-usb-package-size=1024 | ||
| + | |||
| + | # batocera-services start dmd_real | ||
| + | </ | ||
| + | |||
| + | Only the most common USB-to-serial chips used in various ESP32 boards supported by the auto-detection. Others are ignored to not break the communication to other devices, for example bluetooth headsets or game controllers. | ||
| + | But if your specific ESP32 is not recognized, you can explicitly specify the serial device in the settings. | ||
| + | |||
| + | The best performance could be achieved by using an ESP32 S3 N16R8. Beside the fact that this one has more RAM which is actively used for rendering, it provides a native USB port. This native USB port supports much higher data transfer speeds. | ||
| + | |||
| + | To increase the compatibility with some USB ports or hubs or low quality cables, the USB package size became configurable. The default value of 32 bytes for the original ESP32 is very low. If you notice stuttering of the DMD frames, try to increase this value. | ||
| + | If your hardware supports it, good values are 512 bytes for the original EPS32 and 1024 for the ESP32 S3. If ZeDMD doesn' | ||
| + | |||
| + | ===== Issues ===== | ||
| + | |||
| + | === Lines issues === | ||
| + | |||
| + | Check the pins. Some bad quality pins may create interference. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | === Pannel driver issue === | ||
| + | Depending on the hardware you bought, some settings on the dmd need to be changed. | ||
| + | One user having nothing displayed on the dmd (just the red squares) reported he had to change the panel driver to make it work. | ||
| + | (see https:// | ||
| + | |||
| + | < | ||
| + | zedmd-client --set-panel-driver=4 | ||
| + | </ | ||
| + | |||
- hardware/diy_zedmd.1713988174.txt.gz
- Last modified: 2 years ago
- by nadenislamarre