User Tools

Site Tools

Translations of this page?:


This is an old revision of the document!

FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)

Rules for designing new modules

This page serves as a wiki complement to an original article Proposed rules and standard procedures. It also serves as a site for placing additional rules of module design, which are not dealt with in the article.

The module design itself uses a following software tools.

Identification of modules

Each modules has to carry a unambiguous identification mark consisting of its name, version and module revision - e.g. JTAGFT2232V02A.

  1. JTAGFT2232 - the name of the module, depicting the nature of the module (here probably a J-tag programmer with FTDI FT2232 chip).
  2. (V)02 - the module’s version - there already were some crucial changes during the modules development (in this case, there was CPLD added from version 01)
  3. A - the module’s revision (in this case there were not corrections of any mistakes)

Furthermore there are modules with green non-soldering mask and white print and modules with white mask and green print. This kind of module identification was introduced by UST company, which produces modules for MLAB. The meaning of the above-mentioned colour identification is as follows:

  • Green mask and white print - a prototype module, often made only in one or few pieces serving as testing samples
  • White mask and black print - a production version made in large quantities. Compared to the green version, it may contain tiny changes changes even if the module’s identification mark is identical.

Creating a new module

Using a mlabgen script

The first step is to create a correct directory structure of a new module in the fork of the main modules' repository. A basic guide for using github.

The directory structure can be created either manually or using a mlabgen tool, which will create the directory structure by itself and correctly name all the files. After its installation, a new module can be created using the following command:

mlabgen-module-init NAMEVERREV

The NAMEVERREV is the new module’s identification created by us. The mlabgen-module-init command has to be executed in the folder, where we want to create the new module. If we plan to create a module with sensor, it has to be placed in the Modules/sensors folder.

Using the mlabgen-module-init command is recommended because the script also creates some additional files - for example an QR code for the new module.

Next step is to edit the metadata file <NAMEVERREV>.json in the directory structure of the module in such way, that it would contain the basic information about the new module. Then we can add the directory structure of the module to the repository. After finishing the module design, it is useful to create a pull-request to the main MLAB repository, which has been forked - this is the best way to make your work visible.

Commit log should be completed with an information that a new module has been added together with its purpose. Further documentation should be already created during the module development. It is therefore useful to create a module’s wiki page here, shorty after the commit of the new module. Creating a page can be done by opening a wiki page from the List of the MLAB modules page.

Manual module creation

If, for some reason, you are reluctant to use MLABgen for creation of the basic directory structure, it is necessary to comply with the following rules:

In the appropriate folder category we create a folder with the name of the new module using a format NAMEVERREV’’. Inside the folder, we create the following directory structure (obligatory folders/files are marked with an asterisk): <NAMEVERREV>* ├── doc* │   ├── img* │   │   ├── <NAMEVERREV>_QRcode.png* │   │   └── <NAMEVERREV>_top_big.jpg* │   ├── pdf │   │   └── │   ├── <NAMEVERREV>.cs.pdf │   ├── <NAMEVERREV>.en.pdf │   └── src │   └── <NAMEVERREV>.tex ├── hw │   ├── cam_profi │   │   ├── <NAMEVERREV>-B.Cu.gbr │   │   . │   │   . │   │   └── <NAMEVERREV>-PTH.drl │   └── sch_pcb │   ├── <NAMEVERREV>.kicad_pcb │   ├── <NAMEVERREV>.pro │   └── <NAMEVERREV>.sch ├── cad │   ├── src │   │ └── <NAMEVERREV>.scad │   └amf │   └── <NAMEVERREV>.amf ├── <NAMEVERREV>.json* └── sw    └── <NAMEVERREV> The file <NAMEVERREV.json>'' should contain the information concerning the module.

    "wiki": "None", 
    "status": "1", 
    "name": "<NAMEVERREV>", 
    "short_en": “Short  description in English", 
    "image": “Picture adress, if not available, use QR code", 
    "longname_cs": “Czech subtitle", 
    "longname_en": “English subtitle”, 
    "mark": "50.0", 
    "ust": "", 
    "doc_cs": "", 
    "short_cs": “Short description in Czech", 
    "doc_en": "", 
    "root": “folder within the repository", 
    "author[]": [], 
    "category[]": []

You can find example of a correct filling by checking one of the already existing module.

Module power supply

You can find more detailed examples of connectors and an explanation of their use at Manuals.

MLAB connectors configuration

Power supply connectors for low currents have two configurations (??) which are implemented using .. (??) Napájecí konektory pro nízké proudy mají dvě konfigurace a jsou realizovány lámacími hřebínky s roztečí 2,54mm

Power supply connectors are doubled in order to allow smyčkování napájení (??).

Externí napájecí zdroje

For power supply with higher powers, the FASTON connectors or WAGO256 terminal blocks are used.

There are always openings for WAGO256 terminal block on PCB, because the terminal blocks and FASTON have the same with and it is thus possible to fit both types of connectors onto one PCB.

Cylindrical power supply connector

Power supply +5V from USB

It is always a good practice to include a safety current PTC fuse into the USB power supply in case of modules powered from USB that are able to further distribute the power so that the HOST system is not overloaded.

High voltage

For high voltage distribution (>250V DC) to modules, there are special high-voltage connectors SHV that can be used up to approximately 10kV. SHV connectors, compared to other coaxial connectors, have an advantage that it is not possible to confuse them with the usual measuring BNC connectors.

SHV zásuvka SHV fork

Due to usually very good insulating parameters of coaxial cables, it is possible to use coaxial cable RG58 for construction of high-voltage distributions.

Safety features

Module schema

A properly drawn schema (not only of MLAB modules) follows these rules:

  1. Connections cross each other as little as possible
  2. Signals are led from left to right.
  3. Positive power supply is led from top to the bottom, negative from bottom to the top.
  4. A connection cannot cross any text / inscription
  5. Decoupling capacitors are connected with their positive pole to the place they should decouple (if not possible, they are drawn closely to the decoupled circuit).
  6. One connection has to contain a minimal amount of connecting points (it is for example not recommended to draw two T nodes, instead it is better to draw one + node).
  7. Components’ values must have a common name convention using full names of the physical quantities - e.g. nF, pF etc.

A specific feature of MLAB schemes is, that the nails are always in pair, but to keep the scheme intelligible, they are shown as one component (in some cases it requires using own libraries, but on the other hand, schemes are much more intelligible).

Safety resistors

We advice to use safety serial resistors on inputs of some of our modules (e.g. sensors or often modules working at 3.3V) - they will increase the resistance to extreme preload. Size of such resistors is usually within range 10 Ohm to 1 kOhm, with respect to the IO pin’s current requirements.

Safety diodes

Almost all the present MLAB modules contain a safety antiparallel diode on the power supply input, serving as a protection against polarity reversal. It short-circuits the power supply in case of connecting the power voltage of incorrect polarity. In order to function correctly, the diode requires power supplies with current limit.

Therefore it is not recommended to power supply the modules directly from accumulators, as they are able to damage (evaporate) the diode in case of wrong connecting and thus ruin its function. When using modules together with accumulator or battery power supply, we recommend using a proper power supply module that contains a fuse or a converter with current limitation.

Module geometry


MLAB modules are designed in 10.16 mm raster (400 mils) and their sizes exceed 200 mils - 10 mils from the centres of the corner holes. Each module is 10 mils smaller in size compared to the exact raster due to production tolerances (otherwise it might not be possible to fit two modules next to each other on a base board). To make it possible to fit modules next to each other, it is necessary to make each size smaller by 0.254 mm (10 mils). For mounting on the ALBASE, we use M3 screws of 12 mm in length - that is why it is necessary to have four 3 mm diameters openings on each PCB.

An example of a module occupying 3 openings on the ALBASE:

 Length of the edge = 4x10.16 - 0.254 -0.254 = 40.132 mm
 Screws’ pitch = 3x10.16 = 30.48 mm
 The distance of screw opening from the base’s edge = 5.08 - 0.254 = 4.826 mm
 Screw opening’s diameter = 3 mm

Edge screws

Screws need to have a sufficiently large space around them in order to fasten two contra-nuts that are holding a screw in a module and at the same time serve as a spacer washer between a PCB and a base. PCB is thus placed at the height of two nuts above the base (approx. 5 mm) making the available space for assembly of components 4.9 mm. In case of using larger components, a module can be slightly raised by inserting a required number of washers between both nuts (usually one or two washers are sufficient, otherwise it is recommended using a spacer column or another nut).

Nuts are used thanks to the fact that two nuts make it possible to use a contra-nut effect - they hold firmly and are not released easily compared to simple columns, which have to be secured against release by other ways (e.g. using an anaerobic glue).

Layout (PCB design)

Limits of production possibilities:

Minimal trace width (?? Cesta) 0.1 mm
Minimal insulating space 0.1 mm

Conductive traces (??) in PCB and their sizes are always chosen so even an amateur production and PCB mounting are supported as much as possible. Insulating distance are therefore maximal and spaces for components are chosen to be a bit longer than necessary (especially in case of QFN containers, where such approach makes a soldering quality check much easier).

The traces are furthermore design to minimise the possibility of modules’ emissions - this usually means to minimise the area of knots (?? Smyček), especially in case of boards with alternating currents of high amplitude (e.g. inverters) or in case of outputs of logical circuits of CMOS and TTL types.

In case of two-layer PCBs we prefer to use the upper side of the module (the one away from the base board) as a ground potential (??). If necessary, it is possible to have a low-voltage power supply led also in this side. However, it is quite crucial to avoid leading data or high-frequency signals in the top layer (again, due to possibility of emissions and reduction in the signal integrity).

Modules should have all of the four screws connected with the same potential, even in cases when the module is not using the base board’s ground (if there are not any special construction requirements that would make such practice impossible. An exception is for example eth). This practice helps to reduce emissions from modules, especially in cases of multi-layer PCBs.

Components’ encasements

The preferred encasements for components are those from libraries on github verified by us.

The preferred size of SMD casing is currently 0805 series.

Components’ placement

SMD components are placed only at one side of the board - the one turned towards the base board, if possible (B.Cu layer). A reason for this placement is a greater toughness of the construction, lower radiation and easier mounting in a reflow oven.


F.Cu - top copper (copper layer on the components’ side) (??)
B.Cu - bottom copper (copper layer on the traces side ?? měděná vrstva ze strany spojů)
F.SilkS - silkscreen (components’ side)
B.SilkS - silkscreen (traces’ side ??) potisk strana spojů
F.Mask -  soldermask (components’ side)
B.Mask - soldermask (traces’ side ??) maska strana spojů
Edge.Cuts - board outline
F.Fab - fabrication layer (components’ side) potisk pro osazování strana součástek
B.Fab - fabrication layer (potisk pro osazování strana spojů

When designing a two-layer PCB, one layer is reserved for grounding and power supply - this layer will be set up as a “Split/Mixed plane” and will have an earth and power supply signals assigned to it. Such setting will allow to automatically end traces of these kinds by a VIA into this layer. It is far better than set up the layer as “copper pour” since in such case the traces are difficult to edit.


For usual traces

0.8 mm VIA’s diameter and 0.4 mm diameter for drilling

For power traces, the dimensions of VIAs have to be enlarged depending on the currents, or their number have to be increased.

Limits of production

Minimal circle (?? Okruží) size 0.1 mm (VIA’s diameter = drilling diameter + 0.2 mm)

V případech kde to není nutné nenavrhujeme na této mezi. Prodražuje cenu PCB.

Texty v potisku modulu nesmí překrývat prokovy. (Jinak dojde k nečitelnosti potisku v místě prokovu)

Construction parts

When a module has some free space left of a PCB, it is possible to place a spaces for backup components (usually resistors or condensers in 0850 encasement). During components fitting, it is recommended to use double hřebínek (??) - one raw of pins will be connected to power supply Vcc or ground GND and the opposite pins will lead to backup components, as e.g. ATmegaTQ3201A module. An interesting possibility is to make holes in a PCB at the site of backup components, which will enable an easy control of their presence and furthermore will enable an use of SMD LED.


Modules’ indicator LEDs are preferably designed in a way that they shine through the PCB onto the side turned away from the base board. It can be achieved by placing a LED into a hole in a PCB - such kind of mounting is called “reverse mount” and there exist special SMD diodes especially designed for it.

Classic THT LED with through feet (?? Led s průchozími nožičkami) is fitted together with an ass Klasické THT LED s průchozími nožičkami se osazují s montážní podložkou, která usnadňuje osazování chrání led před zbytečným tepelným namáháním a ohybem. Montážní podložka mírně zvětší průměr základny LED s čímž je nutné počítat při návrhu plošného spoje.


Pro krystaly v modulech MLAB bylo jako základní pouzdro zvoleno HC49/S, malý krystal s nožičkovými vývody. Je to z toho důvodu, že může být umístěn na modulu z vrchní strany a je vždy viditelná jeho frekvence. Konstruktér tak má během laborování s moduly vždy přehled o používaných frekvencích.

MLAB HC49/S standardní krystal

Pro moduly, kde lze předpokládat občasnou výměnu krystalu za krystal s jinou frekvencí se na modulech osazuje speciální držák krystalu, do kterého je možné po zkrácení nožiček krystal pohodlně zasunout a kdykoli vyměnit za jiný.

MLAB držák krystalu

Rezervní pozice pro součástky

Indikační LED mohou na modulech být v provedení SMD, nebo LED 3mm. SMD diody lze umisťovat i na spodní stranu desky přivrácenou k podkladové desce. V takovém případě je ale vhodné do plošného spoje nad SMD LED navrhnout díru cca 1mm kterou bude SMD LED viditelná..

Potisk na modulech

Potisk na modulech by měl respektovat obecná typografická pravidla. Je to důležité hlavně z hlediska nutnosti zachovat čitelnost potisku i po aplikaci sítotiskem.


Na jednom modulu se může vyskytovat více velikostí písma, (obvykle na modulech stačí méně, než 3). Použivají se v pořadí: název modulu, popisky, výstrahy, označení autora. Různé velikosti se samozřejmě používají pouze v případech, kdy je k tomu na modulu místo. Na některých modulech je proto jenom jedna velikost písma podřízená čitelnosti a rozměrům modulu.


Signály se stejnou prioritou by měly mít na celém modulu jednotnou velikost písma. Taktéž by měla být sjednocena velikost a styl jednotlivých popisků u jednoho konektoru.

Popisky jednotlivých signálů na hřebínku se zarovnávají ke konektoru, aby byla minimalizována možnost řádkové chyby při zapojování.

Velikosti Písma

Nejčastější používané velikosti písma jsou:

Width 1,5 mm, Height 1,5mm, Thickness 0,3mm  - název modulu, důležité informace a popisky hřebínků
Width 1,3 mm, Height 1,3mm, Thickness 0,3mm  - popisky jednotlivých vývodů hřebínků

Velikost písma menší než 1,3 mm je problematická a je třeba ji používat pouze v opodstatněných případech.

Na některých malých modulech může vzniknout problém s délkou názvu modulu, v takovém případě se název modulu zalamuje u verze modulu, například:

ISL2902001A je celý název tohoto modulu, avšak ten není možné na modul umístit, proto je zalomen u verze jako ISL29020 a 01A.

QR kódy

Na všechny moduly které jsou dostatečně velké, aby na ně mohl být umístěn QR kód. Ten obsahuje identifikaci modulu a odkaz na stránku s permalinkem na dokumentaci modulu. QRkód generujeme nástrojem qrencode do složky <modul>/doc/img/<modul>_QRcode.png. např

qrencode -s 15 -l L "" -o "MODUL01A_QRcode.png"

Pokud jste pro vytvoření modulu použili mlabgen, QRkód by měl být vytvořen při vytváření základní adresářové struktury.

Vhodnejší by pravděpodobně bylo použití micro QR kódů. Utilita qrencode je sice umí generovat. Např. “qrencode –micro -v 4 -s 15 -l L “BATPOWER04C” -o “microQRcode.png”” ale ještě neexistuje vhodná čtečka do Androidu, která by je uměla číst.


Miho pro potřeby generování kódu do potisku plošného spoje vytvořil generátor QR kódů, který generuje grafiku ve formátu ASC (Původně určeno pro Mentor Graphics PADS) Velikost QR kódů na plošných spojích zatím není sjednocena. Při generování kódů je výchozí velikost pro většinu plošných spojů příliš velká. Momentálně se vhodné nastavení musí vyzkoušet vhodné počáteční nastavení je např.

  • PADS Size: 20
  • PADS Line Width: 2

Vygenerovaný soubor je ve formě textu na spodní straně stránky. Text je tak nutné ručně vložit do souboru s příponou asc. Po importování vygenerovaného obrázku do potisku plošného spoje je následně třeba nastavit atribut “solid copper” aby motiv byl kompletně vyplněn barvou.


Obrázky QRkódů se do KiCAD převedou stejně jako logo.

Check list před výrobou

  1. zkontrolovat velikost a spravnost pouzder
  2. Velikost plosek u konektoru a soucastek skrz desku.
  3. velikost der, krystaly ledky, hrebinky, propojky, specialni soucastky.
  4. odmaskovani plošek, propojky
  5. obrysy soucastek, oznaceni propojek.
  6. popisky, napis
  7. Zkontrolovat, ze nejsou prokovy pod pismeny a znaky
  8. zkontrolovat QR kod a PermaLink.

Struktura repozitáře MLABu

  • Projektová metadata - json
  • Commit message - začátek velké písmeno, slova jako added, fixed, removed, started, finished…

Jmenná konvence


Adersářová struktura modulu

en/rules.1549634780.txt.gz · Last modified: 2019/02/08 15:06 by fluktuacia