How to Use a Directional Antenna with ESP8266-Based Microcontroller « Null Byte :: WonderHowTo

Microcontrollers likeESP8266-based boardshave built-in Wi-Fi, and that's really cool, but what's even cooler is that certain pro models of the D1 Mini also have a port where you can connect a directional antenna. This can give you exceptional range, but if you were to just plug one in after opening the package, it most likely wouldn't work.The problem, as Glytchcovered in a Hak5 videolast year, is that there's a tiny zero-ohm resistor on the board that's connecting the built-in antenna to the chip, but it needs to connect to the external directional antenna. To do so, that tiny resistor needs to be changed to a different pad that connects it to the breakout adapter. So a little bit of surface mount soldering is needed to fix the issue.Things You'll NeedA couple of things are needed to connect a directional antenna to a D1 Mini successfully. First, asoldering station, also known as ahelping hands stand, is needed to hold onto the D1 Mini so that you don't burn yourself in the process or lose anything.Soldering stations can be cheap or a little pricy, and some come with a magnifying glass and light, and some do not. You'll definitely need a magnifying glass for this job, and any of the ones below will work. If you already have an LED light,Neiko'sis a solid inexpensive option.Newacalox'sstand has lots of alligator clips and a magnifier with LEDs that have three different color temperatures but is pricier.Neiko 2-Clip Stand with 2X Magnifying Glass($12)Hi-Spec 2-Clip Stand with 2X Magnifying Lens with LEDs($19.99)Ram-Pro 2-Clip Stand with 3X Magnifier & LED Flex Light($14.99)Newacalox 5-Clip Stand with 3X Magnifying Glass with 3-Color LEDs($40.99)The Ram-Pro model has 3x magnification and flexible light.Image by Ram-Pro/AmazonFor many, the magnifying glass may not be powerful enough to see the components clearly on the board. If you think that'll be you, you could also geta digital microscopewith a miniature camera so that you can display it on a computer monitor. I use a Jiusion 40–1,000x digital microscope, but there are others you could shop for.Jiusion 40–1,000x Digital Microscope with OTG Adapter & Stand($21.99)Image by Jiusion/AmazonSecond, a goodpair of tweezerswill help nudge the resister to the right spot. Third, ahot air rework station with a hot-air gunto heat the solder so that the part can be moved without burning the board. You could try using a soldering iron, but the part that needs moved tends to get stuck to the iron, so a hot-air gun makes it a little less difficult. The Newacalox hot air rework stationthat I usedcomes with a couple of tweezers too, and there's a newer version of it for the same price.Newacalox NEW-858D Hot Air Rework Station with Hot Air Gun($49.99)Newacalox OLD-858D Hot Air Rework Station with Hot Air Gun($49.99)The new model of the 858D rework station.Image by Newacalox/AmazonNext, you need an ESP8266-based D1 Mini Pro microcontroller that has a breakout adapter.This onefrom Reland Sung on Amazon has the cable and antenna connector needed. It also has an antenna, but it's not the directional antenna we will be connecting today.WEMOS D1 Mini Pro with External Antenna Connector($11.05)The directional antenna I'm using is an Alpha brand panel antenna. Check out ourantenna picking guideanddirectional antenna overviewto learn more about directional antennas and the ones available.Alfa RP-SMA 7 dBi Panel Antenna($10.99)Step 1: Place the D1 Mini in Your Helping HandsBefore you do anything, clamp in your D1 Mini board with the alligator clips on the soldering stand. Make sure the board is positioned with the right side up. Get some lights on it to see and position the magnifying glass so you can see the smaller parts of the board easily. If you're having a hard time seeing the components on the board, you may need to geta digital microscope with more magnification.Step 2: Locate the Zero-Ohm ResistorOn your D1 Mini, find the zero-ohm resistor for the antenna. It should look like the one below. The resistor is soldered to the internal antenna on the left side, but it needs to be moved so that it's soldered to the empty pad on the right, which leads to the adapter port. As it is now, our external directional antenna would be completely cut off from the microcontroller when connected.To fix it, we'll need to desolder the resistor from the internal antenna pad (1 in the picture above) and input pad (2 above) and resolder it to the input pad (2 above) and the external antenna pad (3 above).Step 3: Heat Up Your Hot Air GunTo move the resistor, get your hot air rework station ready to go and heated up. Use the knob to adjust the amount of air that flows through and the temperature buttons to get it up to the right temp. It's similar to a soldering iron where you'll only want to apply the necessary heat to the solder with the hot air gun. I set my gun to 290-degrees Celsius (554-degrees Fahrenheit).Step 4: Heat the Solder & Remove the ResistorWhen you pick up the gun, it should automatically start so that you can use the hot air to melt the solder. Point the hot air gun over the board to heat the solder at the resistor so that it's warm, but keep an eye on the board in the magnifying glass or microscope to make sure there is no burning happening.Go back and forth to make sure you're heating all the solder under it, then get closer with the gun to apply some more direct heat to melt the solder. You'll notice that the flux will start to go a bit until the solder melts. Just make sure you're careful, as the hot air gun could actually blow away the resistor if you're applying too much air to it.When it's melted enough, use a good pair of tweezers to pull the resistor from the pads gently. It's delicate work, so be very careful the resistor doesn't fly off the board where you'll never be able to find it.Step 5: Replace the Resistor to Connect the External AntennaNow, keep applying heat to the solder to get the pads for the input and breakout adapter for the external antenna. Then, very carefully rest the resistor you pulled onto the correct pads. It doesn't have to be pretty, just as long as there's a good connection.Step 6: Heat the Solder Joints Again to Create a CircuitFor good measure, heat the solder joints again to make sure there's a good connection. Then, let it dry a bit so that there's a solid lock on the pads. Once it dries, try moving it with the tweezers to make sure it's steady. If not, heat it again and position it better.Step 7: Test Out Your Directional AntennaNow it's time to test out the board and antenna. Attach the breakout cable to the board and your directional antenna to its adapter. Next, test your work by plugging the board into a Micro-USB cable to a power supply to create a hotspot with the board. If you haven't already, check out our guide oncreating a D1 Mini test network for hackingto turn it into a hotspot you can connect to.After plugging it into a power supply and creating a hotspot, use a computer withWiresharkon the other side of the room to detect whether or not there's a signal spike when moving the directional antenna back and forth. If it were an omnidirectional antenna, you would see a steady signal, but there should be a big spike when you point your directional antenna directly to the computer.Exceptional RangeAdding a directional Wi-Fi antenna to a D1 Mini can give your project an exceptional range. If you were to make this modification on two separate ESP8266-based boards and put them a couple of miles apart, you would probably be able to get your devices to connect far beyond the traditional range you would expect for this little IoT board.Just keep in mind that it's really easy to accidentally blow away the little zero-ohm resistor while fixing the board. So if you're using a hot air station that's not adjustable, make sure that you're doing the work very carefully, heating the board slowly, because it's really annoying to have this thing of flying off into nowhere land.Don't Miss:Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test NetworkWant to start making money as a white hat hacker?Jump-start your hacking career with our2020 Premium Ethical Hacking Certification Training Bundlefrom the newNull Byte Shopand get over 60 hours of training from cybersecurity professionals.Buy Now (90% off) >Other worthwhile deals to check out:97% off The Ultimate 2021 White Hat Hacker Certification Bundle99% off The 2021 All-in-One Data Scientist Mega Bundle98% off The 2021 Premium Learn To Code Certification Bundle62% off MindMaster Mind Mapping Software: Perpetual LicenseCover photo and screenshots by Retia/Null ByteRelatedHow To:Change a Phone's Coordinates by Spoofing Wi-Fi Geolocation HotspotsHow To:Scan, Fake & Attack Wi-Fi Networks with the ESP8266-Based WiFi DeautherHow To:The Hardware Hacker's Introduction to Microcontrollers, Part One: Anatomy of an ArduinoHow To:Pick an Antenna for Wi-Fi HackingHow To:Program an ESP8266 or ESP32 Microcontroller Over Wi-Fi with MicroPythonHow To:Get Started with MicroPython for ESP8266 MicrocontrollersHow To:Inconspicuously Sniff Wi-Fi Data Packets Using an ESP8266How To:Hunt Down Wi-Fi Devices with a Directional AntennaHow To:Control Anything with a Wi-Fi Relay Switch Using aRestHow to Hack with Arduino:Building MacOS Payloads for Inserting a Wi-Fi BackdoorHow To:Build an eco-friendly directional WiFi antennaHow To:A Hacker's Guide to Programming MicrocontrollersHow To:Create Rogue APs with MicroPython on an ESP8266 MicrocontrollerHow to Hack Wi-Fi:Getting Started with Terms & TechnologiesHow to Hack with Arduino:Tracking Which Networks a Mac Has Connected To & WhenHow To:Safely Launch Fireworks Over Wi-Fi with an ESP8266 Board & ArduinoHow To:Extend Your Wi-Fi Signal with This Super Cheap and Easy-to-Make Directional Biquad AntennaHow To:Create cheap WiFi antennas for better receptionHow To:Buy the Best Wireless Network Adapter for Wi-Fi Hacking in 2019How To:Increase Your Xbox 360 WiFi rangeHow To:Do the Assembly of an UHF AntennaHow To:Hack 5 GHz Wi-Fi Networks with an Alfa Wi-Fi AdapterHow To:Make music with a microcontrollerHow To:Crack WPA & WPA2 Wi-Fi Passwords with PyritHow To:TAP Card Dissolved! How to Use Acetone to Transfer an RFID Tag to Your PhoneHow To:Build a cantenna, a can-based DIY wifi antenna to boost your wireless signalHow To:Program PIC microcontrollers in OS XHow To:Use Directional Swipes to Unlock Your Galaxy S6 with the Hidden 'Direction Lock' FeatureHow To:Install memory in a 2009 Mac MiniHow To:Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test NetworkHow To:Wardrive with the Kali Raspberry Pi to Map Wi-Fi DevicesHow To:Build a $20 Super Antenna for Better Signal Strength & More Free Broadcast TV ChannelsHow To:Embed lights into a colorful brooch with LilyPadHow To:Embed lights into a backpack for safety with LilyPadHow To:Embed lights into fabric and clothes with LilyPadNews:HAM and CB AntennaNews:Let yourself In with this Hacked Morse Code Door Buzzer!How To:High Voltage Happiness? How to Make a Negative Ion GeneratorHow To:Design Your Own Custom Arduino Board MicrocontrollerHow To:Build a Wireless Energy Transfer Array to Power Light Bulbs Without Plugging Them In