Home IoT Hub Series · 01

Home IoT Hub — Give Your Home a Brain with a Single ESP8266

Home IoT Hub — giving your home a brain with a single ESP8266, cover image

Why I started

Living-room temperature on a phone app, the front-door sensor wired to its own separate buzzer, and to know whether the gas stove was left on I had to walk into the kitchen and look. All the information in my home was scattered.

"Can't I just gather all of this onto one small screen?"

So I started. A little brain: one OLED on an ESP8266, with 20 memory slots carved out to push every sensor value into. Its name is the Home IoT Hub, and I'll publish it as a series here on iothub.co.kr.

Concept: brain first, sensors later

Most IoT projects start by buying sensors. Buy a DHT22, buy a PIR, buy a relay… and then the sensors just pile up, unused, because you don't know where to connect them.

We go the other way.

1. First, build the "brain." (ESP8266 + OLED)
2. The brain runs happily on its own, even with no sensors. (web server + OLED scroll)
3. Add one sensor node a day, plugging it into the brain.

The advantage of this approach is that you have something that works from day one. That first evening, the OLED is already glowing. It's still full of -- placeholders, but filling in those blanks is surprisingly satisfying.

Parts and cost for the body (one brain set)

PartPrice (approx. USD)Notes
ESP8266 (NodeMCU / Wemos D1 Mini)~$1.70AliExpress price
SSD1306 128×64 OLED (I2C)~$1.200.96" white
Piezo buzzer~$0.203–5V active type
Jumper wires ×10~$0.35female-female
Breadboard~$1.00optional
Micro USB cable~$0.70power + upload
Body totalabout ~$5.00
The next post covers the pin wiring of these parts in detail. For the ESP8266 GPIO layout on a NodeMCU: GPIO4 (D2) = SDA, GPIO5 (D1) = SCL, GPIO13 (D7) = buzzer.

What information we'll collect

I've pre-assigned 20 slots. This is for a typical home; change any of it to suit your situation.

#MeasurementExample valueMethodSensor price (USD)
1Living-room temp24.5℃DHT22~$1.40
2Living-room humidity58%(same as #1)
3Outdoor temp18.0℃DHT22~$1.40
4Air-con stateOFFIR transmit feedbackVS1838B+LED ~~$0.40
5Boiler runningOFFDS18B20 (pipe)~$1.00
6Gas stove in use0K-type thermocouple~$2.00
7Gas leak ⚠0MQ-5 gas sensor~$1.00
8Fire detected ⚠0Flame sensor~$0.70
9Front door open ⚠0MC-38 reed switch~$0.55
10Entrance lock1Door-lock state sensor~$1.40
11Living-room lightOFFPhotoresistor or relay~$1.00
12Fridge temp3.5℃DS18B20 waterproof~$1.40
13Indoor CO2620ppmMH-Z19B~$13.50
14Fine dust PM2.535㎍/m³PMS5003~$10
15Power usage320WACS712~$1.70
16Water usage0LFlow sensor YF-S201~$2.00
17Hot-water temp42℃DS18B20 (pipe)~$1.00
18Rain detection0Raindrop sensor~$0.70
19Bathroom humidity62%DHT22~$1.40
20Dog food bowl ⚠120gHX711 load cell~$2.00
Sensors total about ~$44 + body ~$5.00 + ~$1.40 × 19 Wemos D1 Mini boards for the sensor nodes (#1 shares the brain's location) = ~$26 → a total project budget of about ~$75. But buying one a day, it never hurts. Only the CO2 and fine-dust sensors are a bit pricey; the rest run ~$0.70–3,000.

The ⚠ marks are alert targets. When gas leaks, a fire starts, or a door opens, the OLED flashes and the buzzer sounds. If the food bowl drops below 50g, it warns "refill the food."

Wi-Fi structure: the brain becomes the router

Understand this and it becomes clear why each sensor needs its own ESP8266.

home router (192.168.0.1)
    │
    ├── brain ESP8266 (192.168.0.50)
    │       │
    │       │  AP mode: IoT_Hub_Net (password-protected private Wi-Fi)
    │       │  → sensor nodes connect to this network
    │       │
    │       ├── sensor node #1  ESP8266 + DHT22 (living-room temp/humidity)
    │       ├── sensor node #2  ESP8266 + reed switch (front door)
    │       ├── sensor node #3  ESP8266 + thermocouple (gas stove)
    │       ├── ...
    │       └── sensor node #19 ESP8266 + HX711 (dog food bowl)
    │
    └── my phone/PC → web dashboard at the brain's IP

Brain ESP8266:

  • Joins the home router in STA mode (provides internet + dashboard)
  • At the same time creates its own Wi-Fi IoT_Hub_Net in Soft AP mode
  • Runs a 20-slot HTTP server

Sensor node ESP8266 (×19):

  • Joins the brain's AP IoT_Hub_Net in STA mode
  • Measures the sensor value → sends it to the brain via HTTP GET /set?noX=value
  • Connects automatically as soon as it has power

The advantage of this structure is that sensor nodes don't depend on the home router. As long as the brain is connected to the router, the sensors talk over the brain's own Wi-Fi. No load on the router, and adding a sensor node is easy.

Of course, if your home is small or the sensors are clustered near the brain, you can wire sensors directly to the brain ESP8266 without separate nodes. A few slots (say #1–#3) can be connected directly while GPIO pins remain. In this series we assume the "there's some distance" case and build each sensor as an independent node.

How alerts work

No separate warning light needed. Even a 0.96" OLED is quite noticeable when the whole screen inverts white↔black. Add a single piezo buzzer and you have a dual "see it and hear it" alert. The buzzer costs ~$0.20.

ESP8266 models: pick by size for the job

ESP8266 isn't a single thing. They all use the same chip, but the board size and pin count differ. Pick the right one for the job and you save both money and space. The GPIO numbers are the same on any board, so as long as your code uses labels like D2 or D5, swapping boards just works.

ModelSizeGPIOPrice (USD)Where to use
NodeMCU v3Large (58×31mm)11~$1.70The brain body (OLED + buzzer + spare pins)
Wemos D1 MiniSmall (34×26mm)9~$1.40General sensor nodes (DHT22, DS18B20, etc.)
ESP-01STiny (25×15mm)2 (GPIO0, 2)~$1.00Simple sensors (reed switch, PIR, raindrop — anything needing just one pin). ⚠ Needs a separate USB upload adapter (FTDI, ~$1.40)

How to choose:

  • The brain needs an OLED (I2C, 2 pins) + buzzer (1 pin) + maybe a nearby sensor wired directly, so the pin-rich NodeMCU is the answer.
  • A sensor node is almost fully covered by a Wemos D1 Mini. Even non-I2C sensors like the DHT22 need just one data pin.
  • For spots that truly need only a 1-bit signal, like door-open detection, an ESP-01S is enough. It's tiny enough to tuck into a door gap. But unlike the NodeMCU or D1 Mini, it has no USB port, so you can't plug it straight into a PC. To upload code you need one FTDI USB-to-Serial adapter (~$1.40). With a single adapter you can flash many ESP-01S boards in turn, so the burden is small.
  • Whatever model you use, the GPIO numbers are the same. e.g. D2 = GPIO4, D5 = GPIO14 on both NodeMCU and D1 Mini. Copy-paste the code and you're done.

So what's the verdict? ESP-01S? FTDI? If it's getting complicated, don't think about it. Just buy twenty D1 Minis. One ~$1.40 board works as both the brain and a sensor node. Better than losing hair to save a few thousand won. The ESP-01S can wait for "when you actually need something really small." Alright, drop the headache and move on.

Throughout the series we standardize on brain = NodeMCU, sensor = D1 Mini. The ESP-01S will be introduced as a "tiny version" in the relevant sensor posts.

Power: standardize everything on USB

Every ESP8266 board takes 5V through a Micro USB port. So an old phone charger + a Micro USB cable is all you need. That's exactly why an ordinary person can do this. No soldering, no voltage math — you just plug it in.

LocationPower methodNotes
Brain body5V charger + Micro USBMust stay on, so wire directly to a wall outlet
Sensors near an outlet (living room, kitchen, rooms)5V charger + Micro USBReuse an old charger lying around the house
Spots far from an outlet (entrance, door gaps, balcony)Power bank or 18650 batteryWith Deep Sleep + wake every 5 min, one power bank lasts days to weeks
ESP-01S sensor node3.3V regulator or fed from the FTDIWith only 2 pins the power pin is shared, but with a D1 Mini you don't have to worry

Practical tips:

  • The D1 Mini has a Micro USB port. Plug in an old 5V 1A charger from a drawer and you're done.
  • Short on chargers? Buy one 5V multi-USB charging hub (~$3.40) and cluster 4–5 sensors in one spot.
  • Awkward outlet positions (above a door, a window sill) are solved with a 2m long Micro USB cable (~$1.00).
  • Only the spots power truly can't reach go on battery. Most homes have outlets closer than you'd think.
Why an ordinary person can do this: ESP8266 + a Micro USB cable + a charger. That's all. No relays, step-down modules, or external power supplies needed. The board handles the 5V→3.3V conversion itself.

IR control works too (later)

Add an infrared transmit/receive module to the ESP8266 and you go beyond monitoring to control: turn the air conditioner on/off, the TV on/off, adjust fan speed. You learn the existing remote's signal and fire it off via an HTTP request. That's covered separately later on.

Expansion roadmap

The real build is one a day. If sensor parts are piling up at home, do two at a time on the weekend.

Day 1  → Assemble the IoT Hub body (brain ESP8266 + OLED + buzzer)
Day 2  → Living-room DHT22 + a sensor ESP8266 (temp/humidity)
Day 3  → Entrance reed switch + a sensor ESP8266 (door open)
Day 4  → Gas-stove thermocouple + a sensor ESP8266
Day 5  → Fridge DS18B20 + a sensor ESP8266
Day 6  → Dog food bowl HX711 + a sensor ESP8266
Day 7  → Balcony DHT22 + a sensor ESP8266
Day 8  → Flame sensor + a sensor ESP8266
...
~2 weeks later → 20 slots + 19 sensor nodes: your home's control tower is complete

At first the OLED is full of --. There's a real joy in watching those blanks fill with actual values, day by day.

What's next

This post is the first, the overview, of the Home IoT Hub series.

The next post is "Building the brain" — putting a web server on the ESP8266 and building the OLED 20-channel scrolling screen, with code.

Every post will follow this format:

Parts + cost → pin wiring diagram → full code → upload check → next-post preview

And I'll post one sensor a day: the living-room DHT22, the entrance reed switch, the dog food-bowl load cell… follow along one at a time and before long your home will start talking to you too.

Today's task: one ESP8266, one OLED, one buzzer. With just these three you can build the brain. Ready? On to the next post.