viewtopic.php?f=24&t=3833&p=38209&hilit=elmaya#p38209
8 buttons and 8 relays in esp with hc595
Thanks for your reply.
I have replaced
with
It work's perfect from Supla app. But the physical buttons take double time to close and open roller shutters. Have you any idea?
I have replaced
Code: Select all
//SuplaDevice.addRelay(101, false);
//SuplaDevice.addRelay(102, false);
//SuplaDevice.addRelay(103, false);
//SuplaDevice.addRelay(104, false);
//SuplaDevice.addRelay(105, false);
//SuplaDevice.addRelay(106, false);
//SuplaDevice.addRelay(107, false);
//SuplaDevice.addRelay(108, false);
// CHANNEL8 - Thermometer DS18B20
SuplaDevice.addDS18B20Thermometer();
memset(btn, 0, sizeof(btn));
btn[0].pin =5; // pin gpio buton 0 = no buton
btn[0].relay_pin =101; // pin gpio Relay
btn[0].channel =0; // channel
btn[0].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[0].mem =0;
btn[1].pin =4; // pin gpio buton 0 = no buton
btn[1].relay_pin =102; // pin gpio Relay
btn[1].channel =1; // channel
btn[1].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[1].mem =0;
btn[2].pin =2; // pin gpio buton 0 = no buton
btn[2].relay_pin =103; // pin gpio Relay
btn[2].channel =2; // channel
btn[2].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[2].mem =0;
btn[3].pin =14; // pin gpio buton 0 = no buton
btn[3].relay_pin =104; // pin gpio Relay
btn[3].channel =3; // channel
btn[3].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[3].mem =0;
btn[4].pin =12; // pin gpio buton 0 = no buton
btn[4].relay_pin =105; // pin gpio Relay
btn[4].channel =4; // channel
btn[4].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[4].mem =0;
btn[5].pin =13; // pin gpio buton 0 = no buton
btn[5].relay_pin =106; // pin gpio Relay
btn[5].channel =5; // channel
btn[5].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[5].mem =0;
btn[6].pin =3; // pin gpio buton 0 = no buton
btn[6].relay_pin =107; // pin gpio Relay
btn[6].channel =6; // channel
btn[6].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[6].mem =0;
btn[7].pin =1; // pin gpio buton 0 = no buton
btn[7].relay_pin =108; // pin gpio Relay
btn[7].channel =7; // channel
btn[7].ms =0; // if = 0 Bistable -- if > 0 Monostable for X ms
btn[7].mem =0;
supla_btn_init();
Code: Select all
// CHANNEL0 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(101, // Pin number where the 1st relay is connected
102, false); // Pin number where the 2nd relay is connected
SuplaDevice.setRollerShutterButtons(0, // Channel Number
5, // Pin where the 1st button is connected
4); // Pin where the 2nd button is connected
// CHANNEL1 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(103, // Pin number where the 1st relay is connected
104, false); // Pin number where the 2nd relay is connected
SuplaDevice.setRollerShutterButtons(1, // Channel Number
2, // Pin where the 1st button is connected
14); // Pin where the 2nd button is connected
// CHANNEL2 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(105, // Pin number where the 1st relay is connected
106, false); // Pin number where the 2nd relay is connected
SuplaDevice.setRollerShutterButtons(2, // Channel Number
12, // Pin where the 1st button is connected
13); // Pin where the 2nd button is connected
// CHANNEL3 - TWO RELAYS (Roller shutter operation)
SuplaDevice.addRollerShutterRelays(107, // Pin number where the 1st relay is connected
108, false); // Pin number where the 2nd relay is connected
SuplaDevice.setRollerShutterButtons(3, // Channel Number
3, // Pin where the 1st button is connected
1); // Pin where the 2nd button is connected
Do not worry about it. This is how it should work when fully closed / opened.
These modules it's ok?
https://allegro.pl/oferta/74hc595-rejes ... 7594566453
https://allegro.pl/oferta/8-kanalowy-mo ... 8047947761
https://allegro.pl/oferta/wemos-d1-mini ... 7804539515
I need only flash wemos with suitable bin and next connect all?
https://allegro.pl/oferta/74hc595-rejes ... 7594566453
https://allegro.pl/oferta/8-kanalowy-mo ... 8047947761
https://allegro.pl/oferta/wemos-d1-mini ... 7804539515
I need only flash wemos with suitable bin and next connect all?
The relay module is active low.bulek68 wrote: ↑Wed Oct 02, 2019 2:22 pm These modules it's ok?
https://allegro.pl/oferta/74hc595-rejes ... 7594566453
https://allegro.pl/oferta/8-kanalowy-mo ... 8047947761
https://allegro.pl/oferta/wemos-d1-mini ... 7804539515
I need only flash wemos with suitable bin and next connect all?
the outputs will be on when the app shows off.
Better to use relay with active high .
the rest ok
![Wink ;)](./images/smilies/icon_e_wink.gif)
yesbulek68 wrote: ↑Wed Oct 02, 2019 2:59 pmThis will be ok![]()
https://botland.com.pl/en/relays/2357-r ... 41373.html
It's not a good idea, it slows down the code a lot.
esp 8266 are very cheap, better a separate one.
![Wink ;)](./images/smilies/icon_e_wink.gif)