debsahu / debsahu/PCF8574_8Relay

Use ESP8266 with 4 Channel Relay without PCF8574

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
53
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Hi Deb

This is exactly what I was looking for. Thanks . I want to use the code with 4 channel relay without the PCF7574. I was using ESP8266 with 4 channel relay using Blynk app but now want to hook it up using mqtt on my new home assistant server. I understand your reason using PCF8574 as few ESP pins trigger high or low. With default behavior, as soon as I power on ESP, it used to turn on all relays. I did few search and found some code and found below code with helped me achieve what I was expecting:

4 Channel relay is connected on D0, D1, D2 and D3

`void setup()
{
// Debug console
Serial.begin(115200);
pinMode(16, OUTPUT); //D0 is GPIO 16
pinMode(5, OUTPUT); //D1 is GPIO 5
pinMode(4, OUTPUT); //D2 is GPIO 4
pinMode(0, OUTPUT); //D3 is GPIO 0
digitalWrite(16, HIGH); //Set GPIO 16 LOW
digitalWrite(5, HIGH); // Set GPIO 5 LOW
digitalWrite(4, HIGH); // Set GPIO 4 LOW
digitalWrite(0, HIGH); // Set GPIO 0 LOW

I have put MAX DEVICES to 4 in your code with works fine but need help removing PCF7574.
`
I am not good with coding so I can request you to make help me modify the code to use it with 4 channel relay without using PCF8574?

Thank you.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.