Yet another Multi Switch - YaMS


Model pilots are lucky guys. They can choose their personal favorite from a variety of modern and powerful remote control systems from different manufacturers and get almost everything they need. Also the car and ship modelers finds suitable systems - as far as their focus is on pure driving or racing action.


Unfortunately, lovers of functional models can only dream of it. With the introduction of modern "computer systems" and digital transmission methods at 2.4 GHz, the previously popular modules for switching several functions via one proportional channel have somehow get lost.


Today the corresponding forums on the Internet are full of searches and discussions for equivalent modern solutions. There are a number of different approaches with more or less complex solutions, but often they only work with a view typs of systems or are difficult to adapt. Or there are universal solutions, but for my taste rather cumbersome to use, since the functions must be switched via a single switch or transmitter stick.


However - on my wish list stood:

  •      as many switching functions per servo channel as possible
  •      each function has its own switch, indicating the current switching state
  •      usable with any remote control system on which you can also use standard servos
  •      as simple as possible and for each hobbyists feasible adaptation to other stations
  •      the costs should be kept within limits and the components easy to procure

I named the result YaMS in the style of SuSE YaST.


While the transmission methods between sender and receiver can differ greatly from system to system, the encoders (usually simple potentiometers and switches) on the sender side and the output servo signal on the receiver side are very similar in all systems. In order to remain as universal as possible, my idea does not adress the transmission method, but instead simulates a normal poti in the transmitter and evaluates the usual servo signal on the receiver side.


Doing this way you get a solution that is very simple and can actually be transferred to almost any remote control system. The biggest disadvantage is a limitation to five (maybe six) switching functions per servo channel.


The switches are coded via servo signals of different lengths. In order to clearly differentiate between them, each switch receives only half as much signal length as the previous one. With the usual servo signal of 1 to 2 ms, this results in:

  1. switch 0,5 ms
  2. switch 0,25 ms
  3. switch 0,125 ms ...

It could also be said that any conceivable combination of switch states is encoded as in the binary number system, with the individual bits being represented by intervals of different lengths in the servo signal. It follows that with five switches, 32 combinations must be transmitted and clearly distinguished on the receiver side again. With six switches, there would be 64 required combinations and so on. With a resolution of 256 bit you could theoretically code a maximum of 8 switches, but in practice you will not be able to implement this reliably.



Principle of the "encoder"
You can not really speak of an "encoder" because it only consists of a series of suitably dimensioned resistors and switches and is thus completely discrete.
In order to implement the method described above in the transmitter you select a potentiometer present in the transmitter and measures its total resistance. The first switch now gets half the resistance of this total resistance, the second half again, and so on.


Important for the encoder is that it always forms a correct voltage divider just like the simulated potentiometer. This means that each resistor must be present twice, once before and once after the "wiper" and the toggle switch must always bridge exactly one resistance of this pair. Therefore, only two-channel toggle switches are suitable here. At the bottom of the page you will find the corresponding circuit diagram as download, from which this becomes apparent.


Principle of the decoder
The decoder is an Arduino that evaluates the servo signal and sets the switches according to its duration. Using a value list that can be individually adapted to the encoder, it is precisely determined which of the 32 possible switching states has just been transmitted and the outputs are set to high or low accordingly. That's all.


The encoder

The encoder is built only from resistors and switches that can easily be wired "on the fly" as outlined below. Of course, the respective resistors on the switches can also consist of two or more resistors connected in series in order to achieve as exactly as possible each half of the preceding switch.
In the case of my Frsky X9e the potentiometer is 5K, which I have implemented as follows:

  single resistance total resistance
switch 1 2,2K + 300 2,5K
switch 2 1,2K + 47 1,25K
switch 3 470 + 150 620
switch 4 150 + 150 300
switch 5 150 150

If I had to design the module for another transmitter like my old Futaba F16 with 10K potentiometers, I would just have to omit the 150 ohm resistor and start the chain with 5K at the other end (eg 4.7K + 300) ...

The rule of thumb when choosing the resistors is:

As much as half of its predecessor, but never more than half!


Here it quickly becomes clear why no more than 5 or maximum 6 switches are feasible. The fifth resistance equals 6.25% of the first resistance each time exactly halved. The usual resistances have a tolerance of 5%. If you want to realize 6 switches, you should definitely get better resistors with only 1% tolerance.

The decoder

The heart of the decoder is an Arduino, which receives the servo signals set by the encoder on one or two inputs, evaluates them and switches 5 or 10 outputs accordingly. A jumper can be used to specify whether the decoder uses one or two channels.



The hardware:
On the Arduino, pins D8 and D9 are used as inputs for servo signals and pin A0 as input for the jumper. The switching outputs are pins D2 to D7 and D10 to D13.
In the circuit presented here, I used an Arduino Nano and decided on the implementation of the switching outputs for two-channel SMD MOSFETs type IRF 7103 or even better IRF 7301 for up to 2,5 amps per channel and a lower threshold voltage (I've seen this on the fine 16-channel multiswitch decoder by Claus Poltermann (www., which functions on a
very different principle). So the circuit remains very small and still tolerates up to 2 amps per switching output. Of course, those who shy away from using SMD components can easily convert the outputs with transistors or MOSFETs in the TO-220 package.


The software:
The Arduino sketch uses the RC library and has been further developed from the example program for ServoIn.

Therefore, it is necessary to download the library from here:
Then in the Arduino development environment in the menu <Sketch> -> <Import Library> -> <Add Library ...> and then select in the following dialog the file "" just downloaded.


The incoming servo signal is measured and assigned a value from 0 to 31 according to the list of values stored in the sketch (treshold_1 and treshold_2).


Then this value is evaluated as follows:

value greater than / equal to 16?

yes: output 1 on; value is equal to value minus 16;

no: output 1 off

new value greater than / equal to 8?

yes: output 2 on; value is equal to value minus 8;

no: output 2 off

and so on ...



The whole thing was supplemented by a kind of hysteresis for the switch with the lowest resistance value at minimum and maximum value. If the resistance values are very unfavorable, this could flicker sporadically, since the received values fluctuate slightly. Therefore, this switch does not change state until five passes, one at a time, the new value has been determined.

On the following pictures you can see the board of the decoder created on my simple CNC milling machine from both sides as well as a version of the encoder built on a small board.


Once the encoder has joined the transmitter and the decoder (or even the Arduino) is connected to a receiver, you can start. Commissioning takes place in three steps:

  1.      calibration
  2.      determine thresholds
  3.      adjust tresholds in the sketch

If the transmitter has a calibration function, this should absolutely be done once. Usually this is done by first bringing all the pots to the middle position. In the case of the YaMS decoder, switch the switch with the highest resistance to on and all others to off (please do the same with every new calibration, otherwise the signal values can change slightly). In the next step, in which all potentiometers have to be moved to their maximum in all directions, all switches on the encoder are switched
simultaneously on and off several turns at the same time. This corresponds to the respective maximum values, intermediate steps are not required for the calibration.



Determine thresholds

To do this, connect the Arduino with the inputs to the right receiver channels and also via USB to a PC. Please start the Arduino development environment and open the item <Serial monitor> under <Tools>. If everything was connected correctly, the terminal should now permanently display the lengths of the current servo signal of the two channels.
The thresholds are the respective limits between two different switching states.
In the download below you will find an EXCEL table, with which you can easily determine these values. Starting with the pattern "00000" (all switches off) to "11111" (all switches on), you set all 32 possible switch positions one after the other once and enter the values displayed in the serial monitor in the corresponding line in the yellow field. The only thing to keep in mind is that you follow the correct order according to the pattern in the first column. It is all right as long as the values are ascertained continuously ascending or descending. If the direction changes, you probably mistook a switch position.



Adjust tresholds in the sketch
In the green column next to it, the sought limit values are displayed. These 31 intermediate values plus the two lower and upper limits 800 and 2200 are entered in the right order in the sketch into the two arrays treshold_1[33] and possibly treshold_2[33]. In most cases the values for identically constructed encoders in both tables will be identical and can easily be copied.

Finally, save the program and rewrite it again in the Arduino.

Material requirements

For two encoders and one decoder, so a total of 10 switching functions. All prices are just examples and could change.

  example unit price all round price
 10 * switches on - on, 2 channel toggle switch mts-202-a2-420434 at 5 Stk 0,70 € 7,00 €
resistors on demand      
1 * Arduino Nano V3.0   ca 2,50 € 2,50 €
10 * LEDs stackable LED 5MM R GN

0,12 € 1,20 €
1 * resistornetwork 10 * 330 z. Bsp. Bourns 4611X-101-331LF ca 0,50 € 0,50 €
5 * MOSFET IRF 7103 IRF 7103 or 7301 0,32 € 1,60 €
    total: 12,80 €

In addition you need small stuff for a few cents such as pin and socket strips, a screw terminal, board material, etc.

The resistor network is not easy to obtain in this design. But you can easily replace it by soldering 10 normal 330 Ohm resistors with only one leg vertically to the circuit and then soldering them above with a cross wire together. The cross wire finally goes back into the circuit as the eleventh leg.

Decoder variant for breadboard cards

Here, on request, a variant of the decoder for breadboard cards and without SMD components, because not everyone has the opportunity to create a corresponding board.

 Attention: The circuit was not physically built and tested

The layout of the circuit has been modified for this purpose. Instead of the IRF7103, MOSFETs of the type IRLZ34NPBF are used in the TO-220 housing. The LEDs were omitted for simplicity, but added some resistors to drive the MOSFET gates.

In the illustrations below, all components are to be understood as symbols only, in particular, the color codes of the resistors do not match the real values.

Notes on the construction:

every 10 horizontal resistors: 47 ohms
every 10 vertical resistances: 100 K
In the case of MOSFETs IRLZ34NPBF, pay attention to the correct alignment (gate towards Arduino)
Blue lines run on the bottom and red lines on the top.
All lines between the screw terminals and the MOSFETs should be connected to sufficiently thick conductors, as high currents can flow here, depending on the load.

After connecting the consumers, it should be checked if the MOSFETs are getting hot and may require additional heatsinks.

  example unit price all round price
1 * Arduino Nano V3.0   ca 2,50 € 2,50 €
10 * MOSFETs TO-220 housing IRLZ34NPBF

0,50 € 5,00 €
10 * resisitor 47 Ohm      
10 * resisitor 100 KOhm      
6 * 2-pin terminal XY306 0,15 € 0,90 €
    Summe: 8,40 €


Please note:
I assume no liability or guarantee for consequences or damages that arise from the replica and / or operation of this circuit. All replicas and in particular modifications of the transmitter etc. are at your own risk.

YaMS Decoder 0.2 Files
Contains the Arduino sketch, Eagle schematic and boardlayout of the Decoder, JPGs of schematics and the EXCEL-sheet for determination of the tresholds
Komprimiertes Archiv im ZIP Format 197.0 KB