Showing posts with label DIY. Show all posts
Showing posts with label DIY. Show all posts

Wednesday, February 18, 2026

Build a Low-Cost DIY USB Volume Knob with Digispark ATtiny85

This project turns a cheap Digispark ATtiny85 USB dongle and a KY-040 rotary encoder into a dedicated hardware volume knob. Rotate clockwise for volume up, counter-clockwise for volume down, press to mute. It enumerates as a standard USB HID Consumer Control device — no custom driver, no desktop app. Linux, Windows, and many Android devices recognise it out of the box.

Last updated: February 19, 2026

3D render of the DIY USB volume knob showing a Digispark ATtiny85 board connected to a KY-040 rotary encoder

3D render of the assembled volume knob — Digispark ATtiny85 USB board with KY-040 rotary encoder.

Finished DIY USB volume knob plugged into a USB port, showing the Digispark board with rotary encoder attached

The finished USB volume knob — plug in and it works immediately as a standard HID device.

Why Build This?

Keyboard shortcuts work, but a physical knob is better when you are:

  • Switching between headphones and speakers
  • On a call and need instant mute
  • Using a media PC or mini server with no easy keyboard access
  • Tired of digging into software mixer panels

For around 5–10 USD in parts you get a dedicated hardware control that is always there.

Parts

Parts required for the DIY USB volume knob: Digispark ATtiny85 board, KY-040 rotary encoder, and jumper wires

Everything needed: Digispark ATtiny85 USB board, KY-040 rotary encoder module, and jumper wires.

  • Digispark ATtiny85 USB board — ~2 USD
  • KY-040 rotary encoder module — ~1 USD
  • Jumper wires (female-to-female) — ~1 USD
  • Optional: 3D-printed case or aftermarket knob for a cleaner finish

Wiring

Wiring diagram showing connections between KY-040 rotary encoder and Digispark ATtiny85 board

Connection diagram: KY-040 rotary encoder wired to the Digispark ATtiny85 USB board.

Rotary Encoder Digispark ATtiny85
CLK P5 (PB5)
DT P2 (PB2)
SW P0 (PB0)
+ 5V
GND GND

ATtiny85 pin mapping used by this project:

                 +-\/-+
ENC_A (CLK) PB5  1|    |8  Vcc
USB D-      PB3  2|    |7  PB2  ENC_B (DT)
USB D+      PB4  3|    |6  PB1
            GND  4|    |5  PB0  ENC_SW (SW)
                 +----+

Note: PB5 is used as GPIO for encoder input in this design (RSTDISBL fuse context applies when programming bare chips). Digispark boards typically ship in a suitable configuration already.

Assembly

The build is straightforward — solder the five wires between the encoder module and the Digispark board as shown in the wiring table above, then attach a knob cap. The numbered steps below show the full process from bare parts to finished device:

Step-by-step assembly of the DIY USB volume knob: 12 numbered photos showing progression from bare Digispark board and rotary encoder to finished USB device with knob cap

Assembly steps 1–12: from bare components to a finished USB volume knob ready to plug in.

Firmware

The firmware sends standard HID Consumer Control usages:

HID Usage Function
0xE9 Volume Increment
0xEA Volume Decrement
0xE2 Mute

Because these are standard HID usages, the host OS handles them natively — no custom driver needed.

Build and Flash

Clone the repository and build the firmware and uploader:

git clone https://github.com/hackboxguy/attiny85-hid-rotary-knob.git
cd attiny85-hid-rotary-knob
make all

This builds main.hex (firmware) and tools/micronucleus/micronucleus (uploader).

Flash via Micronucleus bootloader:

make upload

Tip: After running make upload, you will see "Waiting for device...". Plug in the Digispark within 60 seconds — the upload starts automatically once the bootloader is detected.

If your setup does not require sudo:

make upload SUDO=''

Note: Digispark boards come with the Micronucleus bootloader pre-installed — just plug in and upload. This blog assumes a board with a working bootloader. If you have a blank ATtiny85 chip without Micronucleus, flashing the bootloader requires an ISP programmer and is outside the scope of this guide.

Build prerequisites: Install gcc-avr, avr-libc, binutils-avr, libusb-1.0-0-dev, and pkg-config before running make.

Platform Compatibility

Linux

Works out of the box as a USB HID media control device. Desktop environments map it immediately to system volume and mute. Good fit for Ubuntu/Debian desktops, Arch with Wayland or X11, and Raspberry Pi media boxes.

Windows

Also works without drivers as a standard media-control device. If you briefly see "USB device not recognized" right after plugging in, that is the short Micronucleus bootloader window before the firmware enumerates. After handoff, the knob works normally.

Android

Works on Android devices that support USB OTG and HID media keys. You need a USB-C OTG adapter (or Micro-USB OTG on older phones) and OTG host support enabled on the device.

Android caveats: Behaviour can vary by OEM/ROM. Some devices only react when the screen is unlocked, and mute handling may differ across apps.

Troubleshooting

  • Build fails with missing AVR tools — Install the prerequisites listed in the Build and Flash section above.
  • Linux error -71 during USB enumeration — Reflash or repair the bootloader. See the repository troubleshooting section.
  • No response to rotation — Check CLK/DT wiring first (most common issue), then confirm the encoder module GND and 5V connections.

Going Further

The firmware is intentionally simple and stable, but the hardware supports extensions:

  • Multi-mode knob (volume / media transport / brightness)
  • Long-press and double-click actions
  • Mode indicator LED
  • Additional HID report descriptors

Start with a practical tool, then evolve it into a custom desktop controller.

Saturday, February 07, 2026

One Cable, Many Screens: A Self-Hosting PoE Raspberry Pi 4 Infotainment System

This is version 2 of my multi-screen Raspberry Pi infotainment project. The first version (DIY In-Car Infotainment) required a separate pocket router for DHCP, DNS, and DLNA. This version eliminates that dependency — one prebuilt SD card image works for all terminals, and the system configures itself automatically at boot.

Last updated: February 9, 2026

What's New in v2.1

  • Touch-friendly OSD controls — New "Sync" and "Stop All" buttons in Kodi's video player OSD. Tap the screen to show controls, tap Sync to synchronize all screens.
  • Master-only visibility — OSD sync buttons automatically hide on slave devices (only visible on master with USB mounted).
  • Keyboard shortcut — Press 'S' during video playback to trigger sync immediately.
  • No startup prompts — Pre-configured Addons database eliminates "Do you want to enable this addon?" popups.
  • Accurate device count — Fixed duplicate localhost counting (shows correct 3/3 instead of 4/4).
  • Minimal dual-screen setup — Just two Pi4s connected with a direct Ethernet cable — no PoE switch needed for small deployments.

v2.0 features: Self-hosted DHCP/DNS/NTP/DLNA on master Pi, automatic master election via USB detection, one SD card image for all terminals.

Minimal Dual-Screen Setup

For a quick two-screen deployment, you don't need a PoE switch — just connect two Pi4s directly with an Ethernet cable:

Minimal dual-screen setup: two Raspberry Pi 4 terminals connected directly with an Ethernet cable, master with USB storage

Minimal setup: Two Pi4s connected directly via Ethernet. The Pi with USB storage becomes master automatically.

What you need:

  • 2× Raspberry Pi 4 with touch displays
  • 2× MicroSD cards (same image on both)
  • 1× Ethernet cable (any length, crossover not required)
  • 1× USB storage with media files
  • 2× Power supplies (5V/3A each)

How it works:

  1. Download the pre-built SD card image (v2.1) and flash it to both cards using balenaEtcher or Rufus
  2. Connect the two Pi4s with a standard Ethernet cable
  3. Attach USB storage to one Pi (this becomes the master)
  4. Power on both — master provides DHCP, DLNA, and NTP to the slave
  5. Both terminals launch Kodi and show the DLNA media library

From here, use the touch-screen OSD controls to sync playback across both screens.

Scaling up? Add a PoE switch for 3+ screens — see Multi-Screen Setup (3+ Screens with PoE Switch) below.

Multi-Screen Setup (3+ Screens with PoE Switch)

Raspberry Pi 4 multi-screen infotainment system setup diagram showing PoE switch, master terminal with USB, and client terminals

System diagram: One master Pi (with USB media) provides DHCP, DNS, NTP, and DLNA to all client terminals via a PoE switch.

A typical deployment uses:

  • 1 master Pi4 terminal (with USB media attached)
  • 3 client Pi4 terminals
  • 1 PoE switch (5-port or larger)

The topology is a pure star connection: every terminal connects directly to the PoE switch via a single Ethernet cable that provides both power and network. No AV matrix or special head-end hardware required.

How It Works

  1. PoE switch powers on
  2. All Pi4 terminals boot from identical SD cards
  3. Each terminal checks for USB storage
  4. The terminal with USB media becomes the master automatically
  5. Master starts DHCP (192.168.8.100-200), DNS, NTP, and DLNA services
  6. Client terminals get their IP address, time sync, and media access from master
  7. All terminals launch Kodi and connect to the DLNA source
  8. Users choose Personal Mode or Sync Mode

Two Operating Modes

Personal Mode

Each user gets their own screen and audio path:

  • Analog headset via 3.5mm jack, or
  • Bluetooth headset

This feels similar to in-flight seatback entertainment. Each passenger independently browses the DLNA media library in Kodi and plays whatever they want.

Sync Mode

When shared viewing is needed, the master terminal can synchronize all clients using touch-screen OSD controls:

  1. Start playing a video on the master (the Pi with USB storage)
  2. Tap the screen (or press any key) to show the OSD
  3. Tap Sync — all screens open the same video at the same position
  4. Tap Stop All — stops playback on all screens simultaneously
Kodi OSD showing custom Media-Mux Sync and Stop All buttons for synchronized multi-screen playback control

Kodi video player OSD on master device showing the custom Sync and Stop All buttons (highlighted). These buttons only appear on the master Pi.

Keyboard shortcut: Press 'S' during video playback to trigger sync immediately without showing the OSD.

Non-touch displays? Connect a mini 3-key USB keyboard to the master. Press KEY_1 to sync, KEY_2 to stop all. The OSD buttons are hidden on slave devices — only the master shows them.

Master audio can feed a central sound system (vehicle speakers, room PA, etc.) for group viewing.

Hardware List

For a 4-terminal setup:

Component Qty Notes
Raspberry Pi 4 (4GB) 4 2GB works but 4GB recommended
PoE HAT 4 Official or compatible 802.3af HAT
MicroSD card (32GB+) 4 Class 10 or faster
Full HD touch display 4 7" to 10" HDMI displays work well
PoE switch 1 5-port minimum, 802.3af/at
Ethernet cables 4 Up to 50m runs supported
USB storage 1 NTFS, FAT32, or ext4 formatted
3-key USB keyboard (optional) 1 Only needed for non-touch displays; touch screens use OSD buttons

Compared to v1, you no longer need the GL-MT300N-V2 pocket router — the master Pi handles all network services.

Real-World Use Cases

In-Car / Fleet Passenger Infotainment

Ideal for vehicles with multiple passengers:

  • Each passenger watches independent content with personal audio
  • One key press switches everyone to synchronized shared playback
  • Master audio routes to vehicle speakers for group viewing

Gives both freedom (personal playback) and coordination (sync playback) in one system.

Multi-Room Shared Viewing

Use case diagram showing multi-room shared viewing with synchronized screens in overflow rooms

Multi-room use case: synchronized playback across overflow rooms, halls, or training centers.

For venues where people are spread across rooms:

  • House of worship overflow rooms
  • Community halls
  • Training centers
  • Small campuses

A single PoE star network keeps wiring simple and operations predictable.

Quick Start

Option 1: Pre-built Image (Recommended)

  1. Download the pre-built SD card image (v2.1) (~1.2GB)
  2. Flash the image to all SD cards using balenaEtcher or Rufus
  3. Insert SD cards into Pi4 terminals
  4. Connect all terminals to PoE switch
  5. Insert USB media (NTFS, FAT32, or ext4) into one terminal
  6. Power on the PoE switch
  7. Wait for all terminals to boot into Kodi

Option 2: Manual Installation

On an existing Raspberry Pi OS Lite installation:

git clone https://github.com/hackboxguy/media-mux.git
cd media-mux
sudo ./setup.sh
# System reboots after base installation

# After reboot, login again and run:
cd media-mux
sudo ./setup-selfhosted.sh
sudo reboot

Troubleshooting

DLNA source shows "Couldn't connect to network server"

  • Check if master terminal has USB media attached
  • Verify minidlna is running: pgrep -f minidlnad
  • Check master log: cat /var/log/media-mux-selfhosted.log
  • Ensure USB is mounted: mount | grep /media/usb

Client terminal not getting IP address

  • Verify master booted first and has USB attached
  • Check dnsmasq is running on master: systemctl status dnsmasq
  • Try rebooting the client terminal

Time is wrong on client terminals

  • Wait a few minutes after boot for NTP sync
  • Check chrony status: chronyc sources
  • Verify master chrony is running: pgrep -f chronyd

Sync playback not working

  • Ensure you are triggering sync from the master (the Pi with USB storage)
  • Touch screen: Tap screen to show OSD, tap Sync button
  • Keyboard: Press 'S' during playback, or KEY_1 on 3-key keyboard
  • Check kodisync log on master: cat /var/log/kodisync.log
  • Verify all clients are on the same network (192.168.8.x)

OSD Sync/Stop buttons not visible

  • Buttons only appear on the master (Pi with USB storage attached)
  • Slave devices do not show these buttons by design
  • If master doesn't show buttons, verify USB is mounted: mount | grep /media/usb

USB media not detected

  • Supported formats: NTFS, FAT32, ext4
  • Check dmesg for USB detection: dmesg | grep -i usb
  • Try a different USB port or cable

Current Limitations

The system works reliably for practical deployments, but there are areas for future improvement:

  • No automatic master failover if master is disconnected
  • No web dashboard for status monitoring
  • Role is determined by USB presence (no manual pinning)

SOURCE CODE

github.com/hackboxguy/media-mux — pre-built images and release notes in Releases section

Friday, April 19, 2024

DIY In-Car Infotainment with Raspberry Pi and Kodi

Build your own in-car entertainment system — individual touch displays for each passenger, streaming multimedia over a local network with no internet required. Using off-the-shelf hardware and open-source software, each screen costs around $180–$200.

Last updated: February 7, 2026

What's New (Feb 2026)

  • Pre-built SD card image — Download, flash, and boot. No manual installation needed. Download here (~1.2GB)
  • Rock-solid sync — Integrated kodisync for frame-accurate synchronization. Now achieves sub-10ms sync spread (vs. multiple attempts needed before)
  • Auto-negotiation — No more manual master/slave configuration. Each Pi generates a unique hostname from its MAC address and devices auto-discover each other
  • One image for all — Flash the same image to all SD cards. No per-device configuration required
Detailed wiring diagram for DIY in-car infotainment system with PoE switch, pocket router, and Raspberry Pi screens

Complete wiring diagram: PoE switch powers each Raspberry Pi + touch screen over a single Ethernet cable.

How it works

The system uses a distributed architecture — no central multi-head controller needed. Each passenger screen is an independent Raspberry Pi 4 running Kodi, powered and networked through a single Ethernet cable via Power over Ethernet (PoE). A pocket router acts as the DLNA/DHCP server, serving media files from a USB drive to all screens on the local network.

What you need

Component Role
PoE switch Powers and networks all Raspberry Pi screens over single Ethernet cables
GL-MT300N-V2 pocket router DLNA media server + DHCP server (see pocket router DLNA guide)
Raspberry Pi 4 + PoE HAT Media player endpoint (one per passenger screen)
Full HD touch display Passenger-facing screen (one per seat)
USB media drive Stores multimedia files, plugged into the pocket router

Why this architecture

  • Single-cable per screen — PoE eliminates separate power cables, simplifying in-car wiring
  • Distributed decoding — each Raspberry Pi handles its own multimedia decoding and rendering, so there is no central bottleneck
  • Easily scalable — add more screens by swapping in a PoE switch with more ports
  • Fully offline — works in areas with no mobile coverage; all content is served locally
  • Individual or shared playback — each passenger can browse and play their own content, or all screens can be synchronized

Cost per screen

Each passenger display costs approximately $180–$200, including the Raspberry Pi 4, PoE HAT, and a full HD touch screen. The PoE switch and pocket router are shared across all screens.

Software stack

  • Kodi — open-source media player running on each Raspberry Pi, with DLNA client support built in
  • OpenWrt + minidlna — runs on the pocket router, serving media files over DLNA
  • Raspberry Pi OS — base operating system for the Pi endpoints
  • media-mux — synchronization software that coordinates playback across all screens

For the DLNA server setup on the pocket router, see the companion post: Transforming Your GL-MT300N-V2 Pocket Router into a DLNA Multimedia Server.

Installation

Option 1: Pre-built Image (Recommended)

The easiest way to get started — download and flash the same image to all SD cards:

  1. Download the pre-built image (~1.2GB)
  2. Flash to each SD card using balenaEtcher or Rufus
  3. Insert SD cards into your Raspberry Pi 4's and boot

That's it! Each Pi automatically generates a unique hostname and discovers other devices on the network.

Option 2: Manual Installation

For custom setups, you can install on an existing Raspberry Pi OS. See the manual installation guide for step-by-step instructions.

How sync works

Connect a 3-key USB keyboard to any Raspberry Pi — this becomes the sync trigger device. Press KEY_1 to synchronize all screens:

  1. The sync script reads the currently playing media and position from the trigger device
  2. Discovers all media-mux devices on the network via Avahi/mDNS
  3. Opens the same media file on all devices
  4. Uses kodisync to pause all players at the exact same frame
  5. Seeks all players to the same position and resumes playback simultaneously

Sync accuracy: The system achieves sub-200ms synchronization, typically with less than 10ms spread between devices. This is a significant improvement over the earlier version shown in the video, which required multiple sync attempts.

SOURCE CODE

github.com/hackboxguy/media-mux — sync software + pre-built SD card image

github.com/hackboxguy/multiscreen-media — hardware build guide and bill of materials

Version 2 now available: A self-hosting version that eliminates the pocket router. One Pi becomes the master automatically, providing DHCP, DNS, NTP, and DLNA. See Self-Hosting PoE Raspberry Pi 4 Infotainment System.

Wednesday, September 25, 2019

DIY Passive PoE for Raspberry Pi Under $2

How to power a Raspberry Pi 3/4 over an Ethernet cable (up to 100 m) using passive PoE — with off-the-shelf parts costing under ~$2.

Complete passive PoE setup for Raspberry Pi

Complete setup — Raspberry Pi powered over Ethernet via passive PoE.

Warning: This uses passive PoE with T568B wiring:

  • Blue / Blue-White → + (positive) terminal of DC supply
  • Brown-White / Brown → − (negative) terminal of DC supply

If you don't know what passive PoE is, do not proceed — buy a proper PoE HAT instead.

Parts needed

1. PoE injector cable (~$0.80)

PoE injector cable

PoE injector cable — splits power and data onto the Ethernet cable.

PoE injector cable — connector detail

Connector detail of the PoE injector cable.

PoE injector cable — wiring detail

Wiring detail of the PoE injector cable.

2. DC-DC buck converter (~$0.50) — look for Hesai brand on AliExpress, 12–24 V input, 5 V / 3 A output.

DC-DC buck converter module

DC-DC buck converter — 12–24 V input to 5 V / 3 A output.

Assembly

3. Solder jumper wires — Cut female-to-female jumper wire into 4 pieces and solder to the buck converter as shown:

Soldering jumper wires to buck converter

Jumper wires soldered to the DC-DC buck converter.

Wiring diagram for buck converter connections

Wiring diagram — connecting the buck converter to the PoE splitter.

4. Heatshrink and connect — Cover the DC-DC converter in a heatshrink sleeve and connect to the Raspberry Pi:

Buck converter in heatshrink connected to Raspberry Pi

DC-DC converter in heatshrink sleeve, connected to the Raspberry Pi.

5. Final setup — Feed 12 V DC and network into the PoE injector, then run a CAT-5 cable (up to 100 m) between the injector and the Raspberry Pi:

Complete passive PoE setup diagram

Complete setup — 12 V DC + network through PoE injector to Raspberry Pi over CAT-5.

Saturday, August 24, 2019

Flash OpenWrt on the A5-V11 Pocket Router

Step-by-step guide to replace the stock Qualcomm firmware on an A5-V11 pocket router (~$5) with OpenWrt, giving you a fully hackable Linux device.

What you need

  • A5-V11 pocket router (Qualcomm variant)
  • FAT-formatted USB flash drive
  • PC with Ethernet port
  • Ethernet cable
  • 5 V USB power source

Step 1 — Prepare the USB drive

Download and unzip a5-v11-openwrt.zip onto a FAT-formatted USB flash drive.

Important: Do not just copy the .zip file — extract it so the folder containing openwrt-factory.bin, the bootloader, and update scripts sits at the root of the drive.

Step 2 — Connect the hardware

Wire up the A5-V11, USB drive, PC, and power as shown:

A5-V11 hardware setup: router, USB drive, Ethernet cable, and power

Hardware setup: A5-V11 router with USB flash drive, Ethernet to PC, and 5 V power.

Step 3 — Power on and wait

Apply 5 V power. The RED LED stays on for a few seconds, then the BLUE LED starts blinking (takes about 1 minute from power-on). Your PC should receive an IP in the 192.168.100.x range from the router's DHCP server.

Step 4 — Verify Qualcomm firmware

Open the router's web UI and confirm it shows the Qualcomm interface:

A5-V11 Qualcomm OEM web UI

Qualcomm OEM web interface — confirm your router shows this page before continuing.

A5-V11 Qualcomm firmware details

Qualcomm firmware detail page.

Stop here if your router's web page looks different from the screenshots above. You may have a Chinese firmware variant — follow this other guide instead.

Step 5 — Telnet in and flash

Open a telnet session to the router using PuTTY or a terminal:

Telnet connection to A5-V11

Telnet session to the A5-V11 router.

Run the firmware flash commands as shown:

Flash commands running on A5-V11

Running the OpenWrt flash commands via telnet.

Step 6 — Reboot into OpenWrt

After reboot, wait about a minute. OpenWrt will boot and your PC will get an IP in the 192.168.1.x range. Open a browser and you should see the OpenWrt LuCI interface:

OpenWrt LuCI login page

OpenWrt LuCI login screen — use the default root user with no password.

OpenWrt dashboard after login

OpenWrt dashboard. From here you can flash your own custom OpenWrt variant via System → Backup/Flash Firmware.

Next step: You can now overwrite this base OpenWrt image with your own custom build via the System → Backup/Flash Firmware menu.

Thursday, January 03, 2019

Wi-Fi LED Fairy Light Controller with ESP8266

A DIY Wi-Fi-controlled 5 V switcher for USB LED fairy lights, built around an ESP-12F module running Tasmota firmware. Powered by a battery bank, it lets you toggle garden lights remotely from your phone — no 230 V wiring outdoors and no freezing walks to the power outlet.

LED fairy lights in the garden
LED fairy lights switched on at night

The lights

"USB Fairy Lights" or "USB String Lights" — 10 m / 100 LEDs, available from China for under ~$3. They are 5 V USB-powered and weather-proof (except the USB connector).

USB LED string light product photo
Close-up of the LED string circuit

The 100-LED circuit with 5.1 Ohm series resistor — consumes ~1.8 W at 5 V.

Close-up of a single LED

Close-up of a single LED — brightness difference between first and last LED is barely noticeable from a distance.

The ESP-12F 5 V switcher

An ESP-12F module with a MOSFET switches the USB 5 V supply to the LED string. Running Tasmota firmware, it connects to your Wi-Fi network and can be controlled from a phone or any MQTT/HTTP client.

ESP-12F switcher board — front
ESP-12F switcher board — rear
Complete setup — battery bank, ESP switcher, and LED string

Complete setup — battery bank, ESP-12F switcher, and LED fairy lights.

With Tasmota's default configuration (no deep sleep), the battery bank needs recharging every few days. A larger battery and ESP8266 deep sleep could extend runtime to weeks.

Assembly

Before starting, ensure the ESP-12F module is pre-programmed with Tasmota (or any OTA-capable firmware). See ESP-12F programming guide for first-time flashing.

Items needed:

Parts laid out for the build

Step 1:

Assembly step 1

Step 2:

Assembly step 2

Step 3:

Assembly step 3

Step 4:

Assembly step 4

Step 5:

Assembly step 5

Step 6:

Assembly step 6

Step 7:

Assembly step 7

Step 8:

Assembly step 8

Step 9:

Assembly step 9

Final assembly:

Completed switcher assembly
Switcher connected to battery bank and LED string

Completed setup — ESP-12F switcher between battery bank and LED fairy lights.

Sunday, December 30, 2018

Build a $2 IoT/MQTT Node with a Bare ESP-12F

How to use a bare ESP-12F module as a standalone IoT/MQTT node — powered directly from a USB charger with just a handful of passive components, no base board required. Total cost: under $2.

Completed ESP-12F standalone MQTT node

Finished board — ESP-12F module with USB connector, ready to plug into any 5V charger.

Items needed

Prices based on AliExpress at the time of writing:

  • 1x ESP-12F module (pre-programmed with Tasmota firmware)
  • 1x 10k SMD resistor
  • 1x 10k through-hole resistor
  • 2x 4001 SMD diode
  • 1x USB male connector (PCB mount, SMD)

Schematic

ESP-12F standalone board schematic

Wiring diagram — USB 5V stepped down through two diodes to ~3.6V for the ESP-12F.

Board preparation

Step 1 — Ensure the ESP-12F module is programmed with Tasmota firmware. See the ESP-12F programming post for details.

Step 2 — Mount a 10k SMD resistor between the GND and IO15 pads of the ESP-12F module.

10k SMD resistor between GND and IO15

10k SMD resistor soldered between GND and IO15 pads.

Step 3 — Mount a 10k through-hole resistor between the VCC and EN pads of the ESP-12F module.

10k through-hole resistor between VCC and EN

10k through-hole resistor connecting VCC to EN (chip enable).

Another view of the VCC-EN resistor

Another angle showing the VCC–EN pull-up resistor.

Step 4 — Stick a piece of insulation tape on the right side of the ESP-12F module so the USB connector doesn't short any pads.

Insulation tape applied to ESP-12F

Insulation tape prevents shorts between the USB connector and ESP pads.

Step 5 — Place the USB connector as shown below. The SMD pins of the USB connector should sit over the insulation tape.

USB connector placed on ESP-12F

USB connector positioned over the insulation tape.

Step 6 — On the back side, fix the USB connector to the ESP-12F using hot glue. Don't apply hot glue on the SMD pin side yet — that comes later.

Hot glue fixing USB connector on back side

Hot glue secures the USB connector on the back side.

Step 7 — Solder two SMD diodes in series between the + line of the USB connector and the VCC pad of the ESP-12F module.

Two SMD diodes in series for voltage drop

Two 4001 diodes in series drop 5V USB to ~3.6V for the ESP-12F.

Step 8 — Connect the line of the USB connector to the GND pad of the ESP-12F module.

GND wire from USB to ESP-12F

USB ground connected to the ESP-12F GND pad.

Step 9 — Apply hot glue on both sides of the USB connector and ESP-12F for stability.

Hot glue applied for stability

Hot glue on both sides for mechanical strength.

Completed board from another angle

Completed board — ready for testing.

Testing

Step 10 — Power the board with a 5V USB charger and look for an open Wi-Fi SSID named sonoff-NNNN.

Step 11 — Connect to the SSID and follow the standard Tasmota generic module configuration.

Your $2 IoT/MQTT node is ready. Plug it into any USB charger, configure Tasmota to connect to your MQTT broker, and start automating.