Today, while organizing my shelves, I came across a Sonoff BASIC R2 WiFi Wireless Smart Switch that I had purchased years ago but never put to use. I decided it was finally time to unlock its potential and integrate it into my smart home setup.
Before getting started here is a short video of how it goes on my farsi youtube channel:
What is the Sonoff BASIC R2?
The Sonoff BASIC R2 is a DIY WiFi wireless smart switch powered by an ESP32 microcontroller. It enables you to control devices remotely, automate schedules, and even integrate with voice assistants like Google Assistant. This little device is a powerhouse for anyone looking to get started with smart home automation.
Photo source: Sonoff website
Features of the Device
Input and Output Ports:
On one side, you have the input (N and L), and on the other, the output (N and L). These ports are clearly labeled for easy wiring.
Photo source: device.report
⚠️ Pro Tip:
Black or blue wires are typically neutral (N).
Red or yellow wires are usually live (L).
Always double-check your wiring to avoid issues.
Wiring Instructions
Carefully follow these steps for safe and proper wiring:
- Turn off the electricity before starting.
- Connect the neutral (N) wire to the N input port and the live (L) wire to the L input port.
- Do the same for the output side.
⚠️ Safety Reminder: Wear insulated gloves and shoes to prevent accidents. Ensure the power is completely off before handling wires.
For detailed instructions, you can refer to the official manual here.
Setting It Up with eWeLink
Once the wiring is complete and electricity is restored, the device will start blinking, indicating it's ready for pairing. Follow these steps:
- Download the eWeLink App (available on both Android and iOS).
- Connect your phone to a nearby WiFi network (make sure it’s in range of the Sonoff device).
- Sign up or log in to the app.
- Tap the Add Device button in the top-right corner.
- Enter your WiFi credentials.
- The app will detect the Sonoff device via Bluetooth. (Ensure your phone’s Bluetooth is turned on.)
- Once the device connects to your WiFi, it will appear on the app's home page.
Customizing Your Sonoff Device
The eWeLink app offers plenty of customization options, including:
- Scheduling on/off times.
- Controlling the device locally (LAN) or remotely via the eWeLink cloud.
- Adding scenes or automations for seamless integration into your smart home.
Integrating with Google Assistant
To enable voice control, follow these steps:
- Install the Google Home app and sign in.
- Go to the device details page in the eWeLink app and select Google Home as a third-party integration.
- Follow the linking process to connect the device to Google Home.
Once linked, you can control your device using Google Assistant by calling it the name you set up in eWeLink (e.g., "Turn on the kitchen light").
Final Thoughts
By using the Sonoff BASIC R2, I’ve turned a simple lamp into a smart device controlled by Google Assistant. This experiment reminded me of the versatility of ESP32-based devices and how easy it is to bring older gadgets to life with the right tools.
But this is just the beginning! I’m currently working on some exciting new projects, like building an RC robot on wheels, and I have big plans to create flying robots such as RC airplanes and quadcopters in the future.
Your support means the world to me. It helps me gather the tools and materials needed to bring these awesome ideas to life. Together, we can explore the endless possibilities of DIY tech and robotics!
Do you have unused smart home devices lying around? Maybe it's time to dust them off and see what you can do! Let me know in the comments if you have any questions, suggestions, or just want to share your own projects.