Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›IoT & Wireless
  4. ›Sonoff BASIC R3, BASICR4 and MINI R4

Component guide · Beginner · 4 min read

Sonoff BASIC R3, BASICR4 and MINI R4

Wiring, eWeLink, DIY Mode and ESPHome

By Geekobot Learning Team · Updated 29 Oct 2026

On this page
Short answerWhat the Sonoff BASIC and MINI isSonoff BASIC and MINI pinoutWiring the Sonoff BASIC and MINIExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

Sonoff BASIC and MINI switches are small Wi-Fi relays that make any light or socket smart. The BASIC R3 and BASICR4 sit inline in the cable (10 A); the MINI R4, MINIR4M and MINI-D fit behind a wall switch and keep the switch working. Set them up in the eWeLink app for Alexa and Google, or use DIY mode, ESPHome or Tasmota for local control in Home Assistant.

Key specs at a glance

Load
10 A at 100 to 240 V AC (BASIC, MINI R4, RFR3); MINI-D dry contact
Chip
ESP8285 (BASIC R3, RFR3), ESP32 (BASICR4, MINI R4, MINIR4M)
Wireless
2.4 GHz Wi-Fi; RFR2 and RFR3 also 433 MHz RF remote; MINI-D Matter over Wi-Fi
Wall switch input
S1/S2 terminals on MINI R4 and MINIR4M
Apps
eWeLink, Alexa, Google Home; Matter on MINI-D and MINIR4M
Size
BASIC about 88 x 38 mm; MINI R4 about 40 x 33 mm
!Safety: Mains voltage can kill

This part is often wired to 230 V mains. Do all wiring with the plug pulled out, keep mains wires inside a closed box with strain relief, add a fuse, and never touch the board while it is plugged in. If you are new to mains wiring, have an electrician check it before you switch on.

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1Sonoff BASIC R3 Smart ON/OFF WiFi Switch₹672
  • Option 2Sonoff BASICR4 WiFi ESP32 Chip Smart Switch₹779
  • Option 3Sonoff MINI R4 Extreme Wi-Fi Smart Switch₹1,491
  • Option 4Sonoff MINIR4M MINI Extreme WiFi Smart Home Switch₹2,038
  • Option 5Sonoff MINI-D Dry WiFi Smart Switch with Matter₹2,049
  • Option 6Sonoff RFR2 Smart Home WiFi Remote Control Switch 433MHz 10A₹1,119
01

What the Sonoff BASIC and MINI is

The BASIC goes between a plug and an appliance or in a ceiling light feed. The MINI R4 sits in the switch box behind an existing switch, so the wall switch still works and the app adds remote and timer control.

The ESP32-based R4 models support eWeLink-Remote and local control features; the older R3 is ESP8285 and the easiest to flash with Tasmota.

02

Sonoff BASIC and MINI pinout

The pins on the Sonoff BASIC and MINI and what each one does.

PinFunction
L in / N inMains live and neutral in
L out / N outTo the load
S1 / S2Wall switch terminals (MINI R4, MINIR4M)
ButtonHold 5 s to pair; quick presses toggle the relay
LEDWi-Fi and pairing status
PinFunction
L in / N in
Mains live and neutral in
L out / N out
To the load
S1 / S2
Wall switch terminals (MINI R4, MINIR4M)
Button
Hold 5 s to pair; quick presses toggle the relay
LED
Wi-Fi and pairing status
03

Wiring the Sonoff BASIC and MINI

Mains wiring must be done with the power off, in a proper enclosure, with cable and a fuse or MCB rated for the load. If you are not sure, have a qualified electrician install it. These switches need a neutral wire; many Indian switch boxes have only live, so check before buying a MINI.

Sonoff BASIC and MINI pinBASIC R3 / BASICR4MINI R4 / MINIR4M
L in / N inSupply live and neutralSupply live and neutral
L out / N outLight or applianceLight (live through relay)
S1 / S2-Existing wall switch (two wires)
L in / N in
BASIC R3 / BASICR4:
Supply live and neutral
MINI R4 / MINIR4M:
Supply live and neutral
L out / N out
BASIC R3 / BASICR4:
Light or appliance
MINI R4 / MINIR4M:
Light (live through relay)
S1 / S2
BASIC R3 / BASICR4:
-
MINI R4 / MINIR4M:
Existing wall switch (two wires)
04

Example code

The BASICR4 and MINI R4 use different pins; copy the ESPHome device page for your exact model. Flash over a USB to TTL adapter with the device off mains, or use DIY mode OTA where supported.

ESPHome config for a BASIC R3 (ESP8285) · yaml
esphome:
  name: sonoff-basic
esp8266:
  board: esp8285
wifi:
  ssid: "your-wifi"
  password: "your-password"
api:
ota:
  - platform: esphome
binary_sensor:
  - platform: gpio
    pin: {number: GPIO0, mode: INPUT_PULLUP, inverted: true}
    name: "Button"
    on_press: {then: [switch.toggle: relay]}
switch:
  - platform: gpio
    id: relay
    name: "Sonoff Relay"
    pin: GPIO12
status_led:
  pin: {number: GPIO13, inverted: true}
05

Setup and tuning

eWeLink

hold the button 5 s until the LED blinks fast, then add the device in the app on 2.4 GHz Wi-Fi.

DIY mode

gives a local HTTP API (port 8081) without cloud, on models that support it.

Flashing

solder headers to the 3V3, RX, TX, GND pads and hold the button while powering from the adapter; never connect mains while flashing.

Load

derate for motors and LED drivers with high inrush.

06

What you need

Shop this list10 of 11 found in our store · ₹32,457

  • Sonoff BASIC R3 Smart ON/OFF WiFi Switch: the part this guide coversSonoff BASIC R3 Smart ON/OFF WiFi Switch₹672
  • Sonoff BASICR4 WiFi ESP32 Chip Smart Switch: another version this guide coversSonoff BASICR4 WiFi ESP32 Chip Smart Switch₹779
  • Sonoff MINI R4 Extreme Wi-Fi Smart Switch: another version this guide coversSonoff MINI R4 Extreme Wi-Fi Smart Switch₹1,491
  • Sonoff MINIR4M MINI Extreme WiFi Smart Home Switch: another version this guide coversSonoff MINIR4M MINI Extreme WiFi Smart Home Switch₹2,038
  • Sonoff MINI-D Dry WiFi Smart Switch with Matter: another version this guide coversSonoff MINI-D Dry WiFi Smart Switch with Matter₹2,049
  • Sonoff RFR2 Smart Home WiFi Remote Control Switch 433MHz 10A: another version this guide coversSonoff RFR2 Smart Home WiFi Remote Control Switch 433MHz 10A₹1,119
  • Sonoff RFR3 Intelligent Wi-Fi Smart Switch w/ Alexa & 433MHz RF: another version this guide coversSonoff RFR3 Intelligent Wi-Fi Smart Switch w/ Alexa & 433MHz RF₹898
  • Home Assistant Green smart home hub: to control the switches locallyHome Assistant Green Smart Home Hub₹23,149
  • USB to TTL serial converter: to talk to the module from a PCUSB to TTL Serial Converter (CH340G / CP2102 / FT232RL / PL2303)₹85Closest match, check the specs
  • Fuse holder: to fuse the switched circuitFind this part
  • Digital multimeter: to check supply and signal voltagesDigital Multimeter₹177
07

Alternatives and when to choose them

  • ✓Sonoff, Tasmota and ESPHome: smart switches and open firmware.
  • ✓Sonoff POW energy switches: with power monitoring.
  • ✓MQTT and Home Assistant: local control and automations.
08

Common mistakes to avoid

  • !Installing a MINI where there is no neutral wire.
  • !Connecting mains while the USB adapter is attached.
  • !Loading the 10 A relay with a motor's start current.
  • !Using a 5 GHz Wi-Fi network for pairing.
09

Frequently asked questions

Does it work with Alexa and Google?

Yes, through the eWeLink skill and action.

Can it work without internet?

Yes, with DIY mode, ESPHome or Tasmota and a local hub like Home Assistant.

Do I need a neutral wire?

Yes, for all these models.

BASIC R3 or MINI R4?

BASIC for inline cables and plugs; MINI R4 to keep a wall switch working.

Can it control a fan?

On and off only; use an iFan or fan controller for speed.

Parts for this guide

  • Sonoff BASIC R3 Smart ON/OFF WiFi Switch
    ₹672View
  • Sonoff BASICR4 WiFi ESP32 Chip Smart Switch
    ₹779View
  • Sonoff MINI R4 Extreme Wi-Fi Smart Switch
    ₹1,491View
  • Sonoff MINIR4M MINI Extreme WiFi Smart Home Switch
    ₹2,038View
  • Sonoff MINI-D Dry WiFi Smart Switch with Matter
    ₹2,049View
  • Sonoff RFR2 Smart Home WiFi Remote Control Switch 433MHz 10A
    ₹1,119View
  • Sonoff RFR3 Intelligent Wi-Fi Smart Switch w/ Alexa & 433MHz RF
    ₹898View
  • Home Assistant Green Smart Home Hub
    ₹23,149View
  • USB to TTL Serial Converter (CH340G / CP2102 / FT232RL / PL2303)
    ₹85View
  • Fuse Holder (Panel, PCB and HRC)
    ₹105View
  • Digital Multimeter
    ₹177View
Shop Smart Home Switches, Relays & Energy Meters

Keep learning

How-toIntermediateWi-Fi Smart Switches and RelaysSmart switches are Wi-Fi relays that turn lights and appliances on and off.3 min read · IoT & WirelessConcept explainerIntermediateMQTT and Home Assistant for ESP32MQTT is a lightweight messaging system: devices publish messages to named topics on a broker, and anything subscribed to that topic receives them.3 min read · IoT & WirelessComponent guideIntermediateUSB to TTL Serial AdaptersA USB to TTL adapter turns a computer USB port into a 3.3 V or 5 V serial port, so you can program boards without USB (Pro Mini, ESP-01, ESP32-CAM) or read a debug console.4 min read · Boards & Microcontrollers

Sources

  • Sonoff BASIC R3, BASICR4, MINI R4 and MINI-D user manuals
  • ESPHome device documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the Sonoff BASIC and MINI isSonoff BASIC and MINI pinoutWiring the Sonoff BASIC and MINIExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide8 items · ₹31,593

Sonoff BASIC R3 Smart ON/OFF WiFi Switch · Sonoff MINI R4 Extreme Wi-Fi Smart Switch · Sonoff MINIR4M MINI Extreme WiFi Smart Home Switch · Sonoff MINI-D Dry WiFi Smart Switch with Matter · Sonoff RFR2 Smart Home WiFi Remote Control Switch 433MHz 10A · Sonoff RFR3 Intelligent Wi-Fi Smart Switch w/ Alexa & 433MHz RF · Home Assistant Green Smart Home Hub · Digital Multimeter

Ask the Community

Ask a question