Upgrade Your Smart Lamp to Work Without WiFi in Minutes Using AI
- Brian

- Oct 30
- 3 min read
Updated: Nov 3
In our last project, we built a Wi-Fi-controlled 3D-printed smart lamp. It worked great until the Wi-Fi didn’t. And, as fate would have it, the Wi-Fi usually stopped working right when someone (usually my wife) wanted to turn on the lamp.
So today we’re fixing that with a little “old-school” charm. We’re adding a physical push button, you know the kind you press with your finger.
By the end of this post, you’ll know how to:
Add a push button to your own smart lamp (or similar electronics project)
Use AI to help you code the changes
Upload that new code to your ESP8266-based device
When we’re done, you’ll have a lamp that toggles between low, medium, and high brightness no smartphone required. If you haven’t built the lamp yet, you can check out the post here:

Tools You’ll Need
A drill and bit sized to your button
A utility knife (for cleaning the hole)
A wire stripper and cutter
Solder and soldering iron
A tape measure or digital caliper

The Parts
A non-latching push button (one that pops back up when released. Think garage door button, not a wall switch)
About six inches of wire
Step 1: Install the Button
Decide where you want the button on your lamp and drill a clean hole for it. Use the utility knife to remove any rough edges, then mount and wire up the button. Once your button is physically installed, it’s time to move on to the digital side by summoning the digital genie: ChatGPT.
Step 2: Write the Code with AI
ChatGPT isn’t the only AI coding tool out there, but it’s free and works great for this kind of project. When you ask AI to write code, remember this rule: be specific. AI takes instructions literally, and if you leave gaps, it will fill them with its best guess which may not match what you actually want.
For example, if I simply said,
“Add a button to my lamp”
AI might assume I want a power toggle or a color-changing feature.
What I actually want is for the button to cycle through brightness levels: off, low, medium, high, and back to off again.
So my full prompt might sound like this:
“Add a push button on pin D2 that cycles between off, low, medium, and high brightness levels for the lamp’s white LEDs.”
The more details you provide, the better the results.
You can paste your existing working code into ChatGPT so it understands your starting point. Then, have it generate a new version that integrates the button functionality.
Sometimes AI gives you just snippets of code; other times, it can produce a full, ready-to-upload program. For beginners, it’s often easier to ask for the full version first then, as you get comfortable, learn how to merge snippets yourself to better understand the structure.
Step 3: Uploading the Code to the ESP8266
Once your new code is ready, it’s time to flash it to your microcontroller.
Download and install the Arduino IDE.
Go to Preferences > Additional Board URLs and add:
https://arduino.esp8266.com/stable/package_esp8266com_index.json
Under Boards Manager, search for ESP8266 and install it.
In the Tools > Board menu, select NodeMCU 0.9 (ESP-12 Module).
Connect your ESP8266 board via USB. It should appear under Tools > Port (for example, COM7).
Click Upload to send the program to your board.

If you see a compilation error like
“Adafruit_NeoPixel: No such file or directory,”
You're just missing a required library. Libraries are just that, knowledge the program needs to learn to do more stuff. To fix this, open the Library Manager (the book-shaped icon on the sidebar) and install the following:
Adafruit NeoPixel
ArduinoJSON
WiFiManager by tzapu

Once installed, hit Upload again, and your code should compile successfully.
When it’s done, unplug the ESP8266 from your computer and reconnect it to your lamp.
Step 4: Test Your New Smart Lamp
Press the button! You should see your lamp cycle through brightness levels: off → low → medium → high → off.
And that’s it. You’ve just upgraded your Wi-Fi smart lamp with tactile control, combining the best of both worlds: modern smart tech and reliable hardware interaction.
Recap
In this project, we:
Added a physical button to a 3D-printed Wi-Fi lamp
Modified the lamp’s housing to fit the new control
Used AI to write new firmware logic
Flashed the ESP8266 with our updated code
Created a lamp that works with both Wi-Fi and manual input
Congratulations! You’re officially a lamp firmware developer.
If you are interested in just downloading the code directly, you can do so here:
Thanks for reading, and happy making.
Comments