Computing > Embedded Computing

interfacing ESP8266 with arduino for a simple project

(1/1)

vis5254:
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: ---#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);
}

}
--- End code ---

kripton2035:
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.

Kasper:
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"

dsegel:
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. 

miubi:

--- 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 .
--- End quote ---

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

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version