Introduction: Controller for 3 Magnetic Loop Antennas With Endstop Switch
This project is for those ham amateurs who don't have a commercial one . It's easy to build with a soldering iron, a plastic case and a little knowledge of arduino.
The controller is made with budget components you can find easily in Internet (~20€). The main component is a cnc shield that fits over an Arduino Uno. Both made a compact, small and cheap controller.
This controller can work without endstop switches because you can manually control the 0 position and the upper limit.
There's an oled version that Andrzej4380 suggested me to do.You can see it in the "I made it" section of this page. It is adpated to use an 128x32 OLED display It is fully compatible with it so instructions are the same. The only difference is the display.
You can download the code here : https://github.com/cabrinana2/Controlador_loop_3_a...
Features:
- New revision of the software ver 3.0 05/04/2020 fixed some bug.
- Added a new version 3.0 capable to tag frequencies to the memories.
- Version 3.1 fixed some bugs.
- Factory reset function.
- Some improvements in the code - timer for every function
- Capable up to 3 different antennas.
- Endstop switch capable with endstop.
- Auto zero function
- Range of 64000 steps for moving every antenna.
- Microstepping capability 1/2 1/4 1/8 1/16 or even more depending on the pololu stepper control.
- 3 memory banks with 14 programmable memories for antenna (42 memories).
- Programmable upper limit for every antenna.
- backlash compensation from 0 to 200
- speed control from 2(2miliseconds pause between step) to 40 ( 40 miliseconds pause between step)
- Microstepping compensation
- Power supply 12V
Supplies
CNC shield v3 with arduino UNO
LCD LCD-1602 + I2C IIC 5V para arduino
Added STL files por 3d printing at the end of this article
-the platform for adapting the arduino UNO to whatever case you have
-the nkob por the rotary encoder.
The links I have done are only examples. Needless to say that you can buy wherever you want.
Step 1: Overall View
In this photo you can see the CNC shield over the arduino uno, the optical rotary encoder , the I2C 16x2 display and the five push buttons at the bottom.Finally we have the two endstop switch.
Step 2: CNC SHIELD AND ARDUINO UNO
The arduino board is almost free of wires. The only ones you'll need are the power supply ones. It is necessary to weld some wires into the arduino board and connect them to the cnc shield.The shield comes with 4 pololus a4988 or similar. The pololu has a potentiometer so you can limit the maximum torque of the step motor . My advice is limit the torque to the minimum necessary to move the capacitor. This way prevent for damaging the capacitor
Step 3: OPTICAL ENCODER
The optical rotary encoder is a 100 pulses one. The photo you can see how the wires yellow (A ) and green (B) are welded to the pins 10 and 9. just in case a clockwise rotation makes a descending count, you might swap the wires.
Connect the wires in this order:
Black - GND
red - 5V+
green - digital pin 9
yellow - digital pin 10
Step 4: 16X2 DISPLAY AND PUSH BUTTONS
The five push buttons are welded to the cnc shield In this order:
-UP- 17 (A3) -DOWN
-11 (digital 11)
-MEM UP -15 (A1)
-MEM DOWN - 16 (A2)
-MENU - 14 (A0)
The I2C 16x2 display is joined this order:
DISPLAY SDA - sda pin ( A4)
DISPLAY SCL - scl pin (A5)
DISPLAY GND - gnd
DISPLAY VCC - 5V+
Step 5: WIRING TO THE MOTOR
I have used ethernet cable for connecting the antenna motor and the control.
Pay attention to the nema wire . Most standard wires does'n come in the correct order.
Step 6: SCHEMATIC
For a deeper understanding of the cnc shield visit this web page :
Step 7: ENDSTOP SWITCHES
I have used two spare switches I have .
In the photo the wires are :
Blue- gnd (14)
Green- (13) Up switch
Yellow-(12) Low switch
Step 8: MICRO STEPPING
The cnc shield has three jumpers in every pololu that allows using microstepping. In microstepping you can divide every step in a factor of 2-4-8-16 or 32.
You can find the configuration in this page:
Step 9: CODE AND INSTRUCTION MANUAL
Code on github (click on clone or download and download zip)
For arduino ide you need to have the librairies :
Sometimes, the lcd comes with the chip 8574at and the screen doesn't work.The direction is 0x03f instead of 0x27. In that case you have to change the direction of the chip in this line :
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27
for this one :
LiquidCrystal_I2C lcd(0x03f,16,2); // in I2C chip 8574at set the LCD address to 0x03f
EEPROM.h included in the Arduino ide
I have made a version of the software with only an antenna at the request of Lev OK2PLL. He is making a small loop controller with an arduino nano and a pololu for portable operation.The code is here :
Loop controller for 1 antenna with endstop
Another version with an antenna with a tb6600 controller on request of TA1MC :
Step 10: Torque Limiting
The shield comes with 4 pololu a4988 or similar. The pololu has a potentiometer so you can limit the maximum torque of the step motor . My advice is limit the torque to the minimum necessary to move the capacitor. This way prevent for damaging the capacitor.
Finally, pololus might be damaged if don't have any motor connected. Please, install only the same number of pololus than motors.
In order to not to burn the pololu pay attention to the pin labeled "EN". It must fit in the hole labeled en in the cnc shield.
Step 11: VIDEO EXPLANATION
Step 12: BACKLASH COMPENSATION
Step 13: DIFFERENT VERSIONS OF THE CONTROLLER
There are different versions of this controller._
1)- CONTROLLER FOR 4 MAGNETIC LOOP ANTENNAS-
This is the first one. It is capable up to 4 different antennas. It is made for the CNC platform and Arduino uno. It doesn't have end-stop capabilities.
2)- CONTROLLER FOR 3 MAGNETIC LOOP ANTENNAS-
Modification of the 4 antennas controller. It is capable up to 3 different antennas. It is made for the CNC platform and Arduino uno. It have got end-stop capabilities.
3)- CONTROLLER FOR 3 MAGNETIC LOOP ANTENNAS (OLED SCREEN)
This is a modification of my Controlador loop 3 antennas .It is adapted to use an 128x32 OLED display It is fully compatible with it so instructions are the same. The only difference is the display.
4)- CONTROLLER FOR 2 MAGNETIC LOOP ANTENNAS-
This is a modification of my former control of 3 antennas.
It fits with the CNC shield V4 for arduino nano and V3 for arduino uno.
Fits perfectly in two different configurations of hardware:
-CNC shield V3 for Arduino uno
-CNC shield V4 for Arduino nano
Here you are a link that describes the problem with some v4 CNC
The red one is usually a defective clone. Black one is my advise.
5)-CONTROLLER FOR 1 MAGNETIC LOOP ANTENNA-
This is a variation of the former loop controller for 3 antennas this time with only 1 antenna. At the request of Lev OK2PLL. He is making a small loop controller with an Arduino nano and a pololu for portable operation. The power supply is 5Vcc from the micro USB connector. It is enough for a portable operation with a portable mobile charger
6)-CONTROLLER FOR 1 MAGNETIC LOOP ANTENNA WITH TB6600
It is a modification Just in case you had a TB6600 driver.
Step 14: DOWNLOADABLE STUFF
This control is designed for managing 3
different loops antennas. You can manage every antenna without interfere in the rest. The power supply is 12v. This is not a commercial design it is made for a ham amateur only for the enjoy of the rest of the community.
The controller can manage 3 different loops antennas independently.
It has 64000 step for every antenna
Endstop switch possibility.
14 memories for antenna.
You can define up limit and down limit.
!!!! VERY IMPORTANT!!!
The controller has 3 memory banks (1 memory bank for antenna). If you want to erase a memory bank push UP & DOWN buttons simultaneously.
Just in case you need to erase the whole data push DOWN & MENU buttons simultaneously.
The controller has five push buttons:
MENU –this button selects between MEM/ANT/SAVE/ADJUST/BACKLASH/SPEED/DISABLE POLOLU AND MICROSTEP functions.
UP/DOWN – used for the next functions:
-Increase and decrease manually the stepper motor (normal and adjust functions).
-Save memory in the save memory function
-execute the auto zero function
-Modify backlash/speed/micro step and disable pololu functions.
MEM UP/ MEM DOWN – used to select the memories and to change the antennas.
All the functions return to MEM function after 3 or 8 seconds.
Functions:
--MEM—
In this position you can select the desired memory. If you don’t have any number stored, NO DATA will be shown in the display. Remember that MEM14 is the upper limit. You need to store in this position the maximum step you want to move your capacitor. For select a memory push MEM UP / MEM DOWN.
--ANT—
In this position you can select the antenna between 1 and 3. For choosing an antenna push MEM UP / MEM DOWN.
--SAVE—
Once SAVE is shown in the left corner, you must select the desired number of memory (between 1 and 14) and push UP or DOWN buttons to save.
After this will appear a new screen in which you can save the frequency. Introduce the frequency this way:
-Buttons UP & DOWN to select MHZ (1000 KHz) Up to 59 MHZ
- Buttons MEMP & MEMDOWN to select KHZx100 Up to 59 MHZ
-Rotary encoder to select KHZ.
-Push MENU button to save the frequency or wait 4 seconds.
Remember that this is only a tag not a real frequency.
Remember that in position 14 you must save the upper limit.
--ADJUST—
ADJUST function allows to move the stepper motor without increasing or decreasing any number in the display. It is useful when we need to find the 0 position manually. Sometimes it is necessary for calibrating stored memories. Once adjusted one of them, the rest are calibrated too.
--BACKLASH—
Backlash compensation from 0 to 200. In this position you select the value you consider effective in your system. In order to not to complicate the software, I have decided to compensate only when decreasing. So If you want to as more accurate as possible, before storing a position:
Ej—step 1750
1) increase a bit more the value ---1765
2) decrease the value to the desired position --1750
3) save it --1750 save
Remember to do this if you want to be accurate in the recorded positions.
Just in case you don’t need backlash compensation put the value in 0.
--SPEED—
This function stablishes the maximum speed in automatic movement (memories and autozero). 3 is the max speed (3milisecons pause in every step) 20 is the min speed (20 milliseconds pause in every step). You must adjust the speed in order not to broke your capacitor. I could have used 1 millisecond but the speed was dangerous for almost every system.
--DIS POLOLU—
Pololu is the driver that is in charge to move the step motor. During its work, pololu introduces a lot of rf noise in the antenna. Some people has designed its system in order to not to be affected by this noise. In case you can’t deal with the noise you can disable the pololu after every movement. This happens automatically if you choose “Y“. In case we chose “N” the pololu never disables. Don’t disable the pololu is more accurate but noisier.
--AUTOZERO—
This function moves the step motor downward until it finds the endstop switch. After this it moves upward until the endstop open its circuit. Two second after, the counter is set to 0. It is important not to select this function before you were sure the system is completely functional.
--MICROSTEP—
On the cnc shield you’ll find three jumpers you can set to modify the Microstep.
https://blog.protoneer.co.nz/arduino-cnc-shield-v3...
Microstep menu uses a compensation to be more accurate when we use micro stepping in the pololu. For no compensation or no micro stepping you can use 0 compensation.
I have added a brochure of the old blackbox I have used as enclosure. It is useful for the dimensions. As you can imagine, you can use whatever box you want.
Step 15: 3D PRINTED CASE
I have made a 3d printed case to install properly all the components.
You need to buy some aditional parts that fit properly in the case :
Screws m3 x 8mm (flat countersunk head) for the feet and arduino
Step 16: ASSEMBLY
Fix the arduino in the base.
Intall the rj45 sockets and wire them to the dupont conector like in picture nº 3
Probably you will neeed some glue to fix the rj 45 to the rear panel.
There are some holes to pass the wires just in case you don't have the rj45 sockets.
The feet lock the case .
You can add some silicone feet to add some grip .
Step 17: STL FOR 3D PRINTED CASE
Step 18: PROTECT THE ENDSTOP INPUT FROM RF
The endstop is placed next to the capacitor so it has to endure an intense field. This field might cause malfunction in the arduino uno. My advice is to put in between a 12V relay (It doesn't matter the type). In my case I have a RT314012 12VDC (https://es.aliexpress.com/item/32871878118.html?sp... ).
Before installing the relay, the system worked erratically when transmitting. Now it works fine.
In the photo you can see only a relay because I have installed only down limit endstop.
A friend of mine (EA4ENG) solved this problem without any relay. It has installed two 0.1uf capacitors between Gnd and pin 12 and GND and pin 13 . This capacitor will kill the rf and do the same work.
Step 19: ADVICE FOR BUTTERFLY AND AIR CAPACITORS
So far I have used a nema 17 motor because y have a 116/12 gearbox to drive my capacitor. In case you had either a butterfly capacitor or an air capacitor, you can't drive ir directly. This is because you'd only have 100 steps to tune your antenna.
My advice is using a modified 12v 28BYJ step motor. This motor is the cheapest on the market . It has a gear box 2000 step per revolution. It is enough to tune your capacitor precisely.
An example from Lev Kohút :
64 Comments
2 months ago on Introduction
Hola José
I have all prepared (3D, material) all is collected and ready to assemble.
But had a healthy issue. Now I move to Greece and after will have lot of time and will continue with the work.
Here my preparation: http://www.hb9fih.org/?p=p_745&sName=mag.loop--hb9...
Here some Results with magLoop Antennas: http://www.hb9fih.org/?p=p_785&sName=mag-loop-qrp-...
Gracias por tu Trabajar - esta mu bien - con mucho gusto
Buen salut
73 Erich
Question 8 months ago on Step 18
Hi again José,
a "silly" doubt:
When you say "... (EA4ENG) solved this problem without any relay. It has
installed two 0.1uf capacitors between Gnd and pin 12 and GND and pin 13
. This capacitor will kill the rf and do the same work."
which kind of capacitor is suitable for (ceramic, electrolitic, ...) and what's the max voltage?
Thanks. Gracias.
Answer 8 months ago
Hi.
He used electrolytic capacitors. 5v are ok.
In my opinion ceramic capacitors are more suitable for RF suppression.
It's up to you.
Saludos
José
Reply 8 months ago
Gracias José. Un saludo.
10 months ago
Evening Jose,
I am progressing with the build of the remote stepper controller. Thank you for all your help with the code etc. I believe that I now have all of the various connections correctly made to the Arduino shield and the Cat8 shielded cable to the stepper motor checks out and the stepper moves in either direction.
Is there an easy way to input the maximum and minimum travel limits, please? I have tried the Adjust for Mem 14, but this only moves a few steps at a time. When I press the return to 0, it recalibrates the existing stepper position to 0 and then I start all over again.
Also is there a way temporarily increase the stepper speed for the Return to 0 position, please?
Probably I have misread your very good instructions.
Looking forward to hearing from you.
Regards John G0RJM.
Reply 10 months ago
Could you please send me a video ?
Thanks
Reply 9 months ago
Afternoon Jose, I am progressing slightly with the MLA controller. Please see the latest videos as I seem to have got into a loop situation whereby the controller is always trying to set the Upper limit and lower limit, even if it has already been saved. Do you have any suggestions that I can try, please? Here is the link to see the videos https://1drv.ms/u/s!At9wxqox0qNqhN1ZKFjKk4J3KDlfug?e=uTP7HF
Reply 9 months ago
Hi John.
the firmware you are using is designed for Arduino nado and doesn't work fine in Arduino uno due to the distribution of the card pins. Some pins are used for led .
You are using this one :
https://github.com/cabrinana2/loop-controller-for-...
For your card ( Arduino uno ) you must use the software for 3 antennas or the software for 4 antennas ( it depends on if you want to use endstop or not ). The fact of being able of controlling 4 antennas is not a problem because you shouldn't use three or 4 drivers. One driver is enough for 1 antenna.
The software for 3 antennas is :
https://github.com/cabrinana2/Control-for-3-magnet...
The one for 4 antennas is :
https://github.com/cabrinana2/Control-for-4-magnet...
I hope I have helped you.
73
Reply 9 months ago
Evening Jose,
Thank you so very much for kindly sharing the various versions of this Arduino sketch. I will carefully work through these and compare what I have got and what is now available.
I have completed working through the "Controlador_loop_1_antena_lowsitch_3_up-6 and translated all of the comments to help me to understand more thoroughly.
I have made a small change to a section of the code around line 1214, as I kept on catching the Up and the Down buttons and clearing the memory. I have changed the code so that I have to press the Up button and Mem Down button together to delete the memory.
I was trying to introduce a time section into the 'if statement' so that both buttons had to be pressed together for 5 seconds before the Delete Memory was executed, but the solution I have implemented will do for now.
I am making some good progress in that the controller appears to work correctly with the stepper motor plugged in directly to the A3988 driver.
The problems occur once I plug the 15 metre Cat8 cable in. I believe that the length of the cable is causing all sorts of crosstalk which is then confusing and corrupts the sketch.
I am in the process of rewiring the two RJ45 sockets and omitting the 0.1uF decoupling capacitors and making use of all 8 cores to supply the stepper motor. The end switches are now connected via a second Cat8 cable to hopefully reduce the EMI/RFI that is causing a problem.
I knew this part of the project had the prospect of being problematical, but hey ho.
I want to get the controller and the mechanical side completed before I purchase my loop and IC7300 as the ensuing frustration of not being able to get on air would be a major nuisance.
I have attached the latest wiring diagram and a photo of the controller now that I have screened some of the cables.
I am sure that we will speak again soon.
73's de John G0RJM
Reply 9 months ago
In that case you can try decoupling the rf with a relay. I used this method in the 3 antennas controller . :
https://www.instructables.com/Controller-for-3-Mag...
73
Reply 8 months ago
Evening Jose,
The controller appears to be working fine. I just thought I would send you some photos of the completed project. Thank you for all your help.
73's John G0RJM
Reply 10 months ago
Evening Jose,
Thank you for your speedy reply. I have uploaded my wiring diagram here and I have uploaded the videos. Here is the link https://1drv.ms/u/s!At9wxqox0qNqhN1ZtWqLB2rvU2UEy...
Hope that this is of some help.
9 months ago
Hi Jose,
I finally completed my build of the Mag Loop Antenna Controller, I did have a few Problems at first, but finally got there will your help and Ellis M5AEI, when programming the Arduino PCB, I found that I didn’t have the Library installed for the 2 x 16 Line Display and after communicating with Ellis he helped me sort this out. I’ve also see in the Forums that someone else mentioned the Display, I believe you are going to add the information about Library in your write up.
My Box was made from scrap bit’s and pieces, I cut the Front Panel out and Airbrushed the Front Panel Metallic Red and then Lacquered it, I made the Box from wood and Airbrushed it Metallic Silver, I decided to put a 4 Way header on the back of the Box for testing various stepping Motor’s, I’ve added the RJ45 socket, so I can run a RJ45 cable to both the variable capacitor and the crash stop micro switches. I’ve made my butterfly variable capacitor and it works perfectly, I will be replacing the Nut’s in between the sector’s with 5 mm spacer’s, when I get to cutting them to size.
Thank you Jose for such a excellent project. G6ZDP Kev
Reply 9 months ago
Was a pleasure helping you get your project working. Hope to get mine built soon.
73 Ellis M5AEI
11 months ago
Evening Jose, thank you for a impressively descriptive method to build the controller etc.
I am planning to use this on one mag loop capacitor using an Arduino Uno with a CNC four output stepper controller shield with the A4988 driver.
I have been trying to create a code to control the Arduino over the WiFi, but this is proving to be somewhat of a majior headache!
Is there any chance that you could kindly upload a version of the code just for one stepper, please?
I notice that there are some comments in the code in Spanish, is it just a case of looking up a translation for these?
I am a bit concerned that I might not edit the 3 stepper version correctly or do I just leave some of the output pins not connected. If this is the case, which pins are not required, please?
Sorry for so many questions.
Many thanks. John. G0RJM.
Reply 11 months ago
There is a versión with only a stepper controller.
https://github.com/cabrinana2/loop-controller-for-...
In the text you can aces to the 6 different versions.
Feliz navidad.
Question 1 year ago
Hi Jose,
congratulations for your project. I follow your instructions to build a vacuum capacitor rotator controller.
I have a doubt about the 3D printed box since I'll order in a specialized shop: which is the difference between "Frontal" and "Frontal pulsador ancho"? I've ordered from AliExpress the buttons you suggested in your comment but I dont'k know the difference between 2 frontals.
Thanks. Saludos.
Vic, EA4GRG, 73.
Answer 1 year ago
Buenos días Victor.




Hay muchos tipos de botones en el mercado.
He diseñado la caja para dos de ellos.
Uno tiene el agujero de 7mm y el otro de 10mm.
En la imagen de portada se puede ver el frontal con uno y otro botón.
Adjunto foto de ambos.
No había caído en que no lo he explicado en las instrucciones .
Lo haré en cuanto pueda.
Gracias por tu pregunta
Saludos cordiales
73 EA7HVO José
Reply 1 year ago
Gracias por la respuesta Jose. Yo tengo los pequeñitos negros, exactamente iguales, así que imprimiré el "Frontal" a secas.
Muchas gracias por tu ayuda.
Saludos. 73.
1 year ago
Hi Josh,
The Mag Loop Antenna Tuner, I want to make is to Control just one Mag Loop Antenna.
Do I use the Software mentioned here “The software with only an antenna is ready .Here you are : https://github.com/cabrinana2/loop-controller-for... I need feedback because i tried it only several minutes. Thanks Lev for your ideas and hardwork.”
73 José
I also want to make my Loop to cover the 20 & 40 Meter Bands and other HF Bands if possible, have you any information for the Diameter of the Loop and what Variable Capacitor I can use please. G6Z