Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

ESP8266 Internet Connected Switch (EasyIoT Cloud MQTT API V1)

ESP8266 Internet Connected Switch (EasyIoT Cloud MQTT API V1)

It’s project time! Today, going to make a switch. This Internet-controlled switch uses few components, and it’s connected to EasyIoT Cloud. You can control your devices on a computer in the EasyIoT Cloud WEB interface or with a native Android application. The Internet-controlled switch is connected via Wi-Fi connection. Our switch can also be controlled locally with the push of a button.

This tutorial is an improved version of the ESP8266 Internet-connected switch. It works with the latest version of EasyIoT Cloud MQTT broker. Two main improvements are that this uses switch information to update the state of the UI interface. If the connection to switch is broken, then the state in UI will not update. The next improvement is that in this switch, you can configure the AP username and password with a mobile phone or computer.

WARNING!! You will play with LIVE MAINS!! Deadly zone!!

No EasyIoT Cloud configuration is needed, just register to the EasyIoT Cloud service. You will need username and password to access your Internet switch via web application or Android application. The switch will be automatically added to EasyIoT Cloud and will be visible in the web interface or in the Android application after it is powered on.

The program is written in the Arduino ESP8266 IDE. Check out the Arduino ESP8266 IDE tutorial to see how to connect a ESP8266 module to a computer to upload a program. The program can be downloaded from our GitHub. You will also need the MQTT client library. Add this library to the library folder in the Arduino IDE. Our program uses the EasyIoT Cloud MQTT API.

In our case, we use ESP8266 01, but you can use any other type of ESP8266. GPIO2 is connected to the NPN transistor to control SSR. The max current for our type of solid state relay is 2A — this is suitable for room light and not for applications that consume more power, like a heater.

For the power supply, we use a 3.3V step-down module. It’s very important to add a 1000uF capacitor to the 3.3V power line — when we tried it without the capacitor, the switch didn’t work.

GPIO0 is connected to the push button for local control of the Internet switch.

ESP8266 internet switch schematic

After power on, the switch will be automatically added to EasyIoT Cloud, and it will be visible in the web interface or the Android application.

more info and full detailed guide: DZone IoT







 

More Articles to Read

App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: Noise analysis for high-speed op amps
App note: Noise analysis for high-speed op amps
Skill Sunday: Arrays
Skill Sunday: Arrays
App note: Infrared remote control implementation with MSP430FR4xx
App note: Infrared remote control implementation with MSP430FR4xx
Gesture Controlled Smart Home
Gesture Controlled Smart Home
Design for a Wideband, Differential Transimpedance DAC Output
Design for a Wideband, Differential Transimpedance DAC Output
Wrist thrusters let you fly through the water effortlessly
Wrist thrusters let you fly through the water effortlessly
Bertan/Spellman 225-20R HV power supply teardown
Bertan/Spellman 225-20R HV power supply teardown
Blinking Christmas Lights
Blinking Christmas Lights
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adding an “extra sense” with rangefinders
Adding an “extra sense” with rangefinders
This wireless game controller looks like a rug
This wireless game controller looks like a rug
How to run your ESP8266 for years on a battery
How to run your ESP8266 for years on a battery
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Making beats on a tiny Arduino DJ controller
Making beats on a tiny Arduino DJ controller
Qinsi-QS5100 Sn63Pb37 solder profile
Qinsi-QS5100 Sn63Pb37 solder profile
Water Detection System
Water Detection System
Professional Hi-Fi 15W Tube Amplifier circuit
Professional Hi-Fi 15W Tube Amplifier circuit
This Arduino machine will judge how sick your ollies are
This Arduino machine will judge how sick your ollies are
Turn an old payphone into a boombox for ’90s hits
Turn an old payphone into a boombox for ’90s hits

Top


Shares