Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inzar86/arduino-serial-data-forwarder-to-esp8266-iot
Sending data from Arduino via serial communication to be forwarded by ESP IoT
https://github.com/inzar86/arduino-serial-data-forwarder-to-esp8266-iot
arduino arduino-uno esp8266 firebase firebase-realtime-database iot
Last synced: 2 days ago
JSON representation
Sending data from Arduino via serial communication to be forwarded by ESP IoT
- Host: GitHub
- URL: https://github.com/inzar86/arduino-serial-data-forwarder-to-esp8266-iot
- Owner: inzar86
- Created: 2024-07-29T08:25:46.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T13:45:53.000Z (3 months ago)
- Last Synced: 2024-10-17T17:19:59.286Z (20 days ago)
- Topics: arduino, arduino-uno, esp8266, firebase, firebase-realtime-database, iot
- Language: C++
- Homepage: https://www.inzarsalfikar.com/
- Size: 1.09 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arduino-Serial-Data-Forwarder-to-ESP8266-IoT
Sending data from Arduino via serial communication to be forwarded by ESP IoTESP8266 has 1 Analog Input, so.. I forward Multiple sensor data from arduino (Ex. Arduino Uno) over serial communication to ESP8266 and push it to Firebase
Working library for this project:
1. Editor Arduino, `Version:2.3.2`
2. EESP8266 Board, `Version:3.1.2`
3. Firebase ESP8266 Client, `Version:3.2.2`
4. MQ7 Library (Optional) just for example.
Arduino Side :
1. Collect sensor data from analog port or other pin,
2. Print it using Serial using this format `data1,data2,data3,X`, data1 is sensor 1, data2 is sensor 2, data3 is sensor 3 then after comma separator print `"X"` then (enter) in arduino use `Serial.println("X");`.
3. example implementation bellow.
``` C
Serial.print(data1);
Serial.print(",");
Serial.print(data2);
Serial.print(",");
Serial.print(data3);
Serial.print(",");
Serial.println("X");
```
4. Done.Esp8266 Side :
1. Read incoming serial data from arduino. use array for data stream.
2. send it to Firebase
``` Cint data[3];
while (Serial.available()) {
// get the new byte:
char inChar = (char)Serial.read();
if (inChar == ',') {
data[urutan] = inputString.toFloat();
inputString = "";
urutan++;
inChar = 0;
goto jump;
}
// add it to the inputString:
inputString += inChar;
jump:if (inChar == 'X') {
for(int i=0;i<3;i++)
{
Serial.print(data[i]);
Serial.print(",");
}// clear the string:
urutan = 0;
inputString = "";// For running
sensor1 = data[0];
sensor2 = data[1];
sensor3 = data[2];Firebase.setString(Data, "/yourFirebaseProjectBucket/yourFirebaseVariable1", (String)sensor1);
Firebase.setString(Data, "/yourFirebaseProjectBucket/yourFirebaseVariable2", (String)sensor2);
Firebase.setString(Data, "/yourFirebaseProjectBucket/yourFirebaseVariable3", (String)sensor3);
delay(1000);
}
}
```
3. doneEnjoy All your arduino pin to IoT.