Im currently new on this and sucessfully made a sound-activated alarm with Arduino Uno and a microphone sensor. (If sound is detected, then it will alarm). Now, I am adding a ESP 8266 module into it so it can perform a HTTP GET or POST to IFTT Maker link.
My problem with it is how can I program the esp with arduino uno? Do I do something like this
https://github.com/bportaluri/WiFiEsp/blob/master/examples/WebClient/WebClient.ino
(and add the threshold for the microphone sensor, buzzers and LEDs)??
Thanks for helping
-
That would work if your ESP8266 had the AT+ firmware flashed onto it by default. What exact module do you have? If you have a NodeMCU board you might as well work on the ESP8266 directly for everythingMaximilian Gerhardt– Maximilian Gerhardt2018年05月02日 16:58:03 +00:00Commented May 2, 2018 at 16:58
-
Im using the small one with 8 pins (esp-01). ThanksHenrikh A.– Henrikh A.2018年05月02日 17:33:18 +00:00Commented May 2, 2018 at 17:33
1 Answer 1
Yes, the library
Is suited for your task because it implements talking to a ESP8266 over a software serial. On this serial connection, AT+ commands will be sent. This also means that you must have the AT firmware flashed onto your ESP-01.
If that is not the case you can download the binary image here and flash it with a serial adapter, as instructed with the tools on that page. You can check whether your ESP8266 has the firmware flashed by attach a UART adpater to the TX output. It should print a "ready" on bootup.
For your wire-up, you will just have to add VCC (+3.3V), GND, TX and RX connections to the ESP-01 board, preferable with a big capacitor between VCC and GND, as the ESP8266 draws a lot of power when sending data over WiFi.
-
Is it ok if i use something like this to connect so can use 5V instead? linkHenrikh A.– Henrikh A.2018年05月03日 12:27:48 +00:00Commented May 3, 2018 at 12:27
-
@HenrikhA. The ESP8266 is a 3.3V device, if you supply it with 5V it dies. It should also not receive a 5V signal. You will need a level shifter from the Arduino TX line to the ESP's RX line with a voltage divider. See martyncurrey.com/arduino-to-esp8266-serial-commincationMaximilian Gerhardt– Maximilian Gerhardt2018年05月03日 13:02:57 +00:00Commented May 3, 2018 at 13:02
-
@HenrikhA. Ah, I didn't see the link at the end. Yes, the adapter has a voltage regulator and bi-directional level shifters already on there. This module should be fine and you could give +5V (or V_USB) as VCC on there.Maximilian Gerhardt– Maximilian Gerhardt2018年05月03日 13:06:15 +00:00Commented May 3, 2018 at 13:06
-
I think I know what to do now. Thanks @MaximilianHenrikh A.– Henrikh A.2018年05月03日 15:02:24 +00:00Commented May 3, 2018 at 15:02