Autumn Antenna Adventures….

…with Arduino.

My relationship with computers is a love-hate one. They are too complex and fragile to be reliable and always let you down when you most need them. But there is a miniature computer I really love: the Micro Controller Unit (a.k.a. MCU). They are simple and reliable, because they do one thing and they do it well. For us hobbyist the two most well known are Microchip Technologies’ PIC and Atmel’s AVR. I dabbled with PICs before, but they are a pain to program and require special hardware to do so. Enter Arduino. These guys from Italy took Atmel’s AVR chips and put them on a board with an easy to use USB interface and an integrated development environment, which uses a dialect of C. Weehee, could it get any better?

MCUs are just like Legos: add some sensors and an LCD and you have made yourself a weather station. Add some wheels and a motor and you created a robot. The possibilities are endless. But just like Legos my Arduino projects have been build and then taken apart for the next project. This is about to change now. My loop antenna needed a way to switch between the 7, 14 and 28 loop turns and it had to do so remotely. “Well, use relays” you would rightly say and those happen to be one of the easiest things to hook up to an Arduino. Let me show you.

Two wires for power and one control line (here hooked up to the Arduino input/output “pin” number seven) so simple enough. But it won’t do a thing until you tell the Arduino to do something, using a program. For writing such programs there are computer languages, and they are just that: languages. Learn how to interpret a language into your own and you’re good to go. It might scare you off, but then isn’t electronics a kind of language as well? Remember, I honestly can’t call myself a programmer, but with a guide book and some advice from the experts I can go a long way in making something exciting. Don’t believe me? Let’s start with the basics.

Arduino programs are made up of three blocks of code:

1 – a block to declare and define the things you need later
2 – a block to set up those things
3 – a block that does stuff with those things over and over and over again

Can you spot the three blocks in this example?

The first block features only one line: “int relayPin = 7;“. Let’s put that in plain English: we use pin 7 of the Arduino to connect the relay to, and instead of “pin 7” we now call it “relayPin”. And because “7” is an integer we also declare that.

Every pin on the Arduino board can be used to either get signals in or out, so that’s what we define in the setup block: set the pinMode of the relayPin to OUTPUT.

Since we set the relayPin as an output pin we can activate it and that is what happens in the loop block. First we write to the relayPin and make it active, or HIGH. Then we have a slight delay of 1000 milliseconds, after which we write to relayPin and make it inactive, or LOW. After another 1000 millisecond delay the whole sequence in the loop block starts all over again. After compiling and uploading the program to the Arduino the result looks like this….


It might not seem very useful to have an oscillating relay, so we need other ways to control it. I’ll cover that next time.

In the mean time, Arduinos are pretty cheap and together with a breadboard, a bunch of wires and some LEDs you can already start playing around. At Banggood.com you can get a bare Arduino Uno for US$3.99. This is a knock-off version, but they work equally well. A whole starter kit is only a little more, so it won’t break your bank.

On the internet there are tons of tutorials, YouTube videos and forums to help you with your first Arduino/MCU steps. I’m sure that after the initial steps MCUs won’t be so intimidating anymore. So, try it and have fun.

Hans "Fong" van den Boogert, BX2ABT, is a regular contributor to AmateurRadio.com and writes from Taiwan. Contact him at [email protected].

8 Responses to “Autumn Antenna Adventures….”

  • wayne cheng, ve7hcw:

    Don’t forget to mention when using knock-off versions to use a different serial to usb chip “CH340G”. the solution is to install a new driver before using the clone Arduino.
    Just search for a CH340G driver and install.
    wayne ve7hcw

  • Luc ON7DQ/KF0CR:

    I have a nice beginners project too. I had the problem that my IC-7300 has only one KEY connector, and it’s at the back. So changing from paddle to straight key was a bit cumbersome, also because it needs 8 key presses into the menu each time …
    I solved it with an Arduino, 2 buttons, one resistor and one diode.
    All details here :
    https://on7dq.blogspot.be/2017/02/ic-7300-paddle-or-key-easy-solution.html

    If you read all of my text, you will easily see how to adapt or expand the code to send other CI-V commands to your rig, like how to switch between 10W and 100W … without even touching your rig.
    Have fun !
    Luc

  • Thank you for the tip, Wayne. I might save Windows users a lot of agony.

    I have the luxury of running Linux on all my hardware, which recognizes any Arduino board wherever it came from.

  • Luc, that is a great article you wrote and as an IC-7200 owner I might do a hack like that one day, too. Good job showing how versatile an Arduino can be.

  • HS0ZLQ/G0MIH:

    Hi just read your comments on programing.
    My problem is in to old to learn how to do this. I did have a go at it me gma y years ago but as
    Qwickly found that ones and zeros are it for me. I hate computers and they hate me back.
    Yes I have to use then in the office and at home but I an do anything with them. I ant program anything at all.
    But if it’s RF you are talking about well that’s me.
    Paul

  • Hello Paul,

    Well, it’s just another tool to get things done. If you can master it, then it is a great addition to your tool chest. If not, no harm done, there is always another way.

    73 and hope to work you one day. –Hans

  • Sandy KD8UTR:

    I hope it’s okay to reprint this great article in my Radio Club’s monthly newsletter, which I edit in Livonia, Michigan, USA. Your email is protected here, so I can’t write directly. You get full credit, of course.

  • Hans (BX2ABT):

    Hello Sandy,

    You’re welcome to reprint this article. If you have an electronic edition could you please send me a copy?

    Your QRZ.com entry doesn’t list your e-mail address. Please contact me via my home page: bx2abt.com –> More –> Contact. Thanks.

Leave a Comment

Subscribe FREE to AmateurRadio.com's
Amateur Radio Newsletter
News, Opinion, Giveaways & More!

E-mail 
Join over 3,000 subscribers!
We never share your e-mail address.



Also available via RSS feed, Twitter, and Facebook.


Subscribe FREE to AmateurRadio.com's
Amateur Radio Newsletter

 
We never share your e-mail address.



Do you like to write?
Interesting project to share?
Helpful tips and ideas for other hams?

Submit an article and we will review it for publication on AmateurRadio.com!

Are you a reporter covering ham radio?
Find ham radio experts for your story.

How to Set Up a Ham Radio Blog
Get started in less than 15 minutes!

Sign up for our free
Amateur Radio Newsletter

Enter your e-mail address: