Engineer Turns Disposable Vape into Blazing-Fast Web Server with Only 24KB Memory
17 September 2025
11 mins read

Engineer Turns Disposable Vape into Blazing-Fast Web Server with Only 24KB Memory

  • Tiny Chip, Big Ambition: A DIY hacker repurposed the microcontroller from a disposable vape pen (24 MHz Arm Cortex-M0+ with 24KB flash and 3KB RAM) into a working web server tomshardware.com. This microcontroller, a Puya PY32F002B, is extremely low-end – “about 100× slower” than a 10-year-old smartphone by the creator’s own estimate tomshardware.com. Yet, he saw potential for a “blazingly fast” web server despite the paltry specs tomshardware.com.
  • Clever Networking Hack: Because the vape’s chip has no built-in Wi-Fi or Ethernet, the engineer used a clever workaround. He emulated a 56k dial-up modem over the vape’s USB connection using SLIP (Serial Line Internet Protocol), so that a host PC recognizes the vape as a network interface tomshardware.com. The microcontroller then runs a lightweight TCP/IP stack (uIP) and minimal HTTP server, serving a simple webpage that just barely fits in its memory tomshardware.com.
  • From 20 Seconds to 160ms: Initial tests were dismal – pings took ~1.5 seconds with 50% packet loss, and loading a simple page required over 20 seconds theregister.com. After optimizing his code (buffering data instead of sending one byte at a time), performance improved dramatically. Now the tiny server replies to pings in ~20 milliseconds with no loss and loads the page in about 160ms theregister.com. In other words, a webpage that first took 20 seconds to load was sped up to under 0.2 seconds – a stunning improvement.
  • E-Waste Upside: This project highlights hidden value in “disposable” electronics. Millions of single-use vapes get tossed every week, yet they contain rechargeable batteries and programmable chips that far outclass old computers. A UK study found 1.3 million vapes are thrown away weekly, even though their lithium batteries can endure 450+ charge cycles theregister.com theregister.com. Reusing these components – as in this vape-turned-web-server – showcases an innovative way to reduce e-waste theregister.com.
  • Context and Comparison: Running a web server on such tiny hardware isn’t entirely new. Back in 1999, a student built a matchhead-sized web server on a PIC microcontroller with only 256 bytes of RAM techmonitor.ai. That was likely the world’s smallest web server at the time. Today’s vape hack uses a more powerful 32-bit chip, yet it’s remarkable that web technology can scale down to devices this small. For perspective, the vape’s 24KB memory wouldn’t fit even a modest modern website framework – but it’s plenty for simple text pages or basic IoT uses bogdanthegeek.github.io.

Unlikely Web Server: A Vape Pen’s Hidden Computing Power

Disposable vape pens are usually seen as trash once the nicotine runs out, but inside they often hide surprisingly capable electronics. Bogdan Ionescu – an engineer and hobbyist known as “BogdanTheGeek” – discovered this when he cracked open some “fancier” vape models. Instead of the typical mystery “blob” IC, he found a marked chip from Puya (a Chinese chipmaker) tomshardware.com. It turned out to be a Puya PY32F002B microcontroller: a tiny Arm Cortex-M0+ running at 24 MHz with 24 KB of flash storage and 3 KB of RAM tomshardware.com. These specs are not stellar – as Ionescu quipped, “a 10-year-old phone can barely load Google, and this is about 100× slower” tomshardware.com. In modern terms, such a chip is extremely underpowered; yet it’s now used in throwaway gadgets, which boggles the mind. All of that computing power is literally being tossed out, which gave Ionescu an idea.

Inspired by his growing pile of discarded vapes (initially saved for their batteries), Ionescu challenged himself to do something novel: turn one into a functioning web server hackaday.com. The project, cheekily dubbed “VapeServer,” set out to prove that even a $1 microcontroller from a vape pen could host a website. As Hackaday noted, these Puya chips have popped up in “cheapest MCU” lists before hackaday.com – they’re inexpensive but fairly capable for simple tasks. Still, using one as a web server is an extreme demonstration. By comparison, typical DIY web servers use far beefier hardware (for example, an Arduino with Ethernet shield or an ESP8266 Wi-Fi module, which have magnitudes more RAM and clock speed). Ionescu’s vape pen has none of that – no built-in networking, tiny memory – making it an unlikely web host.

How a Vape Pen Became a Web Server

To get the vape’s microcontroller online, Ionescu employed a creative hack. The microcontroller doesn’t have Wi-Fi or Ethernet, so he turned the vape’s USB port (originally meant for charging) into a network link. He essentially emulated a dial-up modem using software: on the microcontroller side, he used a technique called semihosting (which allows an attached PC to handle certain I/O tasks for the microcontroller) to send and receive data via USB bogdanthegeek.github.io bogdanthegeek.github.io. On his PC, he ran Linux’s slattach and socat tools to bridge this connection into a virtual network interface using SLIP – Serial Line Internet Protocol tomshardware.com. SLIP is an old protocol from the dial-up days that sends Internet packets over serial links. In effect, the vape pen started pretending to be a 56k serial modem to the PC bogdanthegeek.github.io, allowing the PC and the microcontroller to exchange IP packets over USB.

Once the serial link was established, Ionescu needed the vape’s chip to speak Internet language. He opted for uIP, a very lightweight open-source TCP/IP stack designed for memory-starved devices bogdanthegeek.github.io. Despite being minimal, uIP provided exactly what he needed: the ability to handle basic TCP/IP networking and serve an HTTP 1.0 webpage. After some tweaking and porting (to make uIP work with the semihosted serial interface and align data on the 32-bit ARM properly), the vape pen was running a web server – at least in a rudimentary way bogdanthegeek.github.io.

For content, he kept it simple: the server hosts a static webpage (a copy of his own blog post explaining the project) which just fits into the remaining flash memory of the microcontroller tomshardware.com. In fact, after loading the networking code, only about 20 KB of flash was left free – just enough for an HTML page with text. There’s no fancy database or dynamic content here, of course; the little vape server is essentially serving one hard-coded page (plus a tiny JSON API he added for fun) bogdanthegeek.github.io. But the fact that it can speak HTTP at all is impressive given the constraints. As Ionescu joked, it’s not going to ship a complex web app like React, but it’s “more than enough to host this entire blog post.” bogdanthegeek.github.io

Overcoming Performance Hurdles: From 20s Loads to 160ms

Getting the VapeServer to actually respond quickly was another challenge. Initially, the performance was abysmal. Ionescu reported that ping requests took around 1.5 seconds (with about 50% of them lost), and loading the simple text page took over 20 seconds theregister.com. In his words, “That’s so bad, it’s actually funny, and I kind of wanted to leave it there,” he wrote, noting how laughably bad the vape-powered web server was at first theregister.com. Essentially, it was working, but at speeds only a 1990s dial-up user could tolerate.

The bottleneck, it turned out, wasn’t the CPU speed or network protocol per se, but how the code was handling data. The microcontroller was sending and receiving one character at a time, which introduced enormous overhead bogdanthegeek.github.io. With only 3 KB of RAM, uIP’s default configuration didn’t buffer much – it was designed for even smaller 8-bit chips and thus sent data byte-by-byte to conserve memory cnx-software.com. But on this 32-bit ARM, there was actually enough RAM to be smarter. Once Ionescu realized the problem was “between the seat and the steering wheel” (i.e. a user/code issue, not the hardware) bogdanthegeek.github.io, he refactored his implementation to use a ring buffer in RAM. This allowed the microcontroller to batch data and handle larger chunks per transmission, instead of constantly waiting on single-byte operations bogdanthegeek.github.io.

The effect was dramatic. With buffered reads/writes and some other optimizations, the tiny server’s responsiveness skyrocketed. Pings dropped to ~20 ms (faster than many broadband home connections) and page load times fell to about 160 ms theregister.com. What once took 20 seconds now took well under a second. As Ionescu proudly declared, “Now this is what I call blazingly fast!” bogdanthegeek.github.io bogdanthegeek.github.io. Of course, “blazingly fast” is tongue-in-cheek – the site is just a static text page. But 160 ms is a very respectable load time by any standard, meaning the vape server can deliver its page almost instantly under light usage.

There are limits, naturally. The system can’t handle much traffic – it has no true networking chip and very limited resources. In fact, when news of this project went viral, curious visitors overwhelmed the live vape-hosted page, causing it to throw 503 errors (overloaded) tomshardware.com. Ionescu himself noted that while the ring buffer fix made it fast for one user at a time, it “can’t handle a large volume of requests” in parallel theregister.com. So this isn’t going to replace your commercial web server. But as a proof of concept, it shows that with smart coding, even a 24 KB microcontroller can act like a web server with responsive speeds.

The Bigger Picture: Upcycling E-Waste for Tech Experiments

Beyond the novelty, the VapeServer shines a light on the untapped potential of e-waste. Disposable e-cigarettes have become the new litter of modern life – “the new cigarette butts” in terms of pollution, as one report put it theregister.com. They are sold as single-use items, yet ironically they pack technology (like microcontrollers and Li-ion batteries) that remains functional long after the device’s intended life. A 2023 University of Oxford/Faraday Institution study found an astonishing 1.3 million disposable vapes are discarded every week in the UK alone theregister.com. Each of those vapes contains a battery capable of hundreds of recharge cycles and electronics that, as we see, could be repurposed. “Reusing them in any format can’t be a bad idea,” The Register noted, since these are essentially tiny computers and power sources being thrown away theregister.com.

Experts who conducted the study emphasize how much value is literally being trashed. “The popularity of single-use vapes has exploded in recent years. Despite being sold as disposable, our research has shown the lithium-ion batteries inside them are capable of being charged and discharged over 450 times,” said Hamish Reid, the study’s lead author theregister.com. In other words, a vape’s battery could live a second life powering something else for a long time after the vape is used up. The same goes for the microcontroller – decades ago a chip with a 24 MHz CPU and kilobytes of memory would have been a precious computing resource (in fact, 30 years ago such a chip would outperform many spacecraft computers of that era) theregister.com tomshardware.com. Today, it’s “basically disposable” bogdanthegeek.github.io. Projects like VapeServer demonstrate that this “disposable” hardware can do real computing tasks, reminding us of the incredible efficiency of modern microelectronics.

While no one is suggesting to literally host critical websites on vape pens, the principle is inspiring for the maker community and environmental advocates. It suggests creative ways to upcycle e-waste: for instance, using old vape chips in DIY Internet-of-Things sensors, or harvesting batteries for electronics projects. Ionescu’s project sits at the intersection of tech playfulness and eco-consciousness – it’s a fun hack, but it also carries a message. As Tom’s Hardware put it, these throwaway gadgets have “too many electronic goodies to be left unplundered” tomshardware.com.

Comparisons and Context: Tiny Web Servers Then and Now

The idea of running a web server on minimal hardware has intrigued tinkerers for decades. Ionescu’s VapeServer is the latest example in a long lineage of “smallest web server” challenges. To put it in perspective, back in 1999 a UMass graduate student built what was then hailed as the world’s smallest web server on a single-chip PIC microcontroller hackaday.com. That PIC chip ran at just 4 MHz and had only 256 bytes of RAM, yet it managed to implement a basic TCP/IP stack and HTTP 1.0 server firmware techmonitor.ai. The entire device was the size of a match head and cost under $1 in parts techmonitor.ai. It served up pages that could toggle appliances on and off, demonstrating early on that even tiny micros could join the Web. One commentator noted of that project, “if [the] iPic [server] can fit in a PIC, it can fit in just about anything.” techmonitor.ai Indeed, that prediction has proven true as engineers kept finding ways to shrink web technology into smaller devices.

Compared to that 1999 PIC server, the vape’s PY32F002B microcontroller is a giant – it has roughly 12× the clock speed, and over 10× the RAM and code space. More importantly, it’s a 32-bit CPU (versus the PIC’s 8-bit core), which makes running C code and networking stacks much easier. This partly explains why Ionescu could achieve relatively fast performance and even include extra features (like his JSON API endpoint) bogdanthegeek.github.io – the hardware, while tiny by today’s standards, is leagues beyond what early micro web servers had. In fact, enthusiasts on forums have pointed out that the vape’s chip boasts more processing power than the computers used in the Apollo moon missions – a testament to how far tech has come that we now toss such power in the trash tomshardware.com.

It’s also interesting to compare the VapeServer to typical modern IoT devices. For instance, the popular ESP8266 microcontroller (often used for Wi-Fi gadgets) has 80 MHz clock, 50+ KB of RAM, and built-in Wi-Fi. That makes projects like a web server straightforward on an ESP8266 or its successor ESP32. By contrast, the vape project had to improvise networking via USB and squeeze into far tinier memory. It shows that with skill and ingenuity, you can push even sub-dollar chips into doing things usually reserved for much more capable silicon. As one tech site remarked, “Getting around the limited hardware” was key – using a slim networking stack and clever coding to make a fool’s errand possible hackaday.com.

Finally, the VapeServer underscores that basic web serving doesn’t actually require heavy-duty hardware. A simple HTTP server essentially just listens for a request and sends back some text – something even an 8-bit microcontroller can handle if set up correctly. “Kind of shows there’s not much to a basic web server,” one observer mused about these projects hackaday.com. Of course, scaling that to today’s complex, encrypted, media-rich websites is another matter entirely. But for educational and experimental purposes, running a tiny web server on a vape pen is a fascinating demonstration of both the progress and the approachability of technology. It bridges the very old (dial-up networking methods) with the very new (disposable tech), resulting in a project that has captivated internet users and inspired many to rethink what our “trash” electronics can do.

Conclusion

A discarded vape pen might seem like useless garbage – but as this project shows, inside it lies a fully functional microcomputer just waiting to be repurposed. Bogdan Ionescu’s VapeServer project transformed e-waste into a working web server, highlighting both the ingenuity of makers and the latent power in everyday electronics. It’s amazing (and a bit ironic) that a gadget meant to deliver nicotine can, with some hacking, deliver web pages to browsers around the world. The project’s success – loading a blog page in 160 ms from a 24 KB, $1 chip – is not just a quirky anecdote; it’s a commentary on technology and waste. As we marvel at this tiny web server puffing along, it prompts us to imagine new ways to recycle and innovate, turning today’s trash into tomorrow’s tech treasure.

Sources:

  1. Tyson, Mark. Tom’s HardwareEngineer creates ‘blazingly fast’ web server powered by a disposable vape tomshardware.com tomshardware.com tomshardware.com
  2. Posch, Maya. HackadayHosting A Website On A Disposable Vape hackaday.com hackaday.com hackaday.com
  3. Ionescu, Bogdan. BogdanTheGeek BlogHosting a WebSite on a Disposable Vape bogdanthegeek.github.io bogdanthegeek.github.io bogdanthegeek.github.io
  4. Thomson, Iain. The RegisterEngineer turned a vape into a web server theregister.com theregister.com
  5. Aufranc, Jean-Luc. CNX SoftwareConverting a disposable vape into a web server cnx-software.com cnx-software.com
  6. Tech Monitor – The World’s Smallest Web Server? (August 18, 1999) techmonitor.ai techmonitor.ai
ESP32 = Public Web Server!
Spotify vs Apple Music vs YouTube Music – The 2025 Streaming Showdown (Pricing, Quality, AI & More)
Previous Story

YouTube Music’s Exclusive Fan Perks vs Spotify, Apple & More – A New Era of Superfan Rewards?

Google’s Shocking AI Contractor Purge: The Real Reason 200 ‘Super Raters’ Were Axed
Next Story

Google’s Shocking AI Contractor Purge: The Real Reason 200 ‘Super Raters’ Were Axed

Go toTop