[SOLVED] Arduino UNO + ESP8266 + 4 relay

can you show in an picture these on your ESP?

In setup you can add the following to ensure the relays will be off when you restart the Uno

  pinMode(Relay10, OUTPUT);        // sets the digital pin as output
  digitalWrite(Relay10, HIGH);        // Prevents relays from starting up engaged

I am guessing you have something like this:

I am interested to know how you have set up the infrafred remote. The relays are connecting to the handset for your infrared device or they are connecting directly to the motors that drive the blinds? If it is the former I’m sure you will find you need extra components in the circuit to drive the infrared remote control.

Either way you should hear the relays click if they are being turned on and off. My sketch only simulates V1 being pressed on and off once but that should be enough for testing purposes. I am also interested to know what part of your system was actually working as you have indicated one of the relays was responding at some point.

1 Like

I’m waiting for a 4 relay board, for now I’m experimenting with a 2 relay board.

bit.ly/21RMCjR

I have a bypass on the IR remote buttons with a wire coming from button IN and button OUT. These wires are connected to the relays. When relays are on, they mimetize a button press by letting current power pass for 500ms.

Everything works fine except for what I’ve said: when I start UNO for the first time, if I click V2, I see the messages on the LCD but the relay do nothing. Although, if I press D11 (that should be activated by V2) off and on, one time, then everything works fine.

I wrote this code in the void.setup for relay 10-14 and now everything works like it should. Strange, cause I had already " digitalWrite(Relay10, HIGH)" there.

Glad we got there in the end.

1 Like

Can’t thank you enough!

I’m changing my system to a arduino nano that I will put in the wall to control the blinds directly with the 4 relay + one relay to control the light + one relay to control a thermoventilator + a LM35.

I’m researching ideas so I could control the blinds relays with a physical switch also. What do you think would be the best way? I thought of a 4 push button socket but can’t find it anywhere. Ideas, suggestions?

Would something like this work http://www.homedepot.com/p/Cooper-Wiring-Devices-Standard-Grade-15-Amp-120-277-Volt-4-Way-Decorator-Switch-with-Back-Push-and-Side-Wiring-Ivory-Color-7504V-BOX/205618146 ?

What we sometimes do with our switches is code the Arduino to count the button presses. So 1 momentary switch can do lots of things. One press lights on, two lights off, three garage door open, four garage door close, five turn on electric blanket, six turn off electric blanket.

It’s not ideal and you have to set a timeout so the count goes to zero after say 10 seconds (with Simple Timer).

There is some info here: http://diy.stackexchange.com/questions/7233/home-light-switch-circuit-with-5-switches

I think it’s called a “hotel light”, not sure why, but it’s basically one light operated with two switches. I think the same can be applied with your blinds.