I hear that you got a software-defined radio. In this presentation, you will learn how to make one of your own antennas to use with your new SDR. Welcome to the DEF CON RF Village presentation. I'm Erwin Karinczik, a cybersecurity researcher, and I will show you several methods to make an antenna using easily accessible materials and open source software. Previous researchers with published works in the wireless and software-defined radio, or SDR domain, have all expressed that using a higher gain directional antenna would improve distances at which the desired application could be executed. The antennas that these researchers have used were mainly commercially purchased monopoles and dipoles, which have a relatively low gain. Other antennas that were used are common TV antennas called Yagi-Uda antennas, which have a much higher gain, but they have impedance of 75 ohms, while most SDR hardware has impedance of 50 ohms. Without a specific impedance matching circuit, this mismatch causes a significant amount of reflection, and because of that, original high gain of the antenna is drastically reduced. This will be discussed in the later part of this presentation. In the meantime, the focus of this presentation addresses a lack of readily accessible, high gain directional antennas operating at frequencies of interest. SDR is a radio communication system which uses software for modulation and demodulation of radio signals. SDRs can be reconfigured for a wide range of frequencies as noted in this table. Despite the software reconfiguration ability, all applications using SDRs require different antennas to operate efficiently at specific frequencies, which are the subset within the supported range of the SDR. However, a problem occurs when the researcher performs an assessment of a device and requires the use of a specific frequency for which an antenna with high gain is not readily available. Antennas included in SDR kits such as the HAKRF by Great Scott Gadgets and the USRP B210 from Edis are monopoles and dipoles. We can see that they are omnidirectional and that they have about 3 dBi gain. Now we will discuss what exactly that means in the following two slides. In order to understand what omnidirectional is in terms of gain, we have to first cover directivity. Directivity is a ratio between an antenna's radiation intensity in a given direction and radiation intensity average over all directions. On the screen, we can see two antennas. One is omnidirectional, which radiates in all directions around the antenna in a donut shape. On the right hand side, we see a directional antenna that primarily radiates in one direction, which is the z direction in this case. Next, we will discuss what gain means. Gain is a measure of power radiated in a particular direction. The decibel is a logarithmic unit used for describing a ratio. The increase of every three decibels means that the value has doubled. In this case, we have DBI, which is slightly different. It shows a value in decibels by which the antenna gain is higher than that of an isotropic antenna. The isotropic antenna, shown on the right, is a hypothetical antenna that has the same radiation in all directions from one point, the red point in this case. This is different from omnidirectional, since this one radiates perfectly in all directions, while omnidirectional has a donut shape. DBI is used as a simplified estimation analysis and provides a reference point for comparison of different antennas. On the top of this table, we see loops, dipoles, and monopoles, which have a gain of 5 DBI or less. A theoretical halfway dipole has a gain of 2.15 DBI. Then we have microscript patches, which are directional, and they have a gain between 5 and 8 DBI. Then, higher gain are antenna arrays such as Yagi-Uda, which provide 8 to 15 DBI. Lastly, we have horns and reflectors, which have higher than 15 DBI gain. Now that we know the basics of antennas, the solution to the problem of not having a high gain antenna at specific frequency is that if we can make patch antennas with directional gain between 5 and 8 DBI, which would be higher than that of any of the regular dipole antennas, this presentation focuses on bridging that gap by providing a way for researchers to create their own patch antennas without deep electrical engineering experience using the tool created as part of this presentation. So who am I and how can I help with this solution? I'm a senior security consulting engineer for Cisco Systems, primarily working on assessing security of IoT devices. I'm also a PhD student at Virginia Commonwealth University. I have prior experience in reverse engineering, exploit development, pentesting, TCP IP networking, and over the past few years, software-defined radios. I have a number of high-value certifications such as CCIE enterprise infrastructure and all of the five old offensive security certifications, OSCP, OSCE, OSWP, OSWE, and OSEE. I'm also part of the WhatTheFreak CTF team. We won last year's DEFCON RCTF. Hopefully we win this year again. Special acknowledgments for this presentation go to Jonathan Lundquist and Lauren Lincolns, who were instrumental in assisting me with fabrication. We all work under our advisor, Dr. Erdem Topsikal, who provided expert guidance on this project. So now the first question that we need to ask is, what even is an antenna? An antenna is a device that is used to efficiently transmit and receive electromagnetic waves. The key word here is efficiently. The history of antennas started with James Clerk Maxwell, who unified the theory of electricity and magnetism, formulating Maxwell's equations. The journey then takes us to Heinrich Rudolf Hutz, who demonstrated the first wireless system by observing a spark between a dipole and a loop antenna. Following that demonstration, a true advancement happened when Guglielmo Marconi sent the first transatlantic transmission between England and Canada in 1901, creating a monopole operating at 500 kHz. The World War II era introduced more antennas, many of which were aperture type antennas used for communication, radar, remote sensing on both earth and air platforms. Radar was discovered in 1904 by Christian Hutzmeier to detect ships, but it failed to generate interest. The U.S. Naval Research Laboratory, during testing in 1922, discovered that radio waves could be used to detect the presence of enemy ships. However, only in 1935, Robert Watson Watt built the first practical radar system. The 1960s had advancements in satellite communication. Microscript antennas became very popular in the 1970s for spaceport applications. Today, they are used for all kinds of commercial and government applications. The 1980s had a widespread use of cellular telephones which was enabled by a form of patch antenna called a planar inverted F antenna, or PIFA antenna. Common antenna types are following. Wire antennas such as dipoles, loops, and helix antennas are familiar to all people as they are seen everywhere, on buildings, cars, ships, airplanes. The microscript antennas were originally used for space applications in the 1970s, but due to the ease of analysis and fabrication, they are used on satellites, airplanes, ships, cars, and mobile devices. Antenna arrays use multiples of other antenna types to create higher gain and directivity compared to just one antenna. Aperture antennas such as waveguides and horns are seen on most space and airplane applications. Reflector antennas look like common satellite antennas. They were the reason for major success in communication with outer space. Dipole antennas, shown on the right side, consist of two equal length conductors fed by a transmission line. The half wave dipole is one of the most common ones and it is named such because it is half wavelength long. The wavelength for a certain frequency is calculated by the formula on the right. It is equal to the velocity, which in this case would be speed of light, divided by desired frequency. Dipoles have an omnidirectional radiation pattern and their communication could be described by the diagram shown on this slide. Next, we will talk through the design of a dipole antenna for a local TV. This includes looking up the frequency of local broadcast, which is 560 megahertz, then using antenna calculator tool and specifying half wave dipole and frequency of 560 megahertz. We get a total dipole length of 26.79 centimeters and each element is half of that, which is 13.39 centimeters. On the right, we see an antenna that was built and attached to the TV and that local signal was received. The part right below the dipole elements is a ballon, which is an electrical device that allows balanced and unbalanced lines to be interfaced without disturbing the impedance arrangement of either line. Dipoles are normally low gain, but if they are set up in an array, then they can have higher and more directional gain. Most people can recognize Yagi-Uda antennas due to their frequent use as a TV antenna. The reflector, of which there's usually only one, is made 5% longer than the dipole and its goal is to reverse direction emitted from the rear of the antenna. Directors, which are 5% shorter than the dipole, focus energy from the front of the antenna. Adding more directors is effective, but eventually the antenna can become too large. The interesting note with dipoles and Yagi-Uda antennas is that their impedance is 75 ohms compared to the 50 ohms of software-defined radios. Some people have used Yagi-Udas in their experiments directly, but the issue there is with mismatch impedances. The gain will be much lower and the equipment can be damaged with bad mismatch if too much power is reflected back to the SDR. The reflection coefficient with the 50 ohm transmission line outlined by Z0 and 75 ohm antenna outlined by ZL would be 20%. This means that the gain of 8 and 12 decibels will be lower. This issue can be solved by matching transmission lines with various methods, but that will not be discussed in this presentation. Our main demonstration of this presentation are patch antennas. Patch antennas are low-profile, simple, inexpensive to manufacture, and have high gain and directionality. There are many types of patch antennas and this presentation will cover a rectangular patch antenna as that is the simplest to calculate and fabricate. This section will cover how to mathematically calculate width and length of the patch as well as the feed point of the SMA connector. We will be covering the transmission line model which is the easiest to calculate but is slightly less accurate compared to more complex models that require the use of very powerful simulation computers. It does, however , get relatively close to the required design and requires only a few small changes to get desired results. We will be given a frequency, the electric constant of the substrate, and substrate height. The most commonly used substrate is FR4 which is used for PCB applications. It has a dielectric constant of 4.4 and a typical height of 1.6 millimeters. The electric constant is defined as the ratio of the electric permeability of the material to the electric permeability of the free space. Other than the material, the only part that one has to choose as part of the design is the desired frequency. Important mention is that the fields at the edge of the patch undergo fringing. While the effects are limited, this needs to be accounted for in the calculations. Next, we can calculate the widths of the patch with the following formula. V0 in most cases will be speed of light, ER is the dielectric constant, and FR is the frequency. Effective dielectric constant is the dielectric constant of the uniform dielectric material so that the following figure outlining the effective dielectric constant has identical electrical characteristics as the actual line shown below. Due to the fringing effects mentioned earlier, electrically the patch looks greater than the physical dimensions. Next, we will cover strip line width calculation. First, we calculate A and then use it in the equation on the right. And if WS over D is less than 2, then we use that strip width outlined by WS. Otherwise, we would calculate B and use it in the longer equation below. One of them would be true, but never both. Now that we know the width, we just need to calculate the inset. This is the same for both microstrip and probe fed antennas. This is the spot where impedance is 50 ohms so that it will match the transmission line which is also 50 ohms. We went through the math just to have complete understanding, but the math in previous slide was automated in an antenna calculator on the rectangular patch. In this tool, the required antenna type specifications at this time can be either microstrip or probe fed. Next, we specify the desired frequency and substrate material properties. Using an example of 2.4 gigahertz with FR4, we get all of the necessary values to design a patch shown in the bottom right-hand corner. If we use the verbose option, then additional calculations are shown which are intermediate calculations based on the formulas outlined in the earlier part of the presentation. In this presentation, following manufacturing methods will be outlined. Copper tape method, chemical etching, PCB milling, CNC method, and lastly professional fabrication. The first method of manufacture is the simplest one. The main materials needed are copper tape, single-sided FR4, and an SMA connector. Using the antenna calculator with PNG output will provide a picture in the size of a letter paper that can be printed out. It is also to scale. Taping the printed patch to the copper tape and then cutting them both will save a lot of time since one does not need to draw the calculated measurements on the copper tape before cutting it. Once the tape has been cut, it can be attached to the substrate. An SMA connector is attached to the bottom of the the center pin has to touch the microstrip line and it should be soldered. Next method is chemical etching. This is very dangerous and it is important to follow all necessary precautions when working with acid. This includes the use of gloves for handling hazardous chemicals and the use of a fume hood or do the experiment outside with appropriate respiratory protection. The materials needed for this method are muriatic acid, hydrogen peroxide, double-sided FR4, SMA connector, iron, laser printer, vinyl backing and optionally nail polish and a thermometer or thermal camera. The first step is to use the antenna calculator with PNG output in the same way we have just used it before. The patch is first printed on regular paper then the vinyl piece is removed from the backing and the backing is attached glossy side up on masking tape where the antenna was printed. The paper is then placed back in the printer's import tray and it is reprinted when the printer prints directly to the vinyl backing. A new template is then removed from the paper and cut down to appropriate size. This part provided the material for all fabrication methods. Double-sided FR4 has been purchased. The thickness is measured. This is very important since the nominal 1.6 millimeter is not always accurate due to manufacturing tolerances but in this case it was accurate. The pieces for various experiments were measured and cut with large metal shears. After that an iron was turned on to preheat. Using a thermostat or a FLIR camera iron temperature can be checked and it should be between 140 and 158 degrees Celsius. The temperature does not need to be exact. Attempt the process at the middle range temperature and if it doesn't work then make the iron hotter. Next we take the printed patch to the FR4. We then place it under the iron then place the parchment paper on top and iron for about two to three minutes. During those two to three minutes pressure should be applied across all of the backing so that it all transfers evenly. Once the time has passed the iron can be removed. A flat surface should be placed on top and a weight should be placed on that flat surface to hold the backing down while it cools. After about two more minutes the weight can be taken off and vinyl backing can be peeled which should reveal that the transfer succeeded. The same exact method can be used for microstrip patch printing into the vinyl backing and ironing and then completing the design. Next is the back of the substrate. We can either use the same method to transfer the black coat or we can just use nail polish. It should be just a single coat but at the same time no copper spots should show through it. The nail polish that is necessary for this application is a nail enamel which means it is just acrylic. It is important because some nail polish needs to be UV cured to set. Usually cheap nail polish is the one that we need. Next we get to the chemicals. To reiterate again it is very important to take safety precautions when working with chemicals. The most important parts are to use gloves for handling hazardous chemicals, also use goggles and have good ventilation as well as respiratory protection. It is also highly recommended to have a person spotting in case a spill happens and a medical emergency occurs. For the actual experiment use a plastic container and put one-third muriatic acid and two-thirds hydrogen peroxide. The mixture is clear but as soon as copper is placed it will start eating it away and become blue. If the mixture becomes green that means it is becoming saturated and more mixture should be added. In about two minutes all of the unprotected copper will be removed. The acid should be rinsed well with water from both the patch and the gloves at which point gloves should be removed and thrown away. The nail polish and toner should be removed using acetone which will expose the copper. After that one should cut two of the four SMA connector legs and the SMA connector should be attached as shown in the picture. After that solder should be applied to the two legs on the background plane and the center pin on the front. It is important not to solder center pin to the edges of the SMA connector or you will electrically short the connection. For probe fed antennas a hole needs to be drilled into the antenna. Using a drill and a marked spot a hole should be drilled. After that SMA connector should be connected and soldered on both sides. The top of the pin should be cut off. PCB milling method involves the use of a PCB prototyping machine. Additional parts needed are double-sided FR4 and SMA connector. This specific mill supports DXF format for importing files and works best with millimeters which is why that is the specified as the unit. Different mills have different requirements and not all of them support a wide range of units so one needs to verify what exactly is supported and export with supported units. Using LibriCAD we can see that both designs in DXF show both of the patches accurately. We start the LPKF CircuitProbe program which initializes the connection to the mill. Here we go to templates and specify single-sided top. We then go to file import and specify our DXF file in millimeters. Under layer templates we change it to top layer and we verify that the imported units are indeed in millimeters. We then select the patch and convert lines to a polygon followed by assigning the object to layer top layer. After that we click on the outline and assign objects to layer and specify board outline. Next we go to toolpath technology dialog. Under isolate we specify complete rubout and under contour routing we specify corner gap. We click start. That calculates how to complete the milling process and it determines which tools are required and whether they are in the machine at that time. We can see here that different tools will be used for different parts of the process indicated by different colors. Now we go to the wizard's board production wizard. At this point we mount the FR4 in the mill and secure it with tape. On this screen we set copper thickness to 75 micrometers which is a bit higher than the actual but that will account for any imperfections. The copper thickness needs to be set deep enough that the end mill will remove all of the excess surface copper. At the end the mill will go through the FR4 and into the sacrificial board underneath to ensure a clean cut around the edges. We click continue. On the next screen we have the center placement which in this case is exactly where the specific point is located. So we just click set center to ensure it still starts there. We'll also save the document in case we need to redo this part at some point. Now the mill does the tool exchange and the tool adjustment followed by a warm-up of the spindle motor. At this point mill goes through the process and completes the milling. At the end we just need to solder the SMA connector using the same method as in the chemical etching process. In order to have a variety of tests we found that the university workshop in the library has Inventables X-Car CNC machine. We asked if we could use it for a conference to make an antenna. The manager Ken Hobson was very helpful and assisted us with a very short deadline. This machine uses DeWALT 611 and it can certainly be used for this purpose. End mill bits are different from common drill bits in that they are used on top of the material rather than drilling straight through it. The cost of this mill is about $2,600 and cost of the enclosure in the vacuum is between $500 and $1,000. All of it is open source and a machine like this could likely exist in a local makerspace. The ESOL software used with the CNC machine uses inches as units so DXF file was generated with inches as the unit. This machine is slightly different from the specialized PCB milling machine in that it only uses one tool for the entire design at a time. Multiple tools can be used but the design would have to be broken up in multiple projects which use different end bits for different parts of the project. In this case due to limited time availability before the conference only the probe fed design was milled out with the CNC machine which did not require different end bits. This is the ESOL software. It uses a DEWALT 611 router as shown here. Under general settings we can see different settings for the CNC machine. Under material we specify PCB which is FR4. The cut FR4 was measured and the units were placed under width length and thickness. A comment on the 1.5 mm thickness is that it was found to work better for this specific setup even though the material was measured to be 1.6 mm. The bit used here was 1 16th of an inch. The following settings were experimentally determined for the feed rate and plunge rate. Now the copper thickness is in reality closer to 0.04 mm but on this setup a higher number was used due to an older drill bit so maximum in this case would be 0.25 mm and the x-axis option was found to work best and it was used for the fill method. We then import the DXF file with lines joined and on path. We then move it slightly offset selecting the outline and specifying depth as 0.2 mm. Making a clear out pocket as well as sending it to the back will ensure that the copper is removed. Next is the patch which will also clear out a pocket but with 0 mm as we do not want that part touched. Last part is the probe feed. It currently does not show up so it needs to be adjusted to 0.6 by 0.6 mm so we can see it. But as our bit is a bit bigger than that hole we'll remove it and drill it manually. Now we can start the process of carving. We measure the thickness and clamp down the material as well as confirm the bit. In order to confirm a new work zero we use the keyboard and move the router with appropriate intervals between 0.01 and 10 mm. The bit needs to touch the substrate. A trick is to use a piece of paper and adjust by 0.01 until the paper cannot be moved. We then raise it by 0.01 and lower it down again with the paper removed. We then confirm the new position and raise the bit. Once the bit was raised we can turn on the spindle and inspect it. We say that it's on and we let it carve. Now we can see that it did not drill deep enough. So we stop it and adjust the depth by 0.1 mm which is the minimum that we can adjust it by on both cut of the substrate and cut settings. We go through the same process and use the last position for the home location. Now this one did not do a good job as well since it missed a part. We stop it again and adjust it by 0.1 mm again. Now it does a really good job. It completed the milling process successfully. The part here that I wanted to show is the troubleshooting process rather than trying a bunch of times until it worked perfectly with 0.1 or 0.2 mm which is the ideal sort of part. The issues can be uneven sacrificial boards underneath, uneven clamping, potentially a different bit that was required and many other issues that are commonly encountered when using a mill. The last fabrication method is the professional fabrication such as one offered by Oshbar. They offer three copies for $5 per square inch. The supported files are KiCAD, EagleCAD, and Gerber. I'm not sponsored by them. I'm just showing one of the examples that was recommended to me. These formats are currently not supported due to time limitations but it is planned in future releases of this tool. A workaround is that DXF files can be converted using KiCAD 6 PCB editor. Using the antenna calculator by specifying meter as the unit of measurement is how the DXF file is generated. Within the PCB editor under file import graphics is where DXF file is imported. Interactive placement is selected and import scale is one and all of the other units are in millimeters. This will appropriately import the patch with accurate millimeter dimensions. From here we can export it as a KiCAD model or Gerber which can be used at the website previously mentioned. After the antenna is built it should be measured and evaluated whether it matches the original design. As mentioned previously the transmission line model that is used here is the easiest to calculate but it is slightly less accurate compared to more complex models. This is where for a given frequency small changes may be necessary to get it to perform exactly as expected. On the left we have the S11 parameter which shows the reflection coefficient. The lower the number the better the antenna performs at that frequency. In order to be considered an antenna at that frequency it has to be at least negative 10 dB. On the right hand side we have measured the gain of the antenna in an anechoic chamber and found it to be 5.12 dBi. This same measurement can be done using two nano VNAs with identical patch antennas separating them exactly by a meter and using Friis equation to calculate the gain. If both antennas are exactly the same an assumption can be made that both of them have the same gain which will simplify the equation. In this case you can use the calculator and match both antenna gains in order to get the observed power received which will be known. It is important to check your local laws for transmission rules. The ISM bands can be used without a license so one can transmit and receive at those frequencies in most countries. If one is attempting to test a device at very specialized frequencies then the use of an anechoic chamber is suggested. An anechoic chamber is a shielded room that has radio wave absorbing material applied to wall ceiling and floor so all the transmissions stay inside the chamber and at the same time the chamber is shielded from outside interference. In conclusion the presentation showcased an antenna calculator that can help antenna design and several fabrication methods. Rectangular patch antennas are simple and easy to manufacture. I encourage you to try some of these manufacturing methods and make your own antennas. The only thing that I ask is that you share with the community and if throughout the process you have any additional requests or ideas feel free to make an issue or a pull request and I will be happy to look into it and further improve it. Here are some of the references and some specific books that I used to generate some of this presentation and of course if you have any questions feel free to post them in the comments and I will try to answer them to the best of my ability. Thank you so much!