Go Down

Topic: How do i remotely control Arduino Uno using esp8266-01 to turn off/on the relay (Read 4884 times) previous topic - next topic

loli_roller

Hi,

I am new to Arduino and i am learning programming by making projects tho i am not totally new to programming but i still have a lot to learn.

I am working on automating my home appliances like turning on/off lights and fans with an 8 channel relay,
I was able to turn on/off all relays with a push button thanks to the tutorials now i am trying to turn the relays on remotely using esp8266-01 but then i noticed it had only 2 GPIO pinouts that means i can only remotely control 2 relay switches, then i thought what if i just remotely control the arduino uno using the RX/TX pinouts if so are there any tutorials out there that would help me remotely control the arduino to switch the relays on/off.

Ill be using at least 4 relay channels but i would prefer 8 if possible.

Thank you :)

pert

I've deleted your other cross-post @loli_roller.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

zoomkat

loli_roller, I suggest you delete this post and post your question in the projects topic area, as that area seems to have much more traffic and views.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

loli_roller

I've deleted your other cross-post @loli_roller.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.
Thanks for deleting the other post it was posted in the education by mistake and i apologize for it, when i realized it was posted in the wrong section i tried deleting the post it said it got moved to another section.
so i couldn't remove it in time.

loli_roller

loli_roller, I suggest you delete this post and post your question in the projects topic area, as that area seems to have much more traffic and views.
Thanks ill try posting in the Project Guidance after deleting this post.

pert

It's better to move the post to the appropriate board. I'll go ahead and do that now.

In the future, if you need a post moved, you can click the "Report to moderator" link that's at the bottom of every post and ask the moderators to move it (since you can't move posts yourself).

Of course, it's best to just post to the correct forum board in the first place. In this case, I think you made a reasonable choice by posting to Home Automation and Networked Objects, so you are probably already on the right track.

pert

@loli_roller I guess you didn't see my reply that I already moved this to the Project Guidance board. I have deleted your other duplicate topic.

Paul__B

The ESP-01 has four I/O pins available.  You use it to feed a 74HC595 which gives you eight outputs for your relay board.

An Arduino board is superfluous (and a UNO is particularly cumbersome).

Juraj

do you want to write your own sketch for esp, or you want to use a firmware in esp and a corresponding networking library in Uno (like AT firmware and WiFiEsp(AT) library)?

loli_roller

do you want to write your own sketch for esp, or you want to use a firmware in esp and a corresponding networking library in Uno (like AT firmware and WiFiEsp(AT) library)?
Thank you for the quick response.

I would prefer writing my own sketch for esp if possible, if not then i can do it using both arduino and esp-01.

And later ill be using one or the remaining relay switches to control the fan speed if i can.

It would be great if you can provide some learning resources to achieve this. I am pretty new.

I would like to use the arduino in future projects if possible

loli_roller

The ESP-01 has four I/O pins available.  You use it to feed a 74HC595 which gives you eight outputs for your relay board.

An Arduino board is superfluous (and a UNO is particularly cumbersome).

How i mean mine has 2 GPIO 01 and 02 and the others are rst, rx, tx and en

Juraj

How i mean mine has 2 GPIO 01 and 02 and the others are rst, rx, tx and en
it is io 0, io 2, and io 1 and io 3. 1 and 3 are RX/TX.
the pins are not gpio on esp8266. almost all have some restrictions.

use a esp8266 development board if you want the esp8266 as your MCU. they have USB and 9 io pins, but only few of the pins are suitable to control a relay so you still will have to use a 'pin extender' or an I2C relay board

wvmarle

Pin 1 and 3 are usable as GPIO pins if you don't use Serial - where the caveat is that those pins are also for programming, so you still have to be careful with whet gets attached to it. GPIO0 and GPIO2 are involved in the boot process; GPIO0 must have a fixed external pull-up; GPIO2 must be left floating or pulled up for proper boot (the internal pull-up will be enabled during boot).

If using a latching shift register like the 595 use GPIO0, 1 and 3 (don't use Serial in the sketch), that leaves GPIO2 (Serial1 TX) available for debugging. As all three shift register pins are inputs, you will still be able to program the device over Serial.

If using a non latching shift register like the 164 I'd use GPIO0 and 2 for the data and clock pins, leaving GPIO1 and 3 free - for Serial, for example.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

loli_roller

Pin 1 and 3 are usable as GPIO pins if you don't use Serial - where the caveat is that those pins are also for programming, so you still have to be careful with whet gets attached to it. GPIO0 and GPIO2 are involved in the boot process; GPIO0 must have a fixed external pull-up; GPIO2 must be left floating or pulled up for proper boot (the internal pull-up will be enabled during boot).

If using a latching shift register like the 595 use GPIO0, 1 and 3 (don't use Serial in the sketch), that leaves GPIO2 (Serial1 TX) available for debugging. As all three shift register pins are inputs, you will still be able to program the device over Serial.

If using a non latching shift register like the 164 I'd use GPIO0 and 2 for the data and clock pins, leaving GPIO1 and 3 free - for Serial, for example.
I have 74hc595n(1538HXL SN74HC595N) But i haven't used it before this will be my first time using it so with it i can make the esp8266-01 standalone right ?

wvmarle

Should work - be sure to understand the working of the signals, the Serial levels, and the boot process of the ESP8266 to get it all to work correctly. You can not just freely choose your pins!

Don't forget the decoupling cap for the shift register... one per chip...
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up