I built a whole-home ad blocker with a $7 ESP32-S3 board – and it only took minutes

No coding required. Just upload the existing code to the ESP32-S3.
Adrian Kingsley-Hughes/ZDNET
Follow ZDNET: Add us as a favorite resource on Google.
Highlights taken by ZDNET
- A cheap $7 billboard can turn its hand in ad blocking.
- It works like a DNS sinkhole, removing ads before downloading.
- Other options include using a Raspberry Pi and purchasing hardware.
They say demand is the mother of invention, and rising prices of Raspberry Pi boards I’ve had the kick in the pants I needed to look for a cheaper, maybe even better fitting, alternative. I mean, the Pi is a great board, but for most of the applications I’ve used it for in the nearly 15 years it’s been around, it’s also been overkill.
The other day, I needed to put together an ad blocking solution, not because I don’t like ads, but simply because I was working with limited bandwidth. I instinctively reached for the Raspberry Pi board, but stopped when I remembered how much they cost these days and put it back.
Also: I tested a Bluetooth tracker that uses LoRa mesh networks to locate objects – and it’s very accurate.
I was going to use PiHole on the Pi, but then I remembered coming across an ad-block project that works on an ESP32 board. And the good news is that you can pick up one of these boards for less than $10.
ESP32-S3 (left) vs ESP32 (right).
Adrian Kingsley-Hughes/ZDNET
Introducing the ESP32-S3
There is a big difference between the Raspberry Pi 5 and the ESP32 board (especially the ESP32-S3 board). The Pi 5 is powered by a 2.4 GHz quad-core Arm Cortex-A76 64-bit chip, gigabytes of RAM, and the ability to use microSD or fast NVMe SSD storage, while the ESP32 uses a dual-core Tensilica Xtensa LX7 32-bit processor that can run up to RAM24 MHz, a 25 processor and up to KB. 16MB of flash storage.
Also: I built my own Wi-Fi router with a Starlink Raspberry Pi and a solar controller – here’s how
The Pi 5 can use up to 12 W of power (and that’s before you factor in the various Hats and so on), while the ESP32 board uses milliwatts.
For this project, I’m happy to go with the ESP32, but there are a few compromises I’ll have to live with — more on that later.
What you need
First, you need an ESP32 board. Check out the ESP32-S3 with 8MB of PSRAM (there is a 4MB version as well, but using this board will result in compatibility) than the old ESP32. The ESP32-S3 is fast and very efficient, and you need this power to run ad blocking software. The cheapest way to buy these boards is a 3-packs for $20.
When you get an ESP32-S3 board for the first time, it’s normal to think, “Wow, this is small, there must be more to it,” but there isn’t. It really is a computer you can balance on your finger.
However, you will need a USB-C cable to transfer data and power the board. However, you don’t even need a microSD card for the board to work.
Also: I put a $17 solar panel on my doorbell camera, and it’s my best smart home investment.
Speaking of software, you’ll also need to download ESP32_AdBlocker, which does all the hard work. You will also need the Arduino IDE utility to install the software on the board. Installing the software is easy — configure the Arduino IDE program to work with the ESP32 board, open the product in the app, connect the board to your PC, and click upload.
Note that when you connect the ESP32-S3 board to your computer, it has two USB ports. You want that one marked as COM or USB/Native (looking down on the board with the ports below, this is the port on the right). Or, try a different port.
If you run into trouble, help is endless. One of the biggest problems I find people run into is trying to connect the ESP32 to their computer using only a USB-C charging cable. I also had to deal with the board integration settings in the Arduino IDE software. I’ve added a screenshot below of the settings I used to get things working.
And finally, if you need a case for the ESP32-S3 board, you have options. You can buy one, 3D print oneor do a MacGyver and wrap it up a little electrical tape or large diameter winding tube (about 1.5 inches in diameter).
Setting up the board
OK, so you’ve uploaded the software to the ESP32. Now it’s time to start booting and setting up the board. Your ESP32 board is now a network operator.
On initial startup, the ESP32 starts in Wi-Fi access point mode with the starting address: ESP32_Adblocker_XXXXXXXXXXXX (where each X is an alphanumeric character).
Once you’re connected to Wi-Fi, go to 192.168.4.1 and add the Wi-Fi SSID and password of your router. After another reboot, it’s time to specify the URL of the blocklist you want to use (you can find a large cache of blocklists here), and you’re pretty much done with the board.
We are inside. ESP32_Adblocker has been successfully installed.
Screenshot by Adrian Kingsley-Hughes/ZDNET
Another thing to do is to configure your device to send DNS requests (more on this in a moment) to the ESP32 board. To do this, you need to take that previous address — 192.168.4.1 — and use it as a DNS address. A good way to find out how to do this is to check the excellent CloudFlare documentation for the platforms (remember to set DNS to your ESP32 address, not CloudFlare’s 1.1.1.1 address).
But how does it work?
When you type a URL or click a link, your browser needs to know where that web page resides on the Internet. To get this information, your browser contacts an online directory called a DNS server by looking up DNS (DNS stands for Domain Naming System).
Think of DNS as a phone directory, but for server addresses. A web page, and all parts of that web page — images, any videos or sounds or animated GIFs, and, of course, ads — can be in one place or from different servers scattered around the world. The browser looks up the addresses where all these parts of the web page are stored to create the page it displays.
Now, here’s the clever part. Because you’ve now told your smartphone, PC, or router to ask the ESP32 board for DNS information (which is why you had to change the router’s DNS settings for this method to work), all DNS lookups that occur filter through that ESP32 board first.
Also: My 7 laptop-bag essentials after decades of working remotely
The ESP32_AdBlocker software has an address list of billions of Internet ad addresses, and, quite simply, every time the browser requests something from the blocked list, the software tells the browser that it cannot be found by pointing it to the DNS address 0.0.0.0, and the blocked ad does not load, saving you less Internet bandwidth. If the address is not on that list, the board forwards that DNS lookup to the appropriate DNS server.
Your DNS server is the source of most of the ads you see on the Internet.
There are limitations. For example, the plan does not work with YouTube ads because they are served on the same server and at the same address as the videos you want to watch, so blocking these ads will block the videos. The method also does not work with new IPv6 addresses.
But this project still shows what can be achieved with a small board that costs less than $10.
ESP32-S3 works, filters ads.
Adrian Kingsley-Hughes/ZDNET
It’s not the only option
For the application I needed — a temporary solution for working with a limited bandwidth Internet connection — this method works. And it was one of those fun projects to play with. If I was looking for a long-term solution, or if I didn’t want to add speed to the fastest internet pipeline, Raspberry Pi Zero 2 W using PiHole is a good solution.
Also: I tested a $15 smart switch and found a coffee maker that wastes $1,500 a year in electricity.
But that approach already pushes the cost down to at least $15 for a bare board, and a microSD card. Nothing will require a second mortgage, but a different rate for sure.
You can use PiHome on a completely separate computer, or on a virtual machine on the computer. Or buy an app that supports ad blocking out of the box. But what’s the fun in that? Different horses for different courses.



