Skip to content

A Program to control a 2ch relay with a esp8266 using mqtt protocol

License

Notifications You must be signed in to change notification settings

KATT07/2chrelay-esp8266-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Setup

You will need the following pre-configured

  • mqtt Broker
  • mqtt subscriber to send the messages node-red/homeassistant/etc

Goto Library Manager on Arduino IDE
Add PubSubClient Library by Nick O'Leary

Software

Replace XXX in the .ino to the correct details of ur mqtt broker and wifi credentials.
Also Make sure to use 2.4GHz Wifi as esp8266 cannot connect to 5Ghz wifi

Connections

esp8266 -> Relay
D1 pin -> Relay 1 (In1)
D2 pin -> Relay 2 (In2)
Vin(5v) -> Vcc
Gnd(5v) -> Gnd

General

MQTT messages:
on1: Relay 1 Turns on
on2: Relay 2 Turns on
off1: Relay 1 Turns off
off2: Relay 2 Turns off

About

A Program to control a 2ch relay with a esp8266 using mqtt protocol

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages