Go Down

Topic: Arduino UNO, ESP01 and Relay board not working (Read 541 times) previous topic - next topic

shaikhfk

Hello Community!

I am new here so pardon me if am posting my query at wrong place and guide me with suitable solution.

I want to build a simple system where i can ON/OFF relays using Android app connected with ESP WiFi which is furthe connected to Arduino UNO.

I have searched a lot and tried implementing same but i guess the code which is provided is for NodeMCU rather UNO which i am looking for.

Any help is highly appreciated!

pert

This example sketch does something like what you want and is written for a standard Arduino board like your Uno that's using an ESP8266 loaded with the AT firmware to provide WiFi connectivity:
https://github.com/bportaluri/WiFiEsp/blob/master/examples/WebServerLed/WebServerLed.ino
Although it says it's for turning an LED on and off, it's really just about controlling the state of one of the IO pins on the Uno via a webserver. As long as you have the correct circuit, it makes no difference whether an LED or a relay is connected to that pin.

It is an example sketch of the WiFiEsp library, so you will need to install that library:
https://github.com/bportaluri/WiFiEsp

Hiddenvision

If your need is only for a single channel wifi switch then you could perhaps remove the UNO from the layout and just use the ESP for the full project.?

Sorry I know it is not nice to say "Don't use the Arduino", but it just seems overkill.
The ESP's have about 8 or 9 useable I/O pins, With A2D, PWM, SPI and other builtin's they are very capable standalone devices. The only downside is the lower I/O count and voltage tolerance of 3.3vMAX.
You still write, compile and program the code in the Arduino IDE,

The project Pert posted is right on the mark for your needs though and may suit the parts you have to hand

The ESP-01 is self limiting with only a few pins exposed, but very handy.
To make ESP'ing easy grab a Nodemcu 12e or similar.
One that looks like this Example EBAY item
Just something with all the pins available and the USB/PSU on the board.

Go Up