Skip to content

MarekStenchlak/wifiSwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wifiSwitch

MQTT wifi wall switch using ESP8266-01

Description

Switch can be controlled via MQTT or touch button.

it is well suited for 68mm Europe wall boxes.

Switch is based on wifi board ESP8266-01.

Code is implemented in Arduino. Source files can be found in repository.

This project requires 220V mains to operate properly

If you are not familiar with mains DO NOT TRY TO INSTALL THIS SWITCH

Proceed only if you know what you are doing !!!

Board can be ordered on OSH park: https://oshpark.com/shared_projects/9JxnbNwu

Schematics

Schematics for this project was designed using Eagle.

Eagle project can be found in repository.

Eagle Scheme

Board

Eagle Board

BOM (Bill Of Materials)

TODO

3D model

3D model was designed in Sketch-Up and exported to STL files.

Model consists of 3 parts: box, frame and button cover.

3D model files and exported STL files can be found in repository.

Exploded view looks like this:

3D exploded view

Setup

Wiring

Be sure you know what you are doing! Never touch any live wires ! Be sure to turn off electricity when dealing with mains!

If you do not have Neutral wire in the wall box (which you probably don`t), you will have to wire new cable and connect it to Neutral.

wiring diagram

MQTT broker

To use this switch you need to have an MQTT broker like Mosquitto installed on a server or RaspeberryPi in your local wifi network.

To install Mosquitto, please follow this guide: Setup mosquitto MQTT broker

or this guie for RaspberryPi: Setup mosquitto MQTT broker on RPi

The bast practise is to set static IP address to the MQTT broker server or raspberryPi running mosquitto.

WifiSwitch settings

This switch is using WifiManager project to set-up switch parameters.

When the switch is connected to mains, it tries to connect to configured Wifi network and MQTT broker. If it is not able to connect or is not configured, it enters the configuration mode.

Configuration mode

When in configuration mode, the switch creates its own wifi network. This network`s SSID consists of string "ESP_HOME" followed by its MAC address

e.g: ESP_HOME A1:B2:3A:4E:2D:E2

This network has no Password.

After you connect to this network (e.g using smartphone) enter IP address

192.168.4.1

Then configure:

wifi SSID

wifi Password

MQTT broker IP (or DNS name)

MQTT broker port

MQTT username

MQTT password

MQTT topic

Final Product

Assembled board

Assembled board 1

Assembled board 2

Assembled switch

Assembled switch 1

Assembled switch 2

Assembled switch 3

Releases

No releases published

Packages

No packages published

Languages