Connecting the esp2866-12

Hello my friends,

My goal is to send some data from an accelerometer to a website on my pc in real time.

I have an Arduino Nano V3, an ADXL335 accelerometer and a ESP2866-12 wireless module. I had programmed the Arduino for accelerometer and I have the right data on serial monitor from him.

But now, I don't want to have any connections(cable) from PC to arduino and I want to transmit data from the accelerometer wirelessly in real time to a website with the help of ESP2866-12. Internet will be available from a router witch have a range of 50m ( it's enough for me)

Questions:

  1. I have the battery, arduino board, accelerometer, and wifi module (+alot of wires for connections). Do I need anything else?

  2. How do I connect the wireless module to the arduino board ( witch pin from arduino to witch pin to wireless module) ?

Thanks!

http://dalpix.com/blog/connecting-your-arduino-wifi-esp-8266-module

Unless you have a 3v3 arduino you will need to convert levels- connecting the 5V signals from the standard arduino will destroy your esp-12 module. You also need to supply 3v3 power to your ESP-12 somehow.

If you dont have a proper level-converter you can improvise one out of diodes and resistors to drop the 5V arduino output down to 3v3. Arduino 5V inputs should be able to read the ESP-12 3v3 outputs so you dont need to do anything special on that side.

Ok, thank you for your answer. I was looking for some details becouse I saw alot of projects on the internet with this wifi using an USB UART Board and I thought I need one too. (by the way what's up with that UART? What's his purpose?)

Let's say that the only difference on this module is that is an ESP8266-12 not an ESP8266, but I belive it's the same thing. The only difference is on GPIO pins.

No one knows? :slight_smile:

The original ESP8266 modules only supported 115200 baud so software serial would not work as it will not support 115200 baud. When using an 8266 with an Arduino the choices were to use hardware serial to talk to the 8266 and software serial for talking to the PC or use an external UART that could support 115200 baud and have the Arduino hardware serial to talk to the PC. The first choice is a pain because the hardware serial is used to program the Arduino. The newer 8266 modules can be changed to use a slower baud rate so software serial will work.

I hope my ESP8266-12 will support a slower baud rate.

I had to burn new firmware to the two 8266 modules that I bought to be able to set the baud to 9600. I burned the new firmware using a FTDI and set the baud to 9600. Then I could use software serial to communicate with the 8266 modules at 9600 baud with my Uno. You need the flasher program to burn the firmware. I don't remember where I got it and don't have time to find out right now, but I found it by searching google.

I had made the next circuit with arduino and esp8266:
Arduino is powered from the computer and the ESP module from a phone charger with a voltage regulator 3.3V

Of course I had connected CH_PD pin from the module to 3.3V trought a 10k resistor, TX module->RX arduino and TX arduino trought a 3.3V regulator to RX pin from module. Also GND module->GND arduino, and GND arduino->GND phone charger to keep the same voltage reference.

Code:

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX
 
void setup() 
{
    Serial.begin(115200);     // communication with the host computer
    //while (!Serial)   { ; }
 
    // Start the software serial for communication with the ESP8266
    ESPserial.begin(115200);  
 
    Serial.println("");
    Serial.println("Remember  to set Both NL & CR in the serial monitor.");
    Serial.println("Ready");
    Serial.println("");    
}
 
void loop() 
{
    // listen for communication from the ESP8266 and then write it to the serial monitor
    if ( ESPserial.available() )   {  Serial.write( ESPserial.read() );  }
 
    // listen for user input and send it to the ESP8266
    if ( Serial.available() )       {  ESPserial.write( Serial.read() );  }

I send AT command in serial monitor and…I get no response.
How can I fix this module and how can I know what firmware this module have?

My goal is to send some datas from an accelerometer witch is put into an RC car and view them on my laptop in real time.

Thanks!

I upload that code to arduino and then open my serial monitor, set both N&CR and baud rate to 115200. I conect the module to power supply and I get this:

Remember to set Both NL & CR in the serial monitor.
Ready

...and then something weird that I cannot copy here I don t know why with ,, äsl��oÿ
Ai-Thinker Technology Co. Ltd qfad^Hü " at the end. And if I wrote AT and send it nothing is happend.

Maybe putting the Arduino TX through a 3.3 regulator is not working. The TX from the module to the Arduino seems to work as the stuff that you are getting looks right for what the 8266 sends on reset. Try using a resistor voltage divider to drop the Arduino TX instead of the regulator. Or a 4050 chip to shift the voltage.

Ok, I'll try tomorrow with a voltage divider. I know that all the pins from ESP works on 3.3V and that was the reason I had connected the RX pin that way.

I made a voltage divider like you said ,,groundfungus" and I had eliminate the voltage regulator for 3.3V. Now the module is working.....but.... the problem is that digital pins from my arduino give 4.7V and not 5V. So, with a voltage divider I have 3V not 3.3V and when I write in Serial monitor AT+GMR the message is distorsionated:

Remember  to set Both NL & CR in the serial monitor.
Ready

AT


OK
AT+GMR

AT version:0.35.0.0(Jun  4 2015 16:27;16)
SDK vession:1.1.io
5

Another problem is that I set in my code Serial.begin and ESPserial.begin to a 115200 baud rate to work. But I want a baud rate of 9600. So, I need a USB-Serial converter to burn a new firmware on my ESP module right? In this case I need to buy one becouse I don't have it.

For the second problem I will write here when I'll buy the converter. But now, can I do something to resolve the first problem? Or it's not such a big problem?
Thanks!

Can someone help me please?