Arduino Projects For Amateur Radio Pdf Software Pdf File

Transcription

Arduino projects for amateur radio pdf software pdf file

Arduino projects for amateur radio pdf software pdf fileGet full access to Arduino Projects for Amateur Radio and 60K other titles, with free 10-day trial of O'Reilly. There's also live online events, interactive content, certification prep materials, and more. Do you want to increase the functionality and value of your ham radio without spending a lot of money? This book will show you how! Arduino Projectsfor Amateur Radio is filled with step-by-step microcontroller projects you can accomplish on your own--no programming experience necessary.After getting you set up on an Arduino board, veteran ham radio operators Jack Purdum (W8TEE) and Dennis Kidder (W6DQ) start with a simple LCD display and move up to projects that can add hundreds ofdollars' worth of upgrades to existing equipment. This practical guide provides detailed instructions, helpful diagrams, lists of low-cost parts and suppliers, and hardware and software tips that make building your own equipment even more enjoyable. Downloadable code for all of the projects in the book is also available.Do-it-yourself projectsinclude:LCD shieldStation timerGeneral purpose panel meterDummy load and watt meterCW automatic keyerMorse code decoderPS2 keyboard CW encoderUniversal relay shieldFlexible sequencerRotator controllerDirectional watt and SWR meterSimple frequency counterDDS VFOPortable solar power source Cover Title Page Copyright PageDedication About the Author Contents Preface Acknowledgments 1 Introduction 2 I Don’t Know How to Program 3 The LCD Shield Project 4 Station Timer 5 A General Purpose Panel Meter 6 Dummy Load 7 A CW Automatic Keyer 8 A Morse Code Decoder 9 A PS2 Keyboard CW Encoder 10 Project Integration 11 Universal Relay Shield 12 A FlexibleSequencer 13 Rotator Controller 14 A Directional Watt and SWR Meter 15 A Simple Frequency Counter 16 A DDS VFO 17 A Portable Solar Power Source A Suppliers and Sources B Substituting Parts C Arduino Pin Mapping Index The requested URL was not found on this server. Additionally, a 404 Not Found error was encountered while trying touse an ErrorDocument to handle the request. Apache/2.4.41 (Ubuntu) Server at m.central.edu Port 443 Communicating through radio frequency oscillation within an electromagnetic field (commonly called radio communications) is an amazing technology that we often take for granted in the modern world where smart phones, Wi-Fi, satellitetelevision, GPS, RFID cards, and even garage door openers implement radio comm all around us.A radio communication system minimally includes a transmitter, a channel, and a receiver. The transmitter takes an input signal (such as voice or music) and converts it up to a radio frequency (such as 101MHz for a commercial FM radio station). Thatradio frequency signal is then driven into a transmit antenna. The transmit antenna agitates the surrounding electromagnetic field exactly as a rock thrown into a lake agitates the water creating ripples. This field is called the channel since it carries the signal from the transmitter (TX) to the receiver (RX).Some distance away, the ripples in theelectromagnetic field move electrons in the receive antenna. Electrons moving is also called electric current. This current is coupled into the receiver and converted from the radio frequency back down to baseband. The resultant signal is (hopefully) just like the original input signal (such as music or voice) that entered the transmitter. Of course anynoise, distortion, or interference from the channel will have been added.When bidirectional communication is desired, each side includes both a transmitter and a receiver. The combination is called a transceiver. In practice, the process of converting the input signal into a radio frequency (RF) signal can mean many different things and is actually anentire field of study. While some radio communication systems, such as 4G mobile phone data, are incredibly complicated, traditional AM/FM commercial radio is comparatively quite simple. Skip to main content Your IP address is 95.216.12.141 Troubleshooter page Scroll to the top of the page. Arduino Projects for Amateur Radio This pageintentionally left blank Arduino Projects for Amateur Radio Dr. Jack Purdum, W8TEE Dennis Kidder, W6DQ New York Chicago San Francisco Athens London Madrid Mexico City Milan New Delhi Singapore Sydney Toronto Copyright 2015 by McGraw-Hill Education. All rights reserved. Except as permitted under the United StatesCopyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher, with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced forpublication. ISBN: 978-0-07-183406-3 MHID: 0-07-183406-0 The material in this eBook also appears in the print version of this title: ISBN: 978-0-07-183405-6, MHID: 0-07-183405-2. eBook conversion by codeMantra Version 1.0 All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of atrademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and salespromotions or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com. McGraw-Hill Education, the McGraw-Hill Education logo, TAB, and related trade dress are trademarks or registered trademarks of McGraw-Hill Education and/or its affiliates in the United States and othercountries and may not be used without written permission. All other trademarks are the property of their respective owners. McGraw-Hill Education is not associated with any product or vendor mentioned in this book. Information contained in this work has been obtained by McGraw-Hill Education from sources believed to be reliable. However,neither McGraw-Hill Education nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw-Hill Education nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw-Hill Educationand its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. TERMS OF USE This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of thiswork is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it withoutMcGraw-Hill Education’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NOGUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-HillEducation nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or itslicensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort orotherwise. Jack Purdum: To Hailey, Spencer, and Liam Dennis Kidder: To Helen and Bud This page intentionally left blank About the Authors Dr. Jack Purdum, W8TEE, has been a licensed ham since 1954 and is the author of 17 programming books. He retired from Purdue University’s College of Technology where he taught various programminglanguages. Dennis Kidder, W6DQ, has been a licensed ham since 1969. He is also an electrical engineer with a distinguished career in major engineering projects throughout the world, working for companies such as Raytheon and Hughes. This page intentionally left blank Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Which Microcontroller to Use? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 We Chose Arduino, So Now What? . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 InterpretingTable 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Making the Choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 What Else Do You Need? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Downloading and Installing the ArduinoIntegrated Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Installing the Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Running Your First Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 I Don’t Know How to Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 I Don’t Need No Stinkin’ CW! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Like CW, Like Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 The Five Program Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Step 1. Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Step 2. Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Step 3. Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Step 4. Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Step 5. Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Arduino Programming Essentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 The Blink Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Data Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Where’s the main() Function? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 The setup() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 The loop() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 I Thought There Were Five Program Steps? . . . . . . . . . . . . . . . . . . . . . 26 Modifying the Blink Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Saving Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Remove Unused Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Use a Different Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Avoid Using the String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 The F() Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ix x C o n t e n t s The freeRam() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3 The LCD Shield Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Libraries: Lessening the Software Burden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Not All LCDs Are the Same . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 LCD Shield Parts List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Assembling the LCD Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Breakaway Header Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Soldering Components to the Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Adding Components Using a Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 An Alternative Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Loading the Example Software and Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 A “Code Walk-Through” of the “HelloWorld” Sketch . . . . . . . . . . . . . . . . . . . 56 Explore the Other Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Using Your LCD Display with the TEN-TEC Rebel . . . . . . . . . . . . . . . . . . . . 59 Under the Rebel Hood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Software Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4 Station Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 SoftwareVersion of ID Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Magic Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Preprocessor Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Fixing Bad Magic Numbers: #define . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 A Second Way to Remove MagicNumbers: const . . . . . . . . . . . . . . . 73 Fixing Flat Forehead Mistakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Encapsulation and Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Fixing Our Program Bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 The static Data Type Specifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Using a Real Time Clock (RTC) Instead of a Software Clock . . . . . . . . . . . . 78 The Inter-Integrated Circuit (I2C or I2C) Interface . . . . . . . . . . . . . . 78 The I2C and the DS1307 RTC Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 BCD and the DS1307 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Constructing the RTC/TimerShield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 The Adafruit RTClib Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Initializing the RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Running the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 The RTC Timer Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 The loop() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 A Software Hiccup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5 A General Purpose Panel Meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101Circuit Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 An Alternate Design Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Loading the Example Software and Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Contents xi CodeWalk-Through . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Instantiating the lcd and lbg Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 The loop() Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Testing and Calibration of the Meter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Changing the Meter Range and Scale. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Voltmeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Ammeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Changing the Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6 Dummy Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Mechanical Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Resistor Pack Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Fabricating the Lid Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Attachingthe Lid to the Resistor Pack . . . . . . . . . . . . . . . . . . . . . . . . . 123 Electronic Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Doing the Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 7 A CW Automatic Keyer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Required Software to Program an ATtiny85 . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Connecting the ATtiny85 to Your Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 The Proper Programming Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Some Things to Check If Things Go South . . . . . . . . . . . . . . . . . . . . . 137 Using the Digispark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Compiling and Uploading Programs with Digispark . . . . . . . . . . . . . 140 The CW Keyer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Adjusting Code Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Capacitance Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 The volatile Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 8 A Morse Code Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Hardware Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Signal Preprocessing Circuit Description . . . . . . . . . . . . . . . . . . . . . . . 157 Notes When Using the Decoder with theTEN-TEC Rebel . . . . . . . 159 Decoder Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Search a Binary Tree of ASCII Characters . . . . . . . . . . . . . . . . . . . . . . 160 Morse Decode Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Farnsworth Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 9 A PS2 Keyboard CW Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 The PS2 Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Testing the PS2 Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 The PS2 KeyboardEncoder Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Adding the PS2 Library Code to Your IDE . . . . . . . . . . . . . . . . . . . . . . 176 xii C o n t e n t s Code Walk-Through on Listing 9-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Overloaded Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 The sendcode() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Some Bit-Fiddling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Isolating the Arduino from the Transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Other Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Change Code Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Sidetone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Long Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 10Project Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Integration Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 The Real Time Clock (RTC) Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 CW Decoder Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 PS2Keyboard Keyer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 The Expansion Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Software Project Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 C , OOP, and Some Software Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 206 C HeaderFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Class Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 public and private Members of a Class . . . . . . . . . . . . . . . . . . . . . . . . . 209 Function Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 cpp Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Class Constructor Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 IntegrationCode.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 How the Terms Class, Instantiation, and Object Relate to One Another . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 The Dot Operator (.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 The loop() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 11 Universal Relay Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Circuit Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Construction of the Relay Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222Testing the Relay Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Test Sketch “Walk-Through” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 12 A Flexible Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Just What Is aSequencer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 The Sequencer Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Contents xiii Constructing the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 A Purpose-BuiltSequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Programming and Testing the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Initial Testing of the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Loading the Sequencer Program and Testing . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Sequencer Code “Walk-Through” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 Modifying the Sequence Order and Delay Time . . . . . . . . . . . . . . . . . 239 Configuring the Jumpers for Different Situations . . . . . . . . . . . . . . . . 239 Modifying the Relay Shield from Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Alternate Listing for the Relay Shield Sequencer . . . . . . . . . . . . . . . . 241Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 13 Rotator Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 The Arduino Antenna Rotator Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Supported Rotators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Relay Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Panel Meter Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 The Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Adding the I2C Interface to the Relay Shield from Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Connecting theRotator Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Early Cornell-Dublier Electronics (CDE) Models . . . . . . . . . . . . . . . . 257 Later Models from HyGain, Telex, and MFJ . . . . . . . . . . . . . . . . . . . . 258 Yaesu Models G-800SDX/DXA, G-1000SDX/DXA, and G-2800DXA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 Arduino Beam

Arduino Projects for Amateur Radio is filled with step-by-step microcontroller projects you can accomplish on your own--no programming experience necessary.After getting you set up on an Arduino board, veteran ham radio operators Jack Purdum (W8TEE) and Dennis Kidder (W6DQ) start with a simple LCD display and move up to projects that can add .