Master and Slaves

The modules of the system Theremino

This page is dedicated to comments and ideas for Master and Slave modules

Some users have asked how to apply an external power supply

The easiest solution is to use a USB HUB with the 5 Volt feeder 5 Volt exterior. Some of these hubs can even reach up to 3 Amperes and over. But we recommend that you don't overdo the maximum current, to avoid the risk of burning the delicate contacts of USB ports.

In the event that the system is composed of Master and Slaves could be used adapters visible at the bottom of this page:

Adapters can stop, and food, the entire chain of Slaves or they can be used on a single actuator, interponendoli between Pin of InOut and actuator with a standard extension.

These considerations apply to have more power on pins of InOut and not to feed the master module from the outside.

In all cases we recommend that you do not overdo it with the maximum current and use a power supply protected against short circuits. Also make sure that it does not produce noise and excessive voltage spikes when they connect to the 220 Volts.

In case of actuators with strong inrush current before proceeding to external supply try a capacitor by 4700 UF between + 5V and ground. The capacitor can be soldered to the master, or you can use the pin remained free to access +5 and to ground and connect the capacitor with a small female connector.

If it is really necessary to feed the master PIN from the outside do as shown in this image.


Master led does not turn on

If the led on the Master will not turn on does not fetch system failure USB or in Windows drivers, It is more likely to be the same led.


Write here your questions and recommendations, so it will be useful to all.

  1. Gianni. carr says:

    Hello Livio are Gianni (CNC amended) I got the drivers :TB6600 Upgraded Version 32 Segments 4A 40V 57/86 Stepper Motor Driver

    But I can't get them to work.
    You have some indication to give me master links & drivers?
    Thank you very much

    • Livio says:

      There should be no special warnings, fellow GND GND, then connect the STEP signal and the signal and it should work.

      You didn't swapped the wires of motors? You must connect the torques.

      You didn't wrong slot numbers in HAL or application in CNC apps?

      Are you holding the HAL started application?

      In CNC application keep both buttons “In OUT enabled” and “HAL enabled” (at the top right) lit?

      I haven't personally tried those drivers so I don't know if there is also a qualification for him, in this case, you've got to give them a mass or a +5 to enable.

      If you can't write me at “Engineering at sign theremino dot com” and we'll hear over the phone or skype.

      • Gianni. carr says:

        Hello Livio.. This morning I did some testing and found:

        master — driver
        GND — dir –
        dir — dir + 5v
        step — Pulse –
        +5v — Pulse + 5v

        Note that printing on the cover is the incorrect drivers compared to printed inside:
        the particulars of the engine outputs are swapped between a and b but the polarities are respected, then there were particular problems if not reversing the direction.

        the drivers are fine and I switched from vel 800 and acc 25 in vel 2000 and acc 1500 all with 3,2 Ah….I can increase up to 4 Ah

        Thanks Livio tips

        • Livio says:

          The link should be so:

          master ......... driver
          gnd ............ dir -
          dir ............ dir +
          gnd ............ pulse -
          step ........... pulse +

          • Gianni. carr says:

            I tried as you say but the engines were going in one direction only only also with adverse commands

            • Livio says:

              The DIR (that determines the direction) the you had connected as in my table. That any differences could be following in the footsteps of movement and not on the direction of movement.

              So perhaps the problem of failure to change of direction was due to other.

              Plugging in your table you step pulses (motor steps) on the contrary.

              Working with pulses on the contrary should not cause problems because we treated the firmware so that you can work independently or with negative than positive impulses (in other words, we make sure to complete each movement with the front right and then let Miss a step at the end of each movement).

              Though some drivers of engines may not work well with pulses who the top larger than low. I suggest you connect as shown in the table and if that doesn't work find out why.

            • Livio says:

              I'm having a doubt….

              Isn't that internally to the driver the two entrances marked + 5V are linked together?

              You have a pattern of the driver?

            • Livio says:

              I went to find the schema and seems to be this:

              One might say that the three photocouplers are totally isolated from each other, so it should go.

              It's not that you merged K + and Pul + with a wire as shown in the image “Typical connection”?

              The other possibility is that you added the resistors “R” and that therefore our 3.3 volts not enough more. The resistors “R” outside must be removed for sure.

              I can't find the lowest voltage characteristics. I know that many have used them with 3.3 volts and therefore should go. Possibly, to be sure to pilot them with enough current, internal resistors should be reduced also by 240 ohm at 100 Ohms or less (our master has already the resistors on outputs).

  2. vital1 says:

    Sorry, posted in the wrong location. Please delete.

  3. Livio says:

    Mark wrote:
    ... So’ doing, with Arduino created a draft of the Master but does things that the Master can't do. This does look bad to the Master, because it highlights its supposed boundaries ...

    Our system is a PC Input usable even by those who don't know how to program. If you complicate it too loses its characteristic of minimalism. Then he necessarily limits.

    Marco wrote:
    ... and still has limited Arduino as something more than what is, almost denigrandolo, When instead there are Arduino, and compatible ,far more powerful than the Nano and One ...

    The Arduino boards, No matter how powerful, When used as In Out for PC, inevitably suffer the bottleneck caused by virtual serial.

    Application-> O.s.. -Serial-USB-CH340 > > > (or similar) -> CH340-USB-Arduino-Serial-> > > > O.s.. -> Application

    In all these steps a few milliseconds you lose it for strength. And it's not so much the Arduino to lose it, but the virtual serial driver and the operating system of your PC. The kernel allocates tasks on your PC (But even on Linux and Mac), working with a millisecond granularity, why you lose more or less one millisecond with every conversion.

    It is already a miracle that the master arrives almost 1000 exchanges per second. Are 1000 complete exchanges, round trip, for all the pins at the same time.

    And it's inevitable that a virtual serial, with all the steps you have to do, lose at least four milliseconds and therefore has a limit of around 250 exchanges per second. That is not to denigrate. For stand alone applications Arduino is fine, but as a form of InOut is always lower than the Master.

    It might seem that 1000 or 250 exchanges per second are not a big difference. But for most of our applications are. With 1000 trade you have a bandwidth of 500 Hz, and then you see until the 10th harmonic 50 Hz. This makes it possible for applications like the FlickerMeter and Wave Analyzer to analyze the quality of 50 Hz.

    Instead 250 exchanges per second make a bandwidth of just over 100 Hz, that is precisely the minimum wage. They're still going well for automation applications, But if you go down even little can't even move well engines, or make a feedback loop that swings and not go jerky.

  4. Livio says:

    Regarding the previous Post they wrote us:
    All the reasoning row if your transfer you are obliged to put a single value for time, would you like to sample device limits, you want to limit the communication channel between the PC and the device.

    But if, For example, a device could sample internally with a frequency 10 times greater than that of transfer and could transfer at once the values of 10 samples per PC because the communication channel let, and the PC was so powerful that we can do at once each of the calculations 10 new values, by repeating the calculation 10 times by including only one of 10 new samples at a time, you would not get actual bandwidth 10 times higher? The delay in the processing and exploitation of results, equal to the time of data transfer, will always be constant, might as well transfer more data than you can for each transfer.

    If I understand correctly what I have described would allow an increase in bandwidth, not to be confused with supersampling which increases the signal-to-noise ratio, and takes place exclusively device end.

    What you describe is no longer working in real time but in “batch”, that is to say lots of samples. You must then wait for all samples in the batch have arrived before you can answer and you lose the ability to intervene if, for example,, After the third sample one sees that it is time to change the output data.

    In addition.
    Up allHAL you could send a parcel, for example,, one hundred samples. But then should he process them and then you should change the HAL for each new task. You cannot send 100 samples for other applications (through our mechanism of slots) If not with synchronous techniques messed up but no more than one sample every few milliseconds.

    And there's a third aspect which would prevent anyway to send too much data to each Exchange.
    The ultimate USB HID devices package is limited and simply just to send data to all pins of the Master and of the Adc. To send larger packages you should use a non-HID. And then you would lose one of the key benefits of our system, that is, to connect the Master and see it work for, on all Windows, No driver problems.

  5. Livio says:

    Louis asked us

    How can I connect more than 6 capacitive buttons?


    The Master can read 6 capacitive buttons. The Slaves could read 8, but with additional complications, Why not recommend them. In some cases you may use multiple masters, and connect it with a USB HUB, to have only one wire that goes to the PC.

    You could connect 12 capacitive buttons OnOff at each Master, with the adapter explained here:

    If you have any adapter close to its sensor, then the wires towards the Master's course will be of any length.

    These adapters can be purchased on eBay for around one Euro.

    Use Arduino
    You could also use a ArduinoNano, connected to our ArduHAL application. ArduHAL will send data to slots and then from then on it is as if we had used our Master. Through the slots you can connect all our applications.

    The library should be programmed with the Arduino for capacitive buttons

    We didn't try, but probably with an Arduino Nano can be read up to 21 capacitive buttons.

    Sure that the wires should be short (maximum ten centimeters), and far from each other so as not to influence.

  6. Livio says:

    Fabio asked us
    I have a problem with Hal, every now and then, no apparent reason, disconnects preventing the reading of the probes and then locks the execution of the program. Some idea?

    The Master module interrupt USB communication when they receive a higher voltage 3.3 volts on Pin Input.
    Just that the voltage exceeds the 3.6 volts, with at least 100 uA current, for a brief moment (microseconds) and the USB hangs.
    Unfortunately it is a, say defect, Micro used, PIC produced by Microchip.
    The master module has good protections, so it does not break anything, but USB is blocked and you must press Recognize.

    This can happen for the following reasons:
    – A sensor is fed to five volts and in some moments generates voltages above 3.3 volts.
    – long links and unshielded, taking capacitive interference from other nearby cables.
    – Unstable Ground connections, that touch hurt or that are long and small.
    – Disorders on ground connections, caused by the ignition of heavy loads or power supplies.
    – additional power supplies connected to the network and the wired masses incorrectly.

    There are various solutions
    – Powering sensors 3.3 volts, instead of 5 volts.
    – Use Pin 7,8,9 that tolerate 5 volts.
    – Add a resistor in series to the input (tens of Kohm) so as to limit the current to 50 And meno.
    – Do not use long connections and unshielded.
    – Treating good weight distribution (robust and star).
    – Do not use additional power supplies, but only 5 Volt USB.
    – If you use additional power supplies, their mass (GND) It must be connected to the PC and not to the Master.

    An extreme solution (to apply only if you can not fix hardware).
    – The latest versions of HAL write in Slot zero the number of Master connected.
    – It uses a special software, or edit one of our.
    – The software periodically reads zero Slot.
    – If the zero value is one slot, or greater than one, everything good.
    – Otherwise, the software sends a HAL command "Recognize" (HAL read the instructions).
    – After a "Recognize" command The software waits a second before rechecking.

    See also these pages:

  7. Livio says:

    George wrote to us
    For a thermal I should measure the temperatures central. Normally in heating and plumbing are used NTC (to save) The PT100 – Pt1000. The latter are more reliable and you can ward off several meters.

    I may want to use the LM35 for all probes -55 to +150 degrees.
    Look on this page link:

    The PT1000 are no longer accurate, The sole advantage of being able to read up to 500 – 700 degrees
    In return, the PT1000, and even worse the PT100, They are more difficult to read (it would take him Adc24 connected to 3 or 4 wires and linearization function) and if not the laws well are considerably more inaccurate the LM35.

    For long distances you must use a shielded cable with two inner wires.
    With probes LM35 cable resistance counts for nothing and, if the cable is shielded, You can also go away hundreds of meters. The only concern is the lightning, so before you get to the unit you should connect the cable shield to the ground.

    To make them watertight take a closed plastic tube at the bottom, to go over it the LM35 more connections, and shielded cable. Then the fill of bi-component or even only silicone resin. I can assure you will feel the rain and frost for decades (before sealing proof that it works well, ie that it is properly connected and that there are no shorts).

  8. Livio says:

    George wrote to us
    I should accurately measure the grid frequency, How can I do?

    To read the mains frequency procured from a small transformer 220 to 6, 12 or 24 volts (with alternating output) then connect it to the master with the circuit to measure the voltage that you see on this page:

    The circuit is, however, suitable to measure the voltage with an ADC input, but in your case you will have a higher signal suitable for an input “Period”. Therefore, the circuit must be modified by halving R1

    The value of R1 must be:
    – 330K if the transformer is to be 24 It was alternata
    – 150K if the transformer is to be 12 It was alternata
    – 82K if the transformer is to be 6 It was alternata

    Note that the transformer must be “pure”, Unpopulated (diodes or capacitors), and then must give outgoing 6, 12 or 24 volts AC.

    Then you have to configure as input Pin “Period” and you need to enable the handle “Convert to frequency”

    At this point in the associated slot you will find the frequency value in Hz accurate to the thousandth of Hz. If the frequency is unstable you can be averaged over time by lowering the response speed HAL, and by pressing the button “Speed of response” (“Response speed” if hal is configured in English).

  9. Vincenzo says:

    Hello Livio, it would be possible to use a master to connect to a wired MPG software MACH3?
    possibly using the simulation of the pressure on the keyboard as is done with a joystick or similar and Keygrabber.

    • Livio says:

      No, I'm sorry, MACH 3 only works with the parallel port and just as it was designed.
      So if Mach3 uses you can not connect it to anything in our system, does not communicate with our software, and even with our hardware modules.

      • Vincenzo says:

        Ok, I thought that you could associate an electronic event in the master input simulation pressing the PC button.

        • Livio says:

          I know little Mach3 but I seem to have many options. So I guess he can read the PC keys.

          If you can not do it then you should see what information you can send through his only way of communication hardware, that is, the wires of the parallel port.

          If (instructions Mach3) find one of the parallel wire (or more wires) that, raised or lowered, do something useful, then you can then connect to the outputs of the Master and drive them with the keyboard keys. You can not do much but maybe something comes out. It all depends on what it can do Mach3 in response to the parallel wires.

  10. Vincenzo says:

    Hello, what you do with a mouse click on Mach3 has a corresponding keyboard action.
    Using Xpadder I configured a joystick acting on the commands associated with keyboard and it works.
    that's why I thought that it could be sent by the master combination / hal / software keystroke action as does Xpadder.

  11. Livio says:

    When the micro is overloaded the Servo pins of the Master module lose precision
    and may be unstable (little movements), mainly in the following cases:

    – When many Servo Pins are configured
    – When using Stepper type Pins

    The Servo Pins can be replaced with PWM-Fast which are completely accurate
    but the frequency generated cannot be less than 250 Hz (while in normal servos it is 60 Hz)

    Furthermore, there are only five PWM-Fast for each Master and their most complex configuration.

    To use the master module Pins PWM-Fast as Servo, set these values in the HAL:

    – Max value = 1750
    – Min value = -250
    – Frequency = 250
    – Duty cycle from Slot = Enabled

    By slightly modifying the 1750 you can adjust the max position (when the slot is = 1000)
    By slightly modifying the -250 you can adjust the min position (when the slot is = 0)

    === CAUTION ===
    The Servo drive frequency becomes 250 Hz instead of 60 Hz
    So only digital servos can work and maybe not all.
    Some analog servos can heat and burn.

    The pin type Servo Module Master lose precision when the micro is overloaded,
    and may be unstable (small movements) mainly in the following cases:

    – When you are configuring many Pin Servo type
    – When you also use Pin Type Stepper

    The Servo type Pin can be replaced with the PWM-Fast that are totally precise
    but the generated frequency can not be less than 250 Hz (while the servant is normal 60 Hz)

    In addition, the PWM-Fast it is only five for each Master and their more complex configuration.

    To use the Fast-Pin PWM module as the Master Servant setting these values ​​in HAL:

    – Max value = 1750
    – Min value = -250
    – Frequency = 250
    – Cycle from slot = Enabled

    Slightly changing the 1750 you can adjust the position max (when the slot is = 1000)
    Slightly changing the -250 you can adjust the position min (when the slot is = 0)

    WARNING === ===
    The Servant of the driving frequency becomes 250 Hz instead of 60 Hz
    So only digital servo can work and maybe not all.
    Some analog servos can heat and burn.

    • Livio says:

      Claudio asked us:
      When you wrote “instability” what do you mean?
      As they notice these instabilities and how they can affect movements?

      With “instability” Scattini meant little when they should stand still.

      To notice them you must stop all, not move values ​​in slots, stay in a quiet environment and pay attention to what do the engines for a while’ of time.

      Every now and then the engines should make light “tick”
      but they are “tick” so short that almost all servo patterns do not even move.

      These Scattini can shake the pen as you draw a straight line
      but in all other cases should not give problems.

  12. piero says:

    hi Livio,

    I want to link the master module to an external power supply for the acquisition of 100 T-sensori (Lm35) through 10 moduli “slave”;
    …. two questions from me:
    the) since the form “slave” it is not explicitly named on this site, it would be possible to use 10 unit’ theremino-“servant” with 0-9 inputs / outputs?
    the) where can I find both modules (currently the module “servant” it is not offered on ebay site)?

    Thank you

    • Livio says:

      I advise against using servo modules, serial communication with 10 servant would be too unreliable, moreover, the servos are now practically abandoned because they have few types of PINs and a ten-year-old firmware.

      Use Masters instead (that have 12 PIN instead of 10 of servants) and connect them with a USB Hub.

      And Master li poisons are eBay (venditore maxtheremino) or on store.ino ( but in the latter case they come to you from China and it takes longer.

  13. Livio says:

    Pay attention to the cables that are used to power the ESP32 !!!

    Just today trying the Power Banks I discovered that the cables count a lot.
    The tension starting from the PowerBank was about 5 volts
    - With round black cable, one meter long, the voltage on the ESP32 was 4.74 V
    - With flat white cable, long 30 cm, the voltage on the ESP32 was 4.2 .. 4.4 V

    I expected the short cable to go better but no,
    it goes so badly that the ESP32 occasionally disconnects.

    After an hour, the PowerBank had discharged a little and was giving alone 4.8 V
    The voltage with the short lead was lowered to approx 4 volts,
    and of course the ESP32 disconnected and just didn't work anymore.

    So I tried to change the cable and put the black one.
    The voltage on the ESP32 has risen to 4.6 V
    And now it's been hours !

    So before blaming PowerBanks or short-lasting batteries.
    Look for the right cables!!!

    To make sure the cable is good
    the only way is to measure the 5V on the ESP32 in operation and connected to the IotHAL

    And the voltage on the ESP32 must be at least of 4.7 volts
    And even better if you can get it from 4.8 or 4.9 volts

  14. Eugene says:

    I don't know if it's the right place, forgive me.
    I am trying to mount a Theremino master but I do not say that it works.
    I program it with the Pickit2 and it does not give me any error but the Led does not work and the Theremino_HAL does not detect it
    Can you help me?

    • Livio says:


      If the LED does not flash there is some hardware error.
      The quartz probably does not oscillate or is not of the right value.

      You have followed the advice on this page ?

      You are using the MasterFirmware_V5.0 which you download from here?

      Quartz is from 8 MHz ?
      You put the two capacitors from 27 pF next to quartz?

      You remembered to add the zero ohm resistor R11 which carries the power?

      You put the power capacitors C3, C4, C5 yes 10 uF ?

      The IC2 regulator provides i 3.3 volts to the processor ?
      (measure with a tester to be sure)

      • Anonymous says:

        The first, thank you for answering me, very kind.
        I have read the tips .
        I have used the MasterFirmware_V5.0, V3.2 y V2.0. with 4Mhz quartz.
        Quartz works, measured with an oscilloscope.
        The resistance is up, as it comes in the diagram.
        Capacitors, all set.
        Regulator metered and with 3.3 v.
        The C.I is in a SOIC capsule mounted on a printed circuit that passes it to DIL.
        The PIC24FJ circuit, works, tested with typical LED lighting program. Yes indeed , with internal oscillator because that's what I found handy( I don't know how to program very well).
        What if it has happened to me is that I cannot program the Pic by PGED3, PGEC3 pins 1 y 2 ;I have programmed it by PGED1, PGEC1 pins 4 y 5 with the Pickit2 and it doesn't give me an error, In fact the Led program works, I say this in case it influences something.
        Tested on W10 and Xp and Net 3.5 loaded again.

        Greetings and grateful for your response

        • Livio says:

          I just can't understand what it could be.

          I will try other suggestions:
          – The PIC is a 24FJ64GB002 ?
          – Quartz goes from 8 MHz, if you put it by 4 MHz you need to change the firmware.
          – W10 and Xp and Net 3.5 I'm ok
          – Maybe the LED is faulty (it has already happened to us)
          – Maybe the RESET circuit is wrong or not working well?
          (if it does not unlock from RESET then it does not walk)

          Double-check everything, there has to be a mistake, tens of thousands of them have been built by different builders and in some cases even with artisanal means and all of them always work.

          That it is the faulty PIC ?
          Let it be the PIC KIT programmer 2 defective?

          You have used the PIC KIT application 2 improved by us?
          You are using the right definitions for the PIC 24FJ64GB002?

          I don't know what else to think…


          • Anonymous says:

            By the way i am spanish, pensioner of 69 years with some knowledge in electronics and I live in Toledo , capital

            Yes, the PIC is a 24FJ64GB002 in SOIC capsule mounted on a printed circuit that passes it to DIL.
            Quartz is 8 MHz and put one of 4 MHz to test with firmware V2.0 Hex without touching it.
            The Led is tested and in fact works with the typical program of lighting an LED. Yes indeed , with internal oscillator and on the outputs RA0, RA1 and RA2 pins 2,3 y 4.
            The PIN 1 Reset is always at high level.
            I have 2 Pic mounted and the two act the same.
            El Pickit 2 it's okay ,well record me without problems.
            Yes, I use the PIkit 2 improved and I have tried another version.
            In the correct definitions, if you mean the recording, the Pickit recognizes me perfectly the Pic.
            I don't know what to do too, I've given the circuit a thousand laps and I can't find anything wrong.
            I am trying to find a program in which the USB intervenes, let's see if it works.
            By the way, the Led of the Theremino blinks as soon as possible or it needs to detect a signal through the USB.
            Greetings and always grateful.

            • Livio says:

              The LED should blink fast as soon as you power up the PIC.

              I can only advise you to build one exactly as per our projects, or have it sent to you already complete.

              Then you could keep the two powered on the bench close to each other and measure and compare the voltages on all the PINs.

              Surely when you find out what is wrong it will be trivial.

              And something is wrong there for sure, otherwise as soon as the 3.3 volt to the processor the led would start flashing.

              If you really do not find the error, you could send it to me and I will find it for you for free. Then to send it back to you we will have to use Lello (maxtheremino seller on ebay) and you will have to send them a few euros with PayPal for shipping.

            • Livio says:

              What if you're doing something wrong with PicKit2 ?
              Did you remember to remove the check that keeps the PIC in reset? Or to unplug the programmer so that it does not keep the PIC in reset?

              I am also worried about what you write that PINs 1 and 2 do not work… because they have always worked for everyone.

              The last possibility that comes to mind is that your PICs are different from the ones we have always used. Maybe they could be with the same name but with differences due to a new and very recent version that we have never seen.

              Regarding the USB program you should use our Theremino_HAL, but first it should flash even without USB otherwise it is useless to try.

              • Anonymous says:

                I disconnect the Pickit2 after recording it and connect it with the USB cable to test.
                I have put a push button between ground and the pin 1, to reset.
                I keep going around and investigating the matter.
                Anyway, I will order one mounted and programmed.

                Greetings and thanks.

                • Anonymous says:

                  I have entered in your Master.hex program, the lines of the code of the ignition of the Led and the Led works on the pins 2,3, but the rest of the program does not; curious
                  I will continue investigating and tell you.

                  • Eugene says:

                    I think I know where the fault is,the chip that I have is the 24fj64ga and it does not have USB and the 24fj64gb does, and I did not realize the detail, when I receive the correct one I will try it and tell you, it sure works.

  15. geofaber says:

    Good morning everyone.
    I wanted to know if anyone has had any experience with strain gauge. I tried using the Theremino Balance application with load cells and it works very well (with ADC24)
    An amplifier is required to read the strain gauges?

Leave a Reply

Your email address will not be published.