Warning: Declaration of Db::query($query) should be compatible with mysqli::query($query, $resultmode = NULL) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 29

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/u1300519/data/www/acoptex.com/_lib/CacheLite/Lite.php on line 757

Warning: Cannot modify header information - headers already sent by (output started at /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php:0) in /var/www/u1300519/data/www/acoptex.com/_config/config.php on line 168

Warning: session_start(): Cannot start session when headers already sent in /var/www/u1300519/data/www/acoptex.com/_config/config.php on line 169

Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 92

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 92

Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64

Warning: mysqli_fetch_array() expects parameter 2 to be int, string given in /var/www/u1300519/data/www/acoptex.com/_lib/class.Db.php on line 64
jobs.html_title
1

member

Easy Basics: Project 069a Sonoff smart wifi switch

of Acoptex.com in ESP8266 ESP-01

Basics: Project 069a

Project name: Sonoff smart wifi switch

Tags: sonoff basic wifi switch, sonoff smart switch, ESP8266

WARNING – THIS PROJECT INVOLVES HIGH VOLTAGES THAT CAN CAUSE SERIOUS INJURY OR DEATH. PLEASE TAKE ALL NECESSARY PRECAUTIONS, AND TURN OFF ALL POWER TO A CIRCUIT BEFORE WORKING ON IT. WE ARE NOT RESPONSIBLE FOR ANY DAMAGE, INJURY, DEATH AND OTHER THINGS CAUSED BY THIS PROJECT IMPLEMENTATION. 

In this project, you need these parts :

1. Sonoff smart wifi switch 1pc

General

We will learn about Sonoff smart wifi switch.

Understanding the Sonoff smart WIFI switch

Sonoff Basic is an affordable device that provides users with smart home control. You can get a Sonoff for approximatly $5. It is a WiFi-based wireless switch that can connect to a wide range of appliances. Sonoff transmits data to a cloud platform through the WiFi router, which enables users to remotely control all the connected appliances, via the mobile application eWeLink. The cloud server of Sonoff is Amazon AWS global server.

Sonoff Basic makes all home appliances smart. As long as the mobile has a network, users can remotely control the appliances from anywhere at any time. Another feature available is to set timing schedules for the appliances, which can include countdown, scheduled on/off, and can thus, help users maintain an easy life. 

Features:

  • Supports status tracking, home appliances status timely feedback to your App.
  • Supports remotely turn on or off added devices.
  • Supports single/repeat/countdown timing tasks for each added device.
  • Supports numerous WiFi smart switches one account.
  • Easy installation, easy handling and can be activated immediately and stable.
  • Works With Alexa
  • Works With the Google Assistant
  • Works With IFTTT
  • Works With Nest

Specification:

  • Voltage range: 90-250v AC(50/60Hz)
  • Max current: 10A
  • Max Wattage: 2200 watts
  • Dimensions: (L)88*(W)38*(H)23mm
  • Color: White
  • Operating Temperature: 0ºC-40ºC(32°F-104°F)
  • Operating Humidity: 5%-90%RH, Non-condensing
  • Wireless Frequency: 2.4Ghz

You can download the APP eWeLink in Apple App Store for iOS version and in Google Play for Android version.

eWeLink is a smart home control APP that can control all ITEAD home automation devices and cooperated products. It allows you to remote control and manage your favorite smart devices of different brands in a single App. After adding the smart home devices to the account, users can remote control the devices on smartphone over WiFi/2/3/4G netowrk. User can also control on WeChat by accessing to Coolkit's WeChat subscription account. You can read more about it here.

eWeLink Basic Functions:

  • Remote on/off
  • Countdown/schedule timer
  • Share control
  • Group/scene management

Let’s take a look inside the Sonoff smart Wifi switch. These are 4 main sections:

  1. There are the two powerlines and they are isolated from the rest of the circuit
  2. The active line goes to the relay (that’s on the other side of the PCB)
  3. The ESP8266, that is the processor that provides wifi and receives the control commands
  4. The Sonoff is meant to be hacked and you can see clearly that those 4 connections were left out, so that you can solder some pins and upload a custom firmware

It’s very simple - it has an input in one side and an output on the other side. You can simply send commands via wifi to turn on and off. That’s pretty much how it works.

See more details of Sonoff Basic DimensionSonoff Basic SchematicSonoff ViewESP8266 Datasheet V4.1 ENIP66 Waterproof CaseInstallation instructions and user guide and eWeLink Step-By-Step Guide

In this project, we’re going to use the standard firmware that came with the Sonoff. 

Let’s thave a look at how this would fit in a normal circuit. Basically you cut the wire that goes to the device, and you put the Sonoff in the middle, so that you can control any device that is connected on the other end.

Normally, what you have is a power source that has an active and neutral line that goes to a load, your load can be lamp for example. In the middle, you usually have a switch.

Note: if you have a earth line, it has to go outside the sonoff.

WARNING – THIS PROJECT INVOLVES HIGH VOLTAGES THAT CAN CAUSE SERIOUS INJURY OR DEATH. PLEASE TAKE ALL NECESSARY PRECAUTIONS, AND TURN OFF ALL POWER TO A CIRCUIT BEFORE WORKING ON IT. WE ARE NOT RESPONSIBLE FOR ANY DAMAGE, INJURY, DEATH AND OTHER THINGS CAUSED BY THIS PROJECT IMPLEMENTATION. 

Wiring


Step by Step instruction

  1. Do wiring.
  2. Search for the eWeLink app and install it.
  3. Open the app and create an account.
  4. Power up the Sonoff device and connect the appliance that you want to control (in our case, it’s a light bulb).
  5. Press and hold the Sonoff button for 5 seconds, so the LED green starts blinking.
  6. Go to the app and press Next button.
  7. Enter your network credentials and choose a name for your device.
  8. Add it to your dashboard.
  9. Refresh the dashboard and you should see your device. Press the on button to turn it on. Now the light bulb is ON. and if you turn off. The light bulb is OFF.
  10. Keep in mind that with this app you can control any device on and off from anywhere in the world, because it’s controlled through the eWeLink cloud servers.The app also comes with a nice set of features, click the timer button. You can add a timer that can be activated on a certain date and time.

Summary

We have learnt about Sonoff smart wifi switch.

Library

  • No libraries needed in this project

Sketch

  • No sketches needed in this project


Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy of Acoptex.com in Sipeed Maixduino 04-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

jobs.published_at
jobs.viewed