An ESP8266 + Arduino Uno Project that indicates the movement of a Forex Exchange Rate with LED indications.
Created using the ESP8266 + Arduino Kit
Refer to this tutorial : https://blog.device-interactions.com/2018/05/a-real-time-forex-tracker-with-esp8266.html
This project demonstrates an advanced implementation using the ESP8266/NodeMCU along with the Arduino Uno
The ESP8266 connects to the internet via WiFi and grabs the EUR/USD Forex Rates every 10 seconds. Based on the movement of this value, it sends a UART message to the Arduino Uno (Rise / Fall / Unchanged) The Arduino Uno receives this UART message and accordingly lights up an indication LED (Green / Red / Yellow)
The ESP8266 carries out the Internet-facing functions
- It connects to a defined WiFi network
- It makes an HTTP GET request to an online Forex Rates Server
- It receives the response from the Server
- It filters the received data and stores only the required value
- It compares this value with the value received during the previous request
- Depending on the comparison with the previous value, it decides whether it is a RISE, FALL or CONST (unchanged)
- It sends this as a Software Serial Message to the connected Arduino Uno for LED indication
The Arduino Uno functions here as an indication controller, based on the Serial commands received
- It defines the known messages (same as the ones defined on the ESP8266 side)
- It opens a Software Serial bus and listens for messages
- On receiving a message, it compares it with the know messages
- On finding a match, it lights up the corresponding LED (Green for RISE, Red for FALL, Yellow for CONST/unchanged)
(ESP) D1 -> (Uno) 11
(ESP) D2 -> (Uno) 10
(ESP) Vin -> (Uno) 5V
(ESP) Gnd -> (Uno) Gnd
Make sure to connect only the ESP8266/NodeMCU to a PC via USB for Serial messages as well as power supply
pin 5 -> Red LED (via 330 Ohm LED) pin 6 -> Yellow LED (via 330 Ohm LED) pin 7 -> Green LED (via 330 Ohm LED)
Make sure to use a 330Ohm resistor from the Arduino pin to each LED. Make sure to connect the other end of the LEDs together and to the Arduino Ground
Arduino pin 5 ---^^^330Ohm^^^---->I(RED LED)------Arduino Gnd
Arduino pin 6 ---^^^330Ohm^^^---->I(YELLOW LED)---Arduino Gnd
Arduino pin 7 ---^^^330Ohm^^^---->I(GREEN LED)----Arduino Gnd