Parametric DIN rail enclosure for small ESP32 modules (cadquery)
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
The enclosure can hold up to 3 boards. Example generated model for RS485 interface with esp32 C3 zero board
- Ocena
- 5 / 5
- Polubienia
- 80
- Pobrania
- 165
- Wydruki
- 1
- Wyświetlenia
- 1572
- Oceny
- 1
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Electronics
- Licencja
- Creative Commons — Attribution — Noncommercial — Share Alike
Provided .stl files can be used as is but the real strength of this design is the parametric customization.
We provide a python script that can generate custom variations. Requirements: python 3.x interpreter with cadquery library.
Optionally cq-editor to visualize the result before it is sent to the slicer.
Interface with outside world through:
- multiple WAGO 221-2411 straight through connectors (both on the upper side as on the lower side).
- USB-C openings
The enclosure can accept up to 3 boards:
- one vertically mounted board, parallel to the front: board1
- two small horizontally mounted boards: board2 (upper) and board3 (lower)
Each of the boards can have an usb-c connector.
In the current version, the system will always generate for 3 boards. In most cases, you will only need 2 boards (or less); making the unused boards smaller will make more space for the other boards and wiring.
The parameters for your chosen design are stored in one of the config.py files. These configuration files serve also the main program and call the libraries din_enclosure.py and din_declarations.py. The latter 2 files need not be modified (in most cases). To the config.py file is the file that needs to be executed by the python interpreter or cq-editor.
If the boards are equipped with a JST-XH connector, an extra-width on the left or right side can be declared. In that case, the standard 18 mm case width will be tight to fit the JST connector. Make sure to lower the mount_height as much as possible. In case it still does not fit, increase the case_width. You may also need to declare an extra mm board length for easy insertion.
There are a limiited number of example configurations in the subdirectories. Currently, these example models are generated for a esp32-c3 zero and esp32-mini format modules in the board2 and board 3 slots and an RS485 interface in the board1 slot.
The board1 slot can have LEDs for which an optical channel is created to the front-panel. Be aware that the position of the LEDs may vary a bit dependent on manufacturer.
The board slots can be configured for the dimensions of a D1 mini board, (as done for the board3 slot), but the space may be tight and the number of WAGO connectors may be set to zero on the upper or lower side to increase the available space.
The number of WAGO connectors on the upper side and bottom side can be configured. If one of the numbers is higher than 2, the enclosure will become wider than the standard 18 mm DIN module.
The parametric model foresees also some texts to print on the front panel, side panel and above the WAGO connectors. Be aware that print quality of the text may not be on par with the print quality of the entire model.
ATTENTION: today, I learned that there is some variation on the depth of the cabinet between rail and front cover plate. In some cabinets, the chosen value DIN_DEEP_LOW=49 might be tight. More recent config files reduce this to 47mm. Decreasing this value may bring some disadvantages (less space for the boards and WAGO connectors). So if your cabinet does not proviede enough space, the size of one of the horizontal boards needs to be reduced (or one row of WAGO connecotes must be omitted).
The script may generate too many files, only the case, lid and small_parts .stl files need to be printed.
Generation notes:
Work in progress ! : we are currently restructuring to separate the config file from the core code. This may still change in the coming days to make it easier to run custom configs. The script currently consists of 3 files:
- din_declarations.py is a fixed library file and should not be modified.
- din_enclosure.py is the library file responsible for generating the CAD model; this file should not be modified in normal cases.
- the several variations of config.py (in the subdirectories) are the most important part: they contain the parameters for your project. The subfolders also contain the generated stl files.
Place all 3 files in the same directory (or in a directory structure corresponding to the files section of this page), and execute the config.py program file in a python interpreter that has access to the cadquery library (or better in cq-editor).
The default config.py files contains a configurations called dual and dual2 configured for a single row of 2 WAGO connectors, and 3 boards: a front RS485 board, board2 for an esp32-c3-zero and board3 for a lolin S3 mini board. If you create another config file, please adapt the CONFIG_NAME variable also.
The dual_zero config file accepts 2 esp32-c3-zero boards and supports 2 rows of WAGO connectors.
Assembly notes:
- The small board holders for board2 and board3 may break easily when some less flexible filaments are used. In case this happens, the boards can be fixed with the square holder from the small_parts file.
- Be carefull when removing the support material from the DIN clip slot. It can be pulled out relatively easily with pliers.
- The WAGO holders should fit in the holes in the case and lid. This might be tight dependent on print parameters. Inserting the small objects from the opposite side first can help widen the hole a bit.
- By default made for M3x10 screws, the default model can be used with our without inset nut (tested with a 4.2x4 mm nut). Without inset nut, the M3 screw will fix itself in the plastic.
- A piece of transparent filament can be used as LED light guide; real optical fiber will of course perform better.
- The best way to mount board2 and board3 is to insert the non-usb side first, and than gently push the usb connector downward. This method is certainly needed if a JST-XH connector is mouned close to the egde.
LICENSE: the script can be adapted for personal use, but cannot be redistributed except as a contribution to the source code (@infradom github). The config.py files that contains the configuration parameters may however be modified and republished. The main source code must be obtained through this page.
- Please add your variations of this model under the user print files section of this page.
- If you want to contribute source code enhancements, please use my github page https://github.com/infradom/parametric_din_rail_enclosure . Please be aware that we want to keep this model as simple as possible.
Printing instructions:
3 files need to be printed:
- case: please print with support enabled; don't forget to remove the support under the LED light guides
- lid: support recommended
- small_parts: clip, wago-holders, board fixes: no support needed