Author Topic: interfacing ESP8266 with arduino for a simple project  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

Offline vis5254

  • Contributor
  • Posts: 12
  • Country: in
interfacing ESP8266 with arduino for a simple project
« on: March 03, 2019, 12:58:55 pm »
Hi Guys , my project is about fault monitoring unit for three phase motors . i did the coding part using arduino alone and whenever some fault happens , the arduino "serial prints" the respective fault and displays the the fault name on LCD . simulation worked accordingly .

i was able to realize that all these data (fault alert) could be send to web platform using ESP8266 . the only worry is that coding for esp8266 is a brainstorming one from my point of view .

So , is there a way to obtain the the required code meant for ARDUINO+ESP8266 unit , by making small alterations to this arduino code ( code without esp8266) , or by pasting it in between some standard codes or what ever ??

LOGIC : arduino serial prints an output . map that output to esp8266 . esp8266 to web !
plz help .

please dont worry about this code is correct or not , i just need to map the serial data into esp8266
Code: [Select]
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int a = A0;
int b = A1;
int c = A2;
int i = 0;

void setup()

{
Serial.begin(9600);
lcd.begin(16, 2);                    // set up the LCD's number of columns and rows:
lcd.print("Phase Monitoring ");     
pinMode(a,INPUT);
pinMode(b,INPUT);
pinMode(c,INPUT);
}

void loop()

{
   double r =analogRead(A0);
   double y=analogRead(A1);
   double b =analogRead(A2);

if(r>300 && r<750)
{
   delay (6.66666666);

   if((y>300 && y<750) && (i==0))


{

       Serial.println("RYB");
       lcd.println("RYB");
       i=1;

}

if((b>300 && b<750) && (i==0))

{

Serial.println("RBY");
lcd.println("phase reversed");
i=1;

}

}

if(r==0||y==0||b==0)
{

  Serial.println("single phasing");
  lcd.println("single phasing");
  delay(9600);
}

}
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 1806
  • Country: fr
    • kripton2035 schematics repository
Re: interfacing ESP8266 with arduino for a simple project
« Reply #1 on: March 03, 2019, 02:56:46 pm »
you don't need an esp8266 and an arduino. you need either one of them as an esp8266 "contains" an arduino.
it has more features (wifi) and less I/O pins.
see the 8266 server examples in the arduino ide, when you add the esp8266 boards to the boards list.

Offline Kasper

  • Regular Contributor
  • *
  • Posts: 236
  • Country: ca
Re: interfacing ESP8266 with arduino for a simple project
« Reply #2 on: March 04, 2019, 06:52:49 am »
Kripton probably has the best solution for you: load arduino into the esp8266.

If you really want to use whatever you already have hooked up and you don't have many error codes, you could use gpio to send the code from your sensor mcu (old arduino) to your wifi mcu (esp).

Lets say you decide to call 'single phasing' error code 1 and you use gpio 1 to transmit its occurance just to make it conveniently named.

If error code 1 occurs:
    Set gpio 1 in sensor mcu.
When esp detects pin change on gpio 1:
    Esp transmits 1 over wifi to your app.
When app receives 1:
    App prints "single phase"
 

Offline dsegel

  • Contributor
  • Posts: 22
  • Country: us
Re: interfacing ESP8266 with arduino for a simple project
« Reply #3 on: March 05, 2019, 05:01:04 am »
The ESP8266 is easy to use, but only supports 3.3V I/O and has much fewer I/O pins than say, a Nano. I use them a lot for simple projects. One thing to be careful about is that there are many different versions available. I find the Wemos and Adafruit boards to be the most consistent and reliable. 
 

Offline miubi

  • Newbie
  • Posts: 1
  • Country: in
    • Learn IOT using NodeMCU(Powered by ESP8266), MicroPython & PyCharm
Re: interfacing ESP8266 with arduino for a simple project
« Reply #4 on: March 28, 2019, 03:32:51 pm »
Quote
i was able to realize that all these data (fault alert) could be send to web platform using ESP8266 . the only worry is that coding for esp8266 is a brainstorming one from my point of view .

i dont think so, if you are woking on an ESP8266 board give a try towards micropython


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf